list_transport_nodes
Retrieve transport nodes with their type and status for VMware NSX network management and monitoring.
Instructions
List all transport nodes with type and status.
Args: target: Optional NSX Manager target name from config. Uses default if omitted.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- mcp_server/server.py:183-192 (handler)The MCP tool handler function for `list_transport_nodes` which handles the request and calls the underlying operation.
def list_transport_nodes(target: str | None = None) -> list[dict]: """List all transport nodes with type and status. Args: target: Optional NSX Manager target name from config. Uses default if omitted. """ from vmware_nsx.ops.inventory import list_transport_nodes as _list_tns client = _get_connection(target) return _list_tns(client) - vmware_nsx/ops/inventory.py:179-205 (handler)The core implementation of `list_transport_nodes` that fetches and processes data from the NSX API.
def list_transport_nodes(client: NsxClient) -> list[dict]: """List all transport nodes (ESXi hosts, Edge nodes).""" items = client.get_all("/api/v1/transport-nodes") result: list[dict] = [] for n in items: ip_addresses: list[str] = [] host_switch_spec = n.get("host_switch_spec") if host_switch_spec: switches = host_switch_spec.get("host_switches", []) if switches: ip_spec = switches[0].get("ip_assignment_spec", {}) ip_addresses = ip_spec.get("ip_list", []) result.append( { "id": _sanitize(n.get("id", "")), "display_name": _sanitize(n.get("display_name", "")), "node_type": n.get("resource_type", ""), "ip_addresses": ip_addresses, "maintenance_mode": n.get("maintenance_mode", "DISABLED"), } ) return result # --------------------------------------------------------------------------- # Edge Clusters