Skip to main content
Glama

get_ip_pool_usage

Retrieve IP pool allocation details including total, allocated, and free addresses to monitor and manage IP address utilization in VMware NSX environments.

Instructions

Get IP pool allocation usage details (total, allocated, free).

Args: pool_id: The IP pool ID. target: Optional NSX Manager target name from config. Uses default if omitted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pool_idYes
targetNo

Implementation Reference

  • The actual implementation of the get_ip_pool_usage function, which queries the NSX API and returns IP allocation details.
    def get_ip_pool_usage(client: NsxClient, pool_id: str) -> dict:
        """Get IP allocation details for a specific IP pool.
    
        Args:
            client: Authenticated NSX API client.
            pool_id: IP pool identifier.
    
        Returns:
            Dict with pool info and list of current allocations.
        """
        path = f"/policy/api/v1/infra/ip-pools/{pool_id}/ip-allocations"
        allocations = client.get_all(path)
        return {
            "pool_id": pool_id,
            "allocation_count": len(allocations),
            "allocations": [
                {
                    "id": _sanitize(a.get("id", "")),
                    "display_name": _sanitize(a.get("display_name", "")),
                    "allocation_ip": _sanitize(a.get("allocation_ip", "")),
                }
                for a in allocations
            ],
        }
  • The MCP tool registration for get_ip_pool_usage, which calls the helper in vmware_nsx.ops.networking.
    @mcp.tool()
    def get_ip_pool_usage(pool_id: str, target: str | None = None) -> dict:
        """Get IP pool allocation usage details (total, allocated, free).
    
        Args:
            pool_id: The IP pool ID.
            target: Optional NSX Manager target name from config. Uses default if omitted.
        """
        from vmware_nsx.ops.networking import get_ip_pool_usage as _get_usage
    
        client = _get_connection(target)
        return _get_usage(client, pool_id)

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