Skip to main content
Glama

list_segments

Retrieve all VMware NSX network segments with details including type, subnet, admin state, and port count for network management.

Instructions

List all NSX network segments with type, subnet, admin state, and port count.

Args: target: Optional NSX Manager target name from config. Uses default if omitted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Implementation of the list_segments tool, which fetches network segments from the NSX Policy API.
    def list_segments(client: NsxClient) -> list[dict]:
        """List all network segments."""
        items = client.get_all("/policy/api/v1/infra/segments")
        return [
            {
                "id": _sanitize(s.get("id", "")),
                "display_name": _sanitize(s.get("display_name", "")),
                "type": s.get("type", "ROUTED"),
                "transport_zone_path": _sanitize(s.get("transport_zone_path", "")),
                "vlan_ids": s.get("vlan_ids", []),
                "subnet": [
                    {
                        "gateway": sub.get("gateway_address", ""),
                        "network": sub.get("network", ""),
                    }
                    for sub in s.get("subnets", [])
                ],
                "admin_state": s.get("admin_state", "UP"),
                "connectivity_path": _sanitize(s.get("connectivity_path", "")),
            }
            for s in items
        ]

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zw008/VMware-NSX'

If you have feedback or need assistance with the MCP directory API, please join our Discord server