list_static_routes
Retrieve configured static routes on a Tier-1 gateway to view network path definitions and routing configurations.
Instructions
List static routes on a Tier-1 gateway.
Args: tier1_id: The Tier-1 gateway ID. target: Optional NSX Manager target name from config. Uses default if omitted.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tier1_id | Yes | ||
| target | No |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- mcp_server/server.py:242-252 (handler)The MCP tool handler function for `list_static_routes` which calls the underlying operational helper.
def list_static_routes(tier1_id: str, target: str | None = None) -> list[dict]: """List static routes on a Tier-1 gateway. Args: tier1_id: The Tier-1 gateway ID. target: Optional NSX Manager target name from config. Uses default if omitted. """ from vmware_nsx.ops.networking import list_static_routes as _list_routes client = _get_connection(target) return _list_routes(client, tier1_id) - vmware_nsx/ops/networking.py:172-198 (helper)The core implementation of the static route listing logic, interacting directly with the NSX API.
def list_static_routes( client: NsxClient, gateway_id: str, gateway_type: str = "tier1", ) -> list[dict]: """List static routes on a gateway (Tier-0 or Tier-1). Args: client: Authenticated NSX API client. gateway_id: Gateway identifier. gateway_type: Either "tier0" or "tier1" (default "tier1"). Returns: List of static route dicts. """ gw_resource = "tier-0s" if gateway_type == "tier0" else "tier-1s" path = f"/policy/api/v1/infra/{gw_resource}/{gateway_id}/static-routes" items = client.get_all(path) return [ { "id": _sanitize(r.get("id", "")), "display_name": _sanitize(r.get("display_name", "")), "network": _sanitize(r.get("network", "")), "next_hops": [ { "ip_address": _sanitize( nh.get("ip_address", "")