pe_list_containers
Retrieve storage container details including name, capacity, usage, replication factor, and policies from a Nutanix Prism Element cluster.
Instructions
List storage containers on a Prism Element cluster. Returns names, capacity, usage, replication factor, and policies.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pe_host | Yes | Prism Element CVM IP address or hostname |
Implementation Reference
- The handler function for pe_list_containers. Calls client.pe_list(pe_host, 'containers'), then maps each container entity to name, containerUuid, storagePoolUuid, maxCapacityBytes, replicationFactor, compressionEnabled, and erasureCoded fields.
async def handle_pe_list_containers( client: NutanixClient, arguments: dict[str, Any] ) -> dict[str, Any]: """List storage containers from Prism Element v2 API.""" pe_host = arguments["pe_host"] result = await client.pe_list(pe_host, "containers") entities = result.get("entities", []) return { "count": len(entities), "containers": [ { "name": c.get("name"), "containerUuid": c.get("container_uuid"), "storagePoolUuid": c.get("storage_pool_uuid"), "maxCapacityBytes": c.get("max_capacity"), "replicationFactor": c.get("replication_factor"), "compressionEnabled": c.get("compression_enabled"), "erasureCoded": c.get("erasure_coded"), } for c in entities ], } - Tool definition and input schema for pe_list_containers. Defines name, description, and inputSchema requiring 'pe_host' (string).
{ "name": "pe_list_containers", "description": ( "List storage containers on a Prism Element cluster. " "Returns names, capacity, usage, replication factor, and policies." ), "inputSchema": { "type": "object", "properties": { "pe_host": { "type": "string", "description": "Prism Element CVM IP address or hostname", }, }, "required": ["pe_host"], }, }, - src/nutanix_mcp/tools/prism_element.py:420-431 (registration)PE_HANDLERS dispatch dict mapping tool name 'pe_list_containers' to its handler function handle_pe_list_containers.
PE_HANDLERS: dict[str, Any] = { "pe_get_cluster_info": handle_pe_get_cluster_info, "pe_list_vms": handle_pe_list_vms, "pe_list_hosts": handle_pe_list_hosts, "pe_list_containers": handle_pe_list_containers, "pe_list_storage_pools": handle_pe_list_storage_pools, "pe_list_disks": handle_pe_list_disks, "pe_list_alerts": handle_pe_list_alerts, "pe_list_protection_domains": handle_pe_list_protection_domains, "pe_list_snapshots": handle_pe_list_snapshots, } - src/nutanix_mcp/server.py:34-41 (registration)ALL_HANDLERS merges PE_HANDLERS (including pe_list_containers) into a single dispatch map used by the MCP server's call_tool handler.
# Merge all handler dispatch tables ALL_HANDLERS: dict[str, Any] = { **VM_HANDLERS, **CLUSTER_HANDLERS, **PE_HANDLERS, **REPORT_HANDLERS, **NETWORKING_HANDLERS, } - src/nutanix_mcp/client.py:436-457 (helper)The client.pe_list() helper method called by the handler. Delegates to pe_get() which makes an HTTP GET request to the Prism Element v2 API at /{resource} (here 'containers').
async def pe_list( self, pe_host: str, resource: str, count: Optional[int] = None, filter_criteria: Optional[str] = None, ) -> dict[str, Any]: """List resources from a Prism Element node using v2 API. Args: pe_host: Prism Element CVM IP or hostname resource: Resource type (e.g., 'vms', 'hosts', 'disks', 'containers') count: Max results to return filter_criteria: Filter string for the query """ params: dict[str, str] = {} if count is not None: params["count"] = str(count) if filter_criteria: params["filter_criteria"] = filter_criteria return await self.pe_get(pe_host, resource, params=params)