Loading...
 

Enable or Disable Network for a Virtual Machine


HTTP VerbPUT
URI Template/virtualmachine/{vmID}/networkchange?enable={true|false}
MIME Typeapplication/vnd.pncp.v.1.0+json onwards
Normal HTTP Response Code202 Accepted
Invoked byResellers can invoke this for accounts in their hierarchy but not for their own account. End-clients cannot invoke this.
Response ModeAsynchronous.

Sample Request

PUT /pncp-external-api-rest/virtualmachine/5609/networkchange?enable=false HTTP/1.1
Accept: application/vnd.pncp.v.5.0+json
Authorization: PNCP NWQ4ZmJlNmZmYjZlNzAwMOD0=
Content-Type: application/vnd.pncp.v.5.0+json
Content-Length: 52
User-Agent: Jakarta Commons-HttpClient/3.1
Host: YOUR_API_URL

{
   "reSuspendNetworkInMinutes":null,
   "sendEmail":false
}

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: Wed, 18 Apr 2012 17:13:57 GMT

{
   "resourceURL":"/task/c916ceae-7e26-d49f3145090b-d49f314509b8"}
}

Field Info

Field Name
Required
reSuspendNetworkInMinutes
NO
sendEmail
YES

Notes

  • reSuspendNetworkMinutes should be left null when disabling the network of a VM. When enabling, it can either be populated with an integer of minutes, in which case network to the VM will be resuspended after that amount of time. Otherwise it can be left null in which case network is not resuspended automatically.