associate_ip_address
Assign a new public IP address to your network or VPC using the CloudStack MCP Server. Specify the zone, network, or VPC ID to manage IP allocation efficiently.
Instructions
Acquire a new public IP address
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| networkid | No | Network ID | |
| vpcid | No | VPC ID | |
| zoneid | No | Zone ID |
Implementation Reference
- src/handlers/network-handlers.ts:82-93 (handler)The main handler function that executes the tool logic: calls the CloudStack client to associate an IP address and formats the response as MCP content.async handleAssociateIpAddress(args: any) { const result = await this.cloudStackClient.associateIpAddress(args); return { content: [ { type: 'text', text: `Associated IP address. Job ID: ${result.associateipaddressresponse?.jobid}\nIP ID: ${result.associateipaddressresponse?.id}` } ] }; }
- Tool definition including name, description, and input schema (parameters: zoneid, networkid, vpcid).{ name: 'associate_ip_address', description: 'Acquire a new public IP address', inputSchema: { type: 'object', properties: { zoneid: { type: 'string', description: 'Zone ID', }, networkid: { type: 'string', description: 'Network ID', }, vpcid: { type: 'string', description: 'VPC ID', }, }, additionalProperties: false, }, },
- src/server.ts:156-157 (registration)Tool registration in the MCP server: routes 'associate_ip_address' calls to the network handler.case 'associate_ip_address': return await this.networkHandlers.handleAssociateIpAddress(args);
- src/cloudstack-client.ts:197-199 (helper)CloudStack client helper method that sends the 'associateIpAddress' API request.async associateIpAddress(params: CloudStackParams): Promise<CloudStackResponse> { return this.request('associateIpAddress', params); }