Loading...
 

Create Virtual Machine


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

Sample Request (Creating a Virtual Machine from Scratch)

POST /pncp-external-api-rest/account/88/node/1/device/virtualmachine HTTP/1.1
Accept: application/vnd.pncp.v.5.0+json  
Authorization: PNCP hZZG7Jljik8QmGLpABvKMXGMMh54pb8ZlQ/2XtQWX/g=
Content-Type: application/vnd.pncp.v.5.0+json  
Content-Length: 257
User-Agent: Jakarta Commons-HttpClient/3.1
Host: YOUR_API_URL
{
   "name":"ExternalVMTestc4de7e9b",
   "description":"this is a test VM", 
   "storageGB":16, 
   "memoryMB":512, 
   "vCPUs":1, 
   "storageType":"SATA",
   "powerStatus":"POWERED_OFF",
   "operatingSystemTemplate":{
      "resourceURL":"/ostemplate/3"
   },
   "imageResource":null,
   "newOperatingSystemAdminPassword":"xxxxx"
}

Sample Request (Creating a New Virtual Machine from an Image)

POST /pncp-external-api-rest/account/88/node/1/device/virtualmachine HTTP/1.1
Accept: application/vnd.pncp.v.5.0+json  
Authorization: PNCP hZZG7Jljik8QmGLpABvKMXGMMh54pb8ZlQ/2XtQWX/g=
Content-Type: application/vnd.pncp.v.5.0+json  
Content-Length: 257
User-Agent: Jakarta Commons-HttpClient/3.1
Host: YOUR_API_URL
{
   "name":"ExternalVMTestc4de7e9b",
   "description":"this is a test VM", 
   "storageGB":16, 
   "memoryMB":512, 
   "vCPUs":1, 
   "storageType":"SATA",
   "powerStatus":"POWERED_OFF",
   "operatingSystemTemplate":null,
   "imageResource":{
      "resourceURL":"/image/3"
   }
}

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 11:06:13 GMT

{
   "resourceURL":"/task/8ab670f8-36fd-496d-b214-17943e742c9f"
}

Field Info

Field Name
Required
name
YES
description
NO
storageGB
YES
memoryMB
YES
vCPUs
YES
storageType
Default: SATA
powerStatus
Default: POWERED_OFF
operatingSystemTemplate
YES (if imageResource is null)
newOperatingSystemAdminPassword
YES( if imageResource is null)
imageResource
YES (if operatingSystemTemplate and newOperatingSystemAdminPassword are null)