Loading...
 

Assign Private IP to Virtual Machine


HTTP VerbPOST
URI Template/virtualmachine/{vmID}/privateip
MIME Typeapplication/vnd.pncp.v.1.0+json onwards
Normal HTTP Response Code202 Accepted
Invoked ByResellers can invoke this for virtual machines found in their own account as well as any other account they own. End-clients can invoke this for virtual machines in their account only.
Response ModeAsynchronous.

Sample Request

POST /pncp-external-api-rest/virtualmachine/545/privateip HTTP/1.1
Accept: application/vnd.pncp.v.5.0+json
Authorization: PNCP nfYDOJ+A5DNIn1sC3RczNKlD8s+S0O5Bt5HoVSzoiGg=
Content-Type: application/vnd.pncp.v.5.0+json
Content-Length: 23
User-Agent: Jakarta Commons-HttpClient/3.1
Host: YOUR_API_URL

{
   "ipAddress":"10.0.0.60",
   "publicIpMappings":[
         "172.27.0.56",
         "172.27.0.57"
   ]
}

Sample Response

HTTP/1.1 202 Accepted
Server: Apache-Coyote/1.1
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache
Cache-Control: no-store
Content-Type: application/vnd.pncp.v.5.0+json
Transfer-Encoding: chunked
Date: Thu, 26 Jan 2012 13:21:30 GMT 
{
   "resourceURL":"/task/b9550509-413e-4446-9199-8a0ff6113027"
}

Notes

  • This call is only allowed for virtual machines residing in nodes with custom network configurations. Should this call be used within a different network configuration, a 405 “Method not allowed” error will be returned.

Field Info

Field Name
Required
ipAddress
YES
publicIpMappings
The private IP will not be mapped to any public IPs if this field is set to null.