<?xml version="1.0" encoding="UTF-8"?>
<page>
  <created-at type="datetime">2009-03-11T05:45:43Z</created-at>
  <description>Flesh out VM backup semantics</description>
  <id type="integer">1054</id>
  <name>CloudAPIVMRequests</name>
  <number type="integer">10</number>
  <person-id type="integer">11</person-id>
  <text>&lt;h1&gt;Cloud API Specification - Requests to VM Resources&lt;/h1&gt;

The requests documented in this section are directed to ''VM'' resources, which represent virtual machines.

__TOC__

= Get VM =

Retrieve information about a specific VM associated with a specified Cluster.

'''Synopsis:''' GET {URI of VM from the owning Cluster}

'''Request Headers:''' Accept, Authorization, X-Cloud-Client-Specification-Version.

'''Request Message Body:''' N/A.

'''Response Headers:''' Content-Length, Content-Type.

'''Response Message Body:''' VM.

'''Response Status:''' 200, 400, 401, 403, 404.

'''Example Request:'''  Retrieve information about a VM instance &quot;web01&quot;.

 GET /vms/33333
 Host: example.com
 Authorization: Basic xxxxxxxxxxxxxxxxxxx
 Accept: application/vnd.com.sun.cloud.VM+json
 X-Cloud-Client-Specification-Version: 0.1

'''Example Response:'''

 HTTP/1.1 200 OK
 Content-Type: application/vnd.com.sun.cloud.VM+json
 Content-Length: nnn
 
 {
   &quot;name&quot; : &quot;web01&quot;,
   &quot;uri&quot; : &quot;http://example.com/vms/33333&quot;
   &quot;run_status&quot; : &quot;STARTED&quot;,
   &quot;description&quot; : &quot;This is the old description&quot;
   ...
   &quot;back_up&quot; : &quot;http://example.com/back-up?vm=33333&quot;
   &quot;attach&quot; : &quot;http://example.com/attach?vm=33333&quot;,
   &quot;detach&quot; : &quot;http://example.com/detach-ip?vm=33333&quot;,
   ...
 }

= Update VM Properties =

Update an existing virtual machine definition.

'''Synopsis:''' PUT { URI of VM }

'''Request Headers:''' Accept, Authorization, Content-Length, Content-Type, X-Cloud-Client-Specification-Version.

'''Request Parameters:''' N/A.

'''Request Message Body:''' VM.

'''Response Headers:''' Content-Length, Content-Type.

'''Response Message Body:''' Status for use in tracking update progress.

'''Response Status:''' 202, 400, 401, 403, 404.

'''Status &quot;op&quot; Value:''' &quot;update-VM&quot;.

'''Status &quot;target_uri&quot; identifies:''' The VM receiving the PUT.

'''Example Request:'''  Update an existing VM named &quot;web01&quot; by modifying its description.

 PUT /vms/33333
 Host: example.com
 Authorization: Basic xxxxxxxxxxxxxxxxxxx
 Accept: application/vnd.com.sun.cloud.VM+json
 Content-Length: nnn
 Content-Type: application/vnd.com.sun.cloud.VM+json
 X-Cloud-Client-Specification-Version: 0.1
 
 {
   &quot;description&quot; : &quot;This is the new description&quot;
 }

'''Example Response:'''

 HTTP/1.1 202 Accepted
 Content-Type: application/vnd.com.sun.cloud.Status+json
 Content-Length: nnn
 
 {
   &quot;op&quot;: &quot;update-VM&quot;,
   &quot;progress&quot;: 100,
   &quot;target_uri&quot;: &quot;/vms/33333&quot;,
   &quot;status_uri&quot;: &quot;/statuses?op=update-vm&amp;seq=912874502&quot;,
   &quot;status&quot; : 200
 }

= Delete VM =

Delete an existing virtual machine currently associated with the specified virtual private data center.

'''Synopsis:''' DELETE { URI of VM }

'''Request Headers:''' Authorization, X-Compute-Client-Specification-Version.

'''Request Parameters:''' N/A.

'''Request Message Body:''' N/A.

'''Response Headers:''' Content-Length, Content-Type.

'''Response Message Body:''' Status for use in tracking deletion progress.

'''Response Status:''' 202, 400, 401, 403, 404.

'''Status &quot;op&quot; Value:''' &quot;delete-VM&quot;.

'''Status &quot;target_uri&quot; identifies:''' The VM being deleted.

'''Example Request:'''  Delete an existing VM named &quot;AppTier&quot; from an existing VDC named &quot;MyStore&quot;.

 DELETE /vdcs/MyStore/vms/AppTier
 Host: example.com
 Authorization: Basic xxxxxxxxxxxxxxxxxxx
 X-Compute-Client-Specification-Version: 0.1

'''Example Response:'''

 HTTP/1.1 202 Accepted
 Content-Type: application/vnd.com.sun.cloud.Status+json
 Content-Length: nnn
 
 {
   &quot;op&quot;: &quot;delete-VM&quot;,
   &quot;progress&quot;: 0,
   &quot;target_uri&quot;: &quot;/vdcs/MyStore/vms/AppTier&quot;,
   &quot;status_uri&quot;: &quot;/statuses?op=delete-vm&amp;vm=00eAA.f*&quot;
 }

= Attach VM To Public Address or VNet =

Attach the specified VM to a Public Address or VNet, depending on the media type of the included representation.

'''Synopsis:''' POST { VM's attach URI }

'''Request Headers:''' Authorization, Content-Length, Content-Type, X-Cloud-Client-Specification-Version.

'''Request Parameters:''' N/A.

'''Request Message Body:''' Public Address or VNet resource model.  Only the &quot;uri&quot; element of this resource model '''MUST''' be included.

'''Response Headers:''' Content-Length, Content-Type.

'''Response Message Body:''' Status for use in tracking attachment progress.

'''Response Status:''' 202, 400, 401, 403, 404.

'''Status &quot;op&quot; Value:''' &quot;attach&quot;.

'''Status &quot;target_uri&quot; identifies:''' The VM being attached to.

'''Example 1 Request:'''  Attach VM &quot;web01&quot; to Public Address &quot;Load Balanced&quot;.

 POST /attach?vm=33333
 Host: example.com
 Authorization: Basic xxxxxxxxxxxxxxxxxxx
 Content-Length: nnn
 Content-Type: application/vnd.com.sun.cloud.PublicAddress+json
 X-Cloud-Client-Specification-Version: 0.1
  
 {
  &quot;uri&quot; : &quot;http://example.com/addresses/107.236.66.83&quot;
 }

'''Example 1 Response:'''

 HTTP/1.1 202 Accepted
 Content-Type: application/vnd.com.sun.cloud.Status+json
 Content-Length: nnn
 
 {
   &quot;op&quot;: &quot;attach&quot;,
   &quot;progress&quot;: 0,
   &quot;target_uri&quot;: &quot;/X03/VirtualMachines/F83&quot;,
   &quot;status_uri&quot;: &quot;/statuses?op=attach-public&amp;a=107.236.66.83&quot;
 }

'''Example 2 Request:'''  Attach VM &quot;web01&quot; to VNet &quot;Front End&quot;.

 POST /attach?vm=33333
 Host: example.com
 Authorization: Basic xxxxxxxxxxxxxxxxxxx
 Content-Length: nnn
 Content-Type: application/vnd.com.sun.cloud.VNet+json
 X-Cloud-Client-Specification-Version: 0.1
  
 {
  &quot;uri&quot; : &quot;http://example.com/vnets/abcdefg&quot;
 }

'''Example 2 Response:'''

 HTTP/1.1 202 Accepted
 Content-Type: application/vnd.com.sun.cloud.Status+json
 Content-Length: nnn
 
 {
   &quot;op&quot;: &quot;attach&quot;,
   &quot;progress&quot;: 100,
   &quot;target_uri&quot;: &quot;/X03/VirtualMachines/F83&quot;,
   &quot;status_uri&quot;: &quot;/statuses?op=attach-public&amp;v=abcdefg&quot;,
   &quot;status&quot;: 200
 }

= Detach VM From Public Address or VNet =

Detach the specified VM from a Public Address or VNet, depending on the media type of the included representation.

'''Synopsis:''' POST { VM's detach URI }

'''Request Headers:''' Authorization, Content-Length, Content-Type, X-Cloud-Client-Specification-Version.

'''Request Parameters:''' N/A.

'''Request Message Body:''' Public Address or VNet resource model.  Only the &quot;uri&quot; element of this resource model '''MUST''' be included.

'''Response Headers:''' Content-Length, Content-Type.

'''Response Message Body:''' Status for use in tracking detachment progress.

'''Response Status:''' 202, 400, 401, 403, 404.

'''Status &quot;op&quot; Value:''' &quot;detach&quot;.

'''Status &quot;target_uri&quot; identifies:''' The VM being detached from.

'''Example 1 Request:'''  Detach VM &quot;web01&quot; from Public Address &quot;Load Balanced&quot;.

 POST /detach?vm=33333
 Host: example.com
 Authorization: Basic xxxxxxxxxxxxxxxxxxx
 Content-Length: nnn
 Content-Type: application/vnd.com.sun.cloud.PublicAddress+json
 X-Cloud-Client-Specification-Version: 0.1
  
 {
  &quot;uri&quot; : &quot;http://example.com/addresses/107.236.66.83&quot;
 }

'''Example 1 Response:'''

 HTTP/1.1 202 Accepted
 Content-Type: application/vnd.com.sun.cloud.Status+json
 Content-Length: nnn
 
 {
   &quot;op&quot;: &quot;detach&quot;,
   &quot;progress&quot;: 100,
   &quot;target_uri&quot;: &quot;/X03/VirtualMachines/F83&quot;,
   &quot;status_uri&quot;: &quot;/statuses?op=detach&amp;a=107.236.66.83&quot;,
   &quot;status&quot;: 200
 }

'''Example 2 Request:'''  Detach VM &quot;web01&quot; from VNet &quot;Front End&quot;.

 POST /detach?vm=33333
 Host: example.com
 Authorization: Basic xxxxxxxxxxxxxxxxxxx
 Content-Length: nnn
 Content-Type: application/vnd.com.sun.cloud.VNet+json
 X-Cloud-Client-Specification-Version: 0.1
  
 {
  &quot;uri&quot; : &quot;http://example.com/vnets/abcdefg&quot;
 }

'''Example 2 Response:'''

 HTTP/1.1 202 Accepted
 Content-Type: application/vnd.com.sun.cloud.Status+json
 Content-Length: nnn
 
 {
   &quot;op&quot;: &quot;detach&quot;,
   &quot;progress&quot;: 0,
   &quot;target_uri&quot;: &quot;/X03/VirtualMachines/F83&quot;,
   &quot;status_uri&quot;: &quot;/statuses?op=detach&amp;v=web01&quot;
 }

= Create VM Backup Snapshot =

Capture a backup snapshot of this VM, based on the characteristics in this request.

'''Synopsis:''' POST { VM's back_up URI }

'''Request Headers:''' Authorization, Content-Length, Content-Type, X-Cloud-Client-Specification-Version.

'''Request Parameters:''' N/A.

'''Request Message Body:''' Backup resource model.

'''Response Headers:''' Content-Length, Content-Type.

'''Response Message Body:''' Status for use in tracking backup progress.

'''Response Status:''' 202, 400, 401, 403, 404.

'''Status &quot;op&quot; Value:''' &quot;back_up&quot;.

'''Status &quot;target_uri&quot; identifies:''' The Backup being created.

'''Example Request:'''  Create backup of VM &quot;web01&quot;.

 POST /back_up?vm=33333
 Host: example.com
 Authorization: Basic xxxxxxxxxxxxxxxxxxx
 Content-Length: nnn
 Content-Type: application/vnd.com.sun.cloud.Backup+json
 X-Cloud-Client-Specification-Version: 0.1
  
 {
  &quot;name&quot; : &quot;web01_backup_YYYYMMDD&quot;
 }

'''Example Response:'''

 HTTP/1.1 202 Accepted
 Content-Type: application/vnd.com.sun.cloud.Status+json
 Content-Length: nnn
 
 {
   &quot;op&quot;: &quot;back_up&quot;,
   &quot;progress&quot;: 0,
   &quot;target_uri&quot;: &quot;/X03/VirtualMachines/F83/Backups/456&quot;,
   &quot;status_uri&quot;: &quot;/statuses?op=back_up&amp;b=456&quot;
 }

= Control VM =

A ''VM'' resource model may include one or more URIs in the ''controllers'' field, each keyed by the name of a state change being requested.  Only the state changes that are legal for the current state of the VM will be included.  A client application requests a state change by doing a POST to the corresponding URI, and including in the request body an arbitrary set of name/value pairs used to influence the operation of the state change.

By convention, the name/value pairs included in the request may contain a field named ''note'' whose value is a text string intended for recording in a log on the server, to help identify this request during log file analysis.
'''Synopsis:''' POST {URI provided in VM representation}

'''Request Headers:''' Accept, Authorization, Content-Length, Content-Type, X-Cloud-Client-Specification-Version.

'''Request Parameters:''' N/A.

'''Request Message Body:''' Name/value pairs, with media type &quot;application/json&quot;.

'''Response Headers:''' Content-Length, Content-Type.

'''Response Message Body:''' Status for use in tracking request progress.

'''Response Status:''' 202, 400, 401, 403, 404.

'''Status &quot;op&quot; Value:''' &quot;start-VM&quot;, &quot;stop-VM&quot;, &quot;reboot-VM&quot;, &quot;hibernate-VM&quot;, &quot;resume-VM&quot;

'''Status &quot;target_uri&quot; identifies:''' The VM receiving the request.

'''Example Request:''' Start this VM.

 POST /vms/33333?control=start
 Host: example.com
 Authorization: Basic xxxxxxxxxxxxxxxxxxx
 Content-Length: nnn
 Content-Type: application/json
 X-Compute-Client-Specification-Version: 0.1
 
 {
   &quot;note&quot; : &quot;Start this web tier server&quot;
 }

'''Example Response:'''

 HTTP/1.1 202 Accepted
 Content-Type: application/vnd.com.sun.cloud.Status+json
 Content-Length: nnn
 
 {
   &quot;op&quot;: &quot;start-VM&quot;,
   &quot;progress&quot;: 0,
   &quot;target_uri&quot;: &quot;/vms/33333&quot;,
   &quot;status_uri&quot;: &quot;/statuses?op=start-VM&amp;vm=33333&quot;
 }

Here is a table describing the effects and usage of the available control URIs. 

{|- border=&quot;1&quot; width=&quot;100%&quot;
! Change Type
! Start State
! Transitional State
! Transitional State
! Transitional State
! Destination State
|-
| start
| STOPPED
| STARTING
|
|
| STARTED
|-
| stop
| STARTED
| STOPPING
|
|
| STOPPED
|-
| reboot
| STARTED
| STOPPING
| STOPPED
| STARTING
| STARTED
|-
| hibernate
| STARTED
| SLEEPING
|
|
| ASLEEP
|-
| resume
| ASLEEP
| WAKING
|
|
| STARTED
|}

Copyright &amp;copy; Sun Microsystems, 2009.  This work is licensed under [http://creativecommons.org/licenses/by/3.0/ Creative Commons Attribution 3.0 Unported License]</text>
  <text-as-html>&lt;p&gt;&lt;h1&gt;Cloud API Specification - Requests to VM Resources&lt;/h1&gt;

&lt;/p&gt;&lt;p&gt;The requests documented in this section are directed to &lt;i&gt;VM&lt;/i&gt; resources, which represent virtual machines.

&lt;/p&gt;&lt;div id='toc' class='toc'&gt;
           &lt;div id='toctitle' class='toc-title'&gt;
             &lt;span&gt;Contents&lt;/span&gt;
           &lt;/div&gt;
           &lt;div id='toccontents' class='toc-contents'&gt;&lt;ul&gt;&lt;li&gt;1 &lt;a href='#Get_VM'&gt; Get VM &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2 &lt;a href='#Update_VM_Properties'&gt; Update VM Properties &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;3 &lt;a href='#Delete_VM'&gt; Delete VM &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;4 &lt;a href='#Attach_VM_To_Public_Address_or_VNet'&gt; Attach VM To Public Address or VNet &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;5 &lt;a href='#Detach_VM_From_Public_Address_or_VNet'&gt; Detach VM From Public Address or VNet &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;6 &lt;a href='#Create_VM_Backup_Snapshot'&gt; Create VM Backup Snapshot &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;7 &lt;a href='#Control_VM'&gt; Control VM &lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
         &lt;/div&gt;&lt;p&gt;&lt;br /&gt;

&lt;/p&gt;&lt;h1&gt;&lt;a name='Get_VM'&gt;&lt;/a&gt; Get VM &lt;/h1&gt;
&lt;p&gt;
Retrieve information about a specific VM associated with a specified Cluster.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Synopsis:&lt;/b&gt; GET {URI of VM from the owning Cluster}

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Headers:&lt;/b&gt; Accept, Authorization, X-Cloud-Client-Specification-Version.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Message Body:&lt;/b&gt; N/A.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Headers:&lt;/b&gt; Content-Length, Content-Type.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Message Body:&lt;/b&gt; VM.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Status:&lt;/b&gt; 200, 400, 401, 403, 404.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Example Request:&lt;/b&gt;  Retrieve information about a VM instance &amp;quot;web01&amp;quot;.

&lt;/p&gt;&lt;pre&gt; GET /vms/33333
 Host: example.com
 Authorization: Basic xxxxxxxxxxxxxxxxxxx
 Accept: application/vnd.com.sun.cloud.VM+json
 X-Cloud-Client-Specification-Version: 0.1
&lt;/pre&gt;&lt;p&gt;&lt;b&gt;Example Response:&lt;/b&gt;

&lt;/p&gt;&lt;pre&gt; HTTP/1.1 200 OK
 Content-Type: application/vnd.com.sun.cloud.VM+json
 Content-Length: nnn
 
 {
   &amp;quot;name&amp;quot; : &amp;quot;web01&amp;quot;,
   &amp;quot;uri&amp;quot; : &amp;quot;&lt;a class='external' href=&quot;http://example.com/vms/33333&quot;&gt;http://example.com/vms/33333&lt;/a&gt;&amp;quot;
   &amp;quot;run_status&amp;quot; : &amp;quot;STARTED&amp;quot;,
   &amp;quot;description&amp;quot; : &amp;quot;This is the old description&amp;quot;
   ...
   &amp;quot;back_up&amp;quot; : &amp;quot;&lt;a class='external' href=&quot;http://example.com/back-up?vm=33333&quot;&gt;http://example.com/back-up?vm=33333&lt;/a&gt;&amp;quot;
   &amp;quot;attach&amp;quot; : &amp;quot;&lt;a class='external' href=&quot;http://example.com/attach?vm=33333&quot;&gt;http://example.com/attach?vm=33333&lt;/a&gt;&amp;quot;,
   &amp;quot;detach&amp;quot; : &amp;quot;&lt;a class='external' href=&quot;http://example.com/detach-ip?vm=33333&quot;&gt;http://example.com/detach-ip?vm=33333&lt;/a&gt;&amp;quot;,
   ...
 }
&lt;/pre&gt;&lt;h1&gt;&lt;a name='Update_VM_Properties'&gt;&lt;/a&gt; Update VM Properties &lt;/h1&gt;
&lt;p&gt;
Update an existing virtual machine definition.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Synopsis:&lt;/b&gt; PUT { URI of VM }

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Headers:&lt;/b&gt; Accept, Authorization, Content-Length, Content-Type, X-Cloud-Client-Specification-Version.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Parameters:&lt;/b&gt; N/A.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Message Body:&lt;/b&gt; VM.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Headers:&lt;/b&gt; Content-Length, Content-Type.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Message Body:&lt;/b&gt; Status for use in tracking update progress.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Status:&lt;/b&gt; 202, 400, 401, 403, 404.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Status &amp;quot;op&amp;quot; Value:&lt;/b&gt; &amp;quot;update-VM&amp;quot;.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Status &amp;quot;target_uri&amp;quot; identifies:&lt;/b&gt; The VM receiving the PUT.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Example Request:&lt;/b&gt;  Update an existing VM named &amp;quot;web01&amp;quot; by modifying its description.

&lt;/p&gt;&lt;pre&gt; PUT /vms/33333
 Host: example.com
 Authorization: Basic xxxxxxxxxxxxxxxxxxx
 Accept: application/vnd.com.sun.cloud.VM+json
 Content-Length: nnn
 Content-Type: application/vnd.com.sun.cloud.VM+json
 X-Cloud-Client-Specification-Version: 0.1
 
 {
   &amp;quot;description&amp;quot; : &amp;quot;This is the new description&amp;quot;
 }
&lt;/pre&gt;&lt;p&gt;&lt;b&gt;Example Response:&lt;/b&gt;

&lt;/p&gt;&lt;pre&gt; HTTP/1.1 202 Accepted
 Content-Type: application/vnd.com.sun.cloud.Status+json
 Content-Length: nnn
 
 {
   &amp;quot;op&amp;quot;: &amp;quot;update-VM&amp;quot;,
   &amp;quot;progress&amp;quot;: 100,
   &amp;quot;target_uri&amp;quot;: &amp;quot;/vms/33333&amp;quot;,
   &amp;quot;status_uri&amp;quot;: &amp;quot;/statuses?op=update-vm&amp;amp;seq=912874502&amp;quot;,
   &amp;quot;status&amp;quot; : 200
 }
&lt;/pre&gt;&lt;h1&gt;&lt;a name='Delete_VM'&gt;&lt;/a&gt; Delete VM &lt;/h1&gt;
&lt;p&gt;
Delete an existing virtual machine currently associated with the specified virtual private data center.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Synopsis:&lt;/b&gt; DELETE { URI of VM }

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Headers:&lt;/b&gt; Authorization, X-Compute-Client-Specification-Version.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Parameters:&lt;/b&gt; N/A.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Message Body:&lt;/b&gt; N/A.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Headers:&lt;/b&gt; Content-Length, Content-Type.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Message Body:&lt;/b&gt; Status for use in tracking deletion progress.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Status:&lt;/b&gt; 202, 400, 401, 403, 404.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Status &amp;quot;op&amp;quot; Value:&lt;/b&gt; &amp;quot;delete-VM&amp;quot;.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Status &amp;quot;target_uri&amp;quot; identifies:&lt;/b&gt; The VM being deleted.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Example Request:&lt;/b&gt;  Delete an existing VM named &amp;quot;AppTier&amp;quot; from an existing VDC named &amp;quot;MyStore&amp;quot;.

&lt;/p&gt;&lt;pre&gt; DELETE /vdcs/MyStore/vms/AppTier
 Host: example.com
 Authorization: Basic xxxxxxxxxxxxxxxxxxx
 X-Compute-Client-Specification-Version: 0.1
&lt;/pre&gt;&lt;p&gt;&lt;b&gt;Example Response:&lt;/b&gt;

&lt;/p&gt;&lt;pre&gt; HTTP/1.1 202 Accepted
 Content-Type: application/vnd.com.sun.cloud.Status+json
 Content-Length: nnn
 
 {
   &amp;quot;op&amp;quot;: &amp;quot;delete-VM&amp;quot;,
   &amp;quot;progress&amp;quot;: 0,
   &amp;quot;target_uri&amp;quot;: &amp;quot;/vdcs/MyStore/vms/AppTier&amp;quot;,
   &amp;quot;status_uri&amp;quot;: &amp;quot;/statuses?op=delete-vm&amp;amp;vm=00eAA.f*&amp;quot;
 }
&lt;/pre&gt;&lt;h1&gt;&lt;a name='Attach_VM_To_Public_Address_or_VNet'&gt;&lt;/a&gt; Attach VM To Public Address or VNet &lt;/h1&gt;
&lt;p&gt;
Attach the specified VM to a Public Address or VNet, depending on the media type of the included representation.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Synopsis:&lt;/b&gt; POST { VM's attach URI }

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Headers:&lt;/b&gt; Authorization, Content-Length, Content-Type, X-Cloud-Client-Specification-Version.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Parameters:&lt;/b&gt; N/A.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Message Body:&lt;/b&gt; Public Address or VNet resource model.  Only the &amp;quot;uri&amp;quot; element of this resource model &lt;b&gt;MUST&lt;/b&gt; be included.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Headers:&lt;/b&gt; Content-Length, Content-Type.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Message Body:&lt;/b&gt; Status for use in tracking attachment progress.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Status:&lt;/b&gt; 202, 400, 401, 403, 404.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Status &amp;quot;op&amp;quot; Value:&lt;/b&gt; &amp;quot;attach&amp;quot;.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Status &amp;quot;target_uri&amp;quot; identifies:&lt;/b&gt; The VM being attached to.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Example 1 Request:&lt;/b&gt;  Attach VM &amp;quot;web01&amp;quot; to Public Address &amp;quot;Load Balanced&amp;quot;.

&lt;/p&gt;&lt;pre&gt; POST /attach?vm=33333
 Host: example.com
 Authorization: Basic xxxxxxxxxxxxxxxxxxx
 Content-Length: nnn
 Content-Type: application/vnd.com.sun.cloud.PublicAddress+json
 X-Cloud-Client-Specification-Version: 0.1
  
 {
  &amp;quot;uri&amp;quot; : &amp;quot;&lt;a class='external' href=&quot;http://example.com/addresses/107.236.66.83&quot;&gt;http://example.com/addresses/107.236.66.83&lt;/a&gt;&amp;quot;
 }
&lt;/pre&gt;&lt;p&gt;&lt;b&gt;Example 1 Response:&lt;/b&gt;

&lt;/p&gt;&lt;pre&gt; HTTP/1.1 202 Accepted
 Content-Type: application/vnd.com.sun.cloud.Status+json
 Content-Length: nnn
 
 {
   &amp;quot;op&amp;quot;: &amp;quot;attach&amp;quot;,
   &amp;quot;progress&amp;quot;: 0,
   &amp;quot;target_uri&amp;quot;: &amp;quot;/X03/VirtualMachines/F83&amp;quot;,
   &amp;quot;status_uri&amp;quot;: &amp;quot;/statuses?op=attach-public&amp;amp;a=107.236.66.83&amp;quot;
 }
&lt;/pre&gt;&lt;p&gt;&lt;b&gt;Example 2 Request:&lt;/b&gt;  Attach VM &amp;quot;web01&amp;quot; to VNet &amp;quot;Front End&amp;quot;.

&lt;/p&gt;&lt;pre&gt; POST /attach?vm=33333
 Host: example.com
 Authorization: Basic xxxxxxxxxxxxxxxxxxx
 Content-Length: nnn
 Content-Type: application/vnd.com.sun.cloud.VNet+json
 X-Cloud-Client-Specification-Version: 0.1
  
 {
  &amp;quot;uri&amp;quot; : &amp;quot;&lt;a class='external' href=&quot;http://example.com/vnets/abcdefg&quot;&gt;http://example.com/vnets/abcdefg&lt;/a&gt;&amp;quot;
 }
&lt;/pre&gt;&lt;p&gt;&lt;b&gt;Example 2 Response:&lt;/b&gt;

&lt;/p&gt;&lt;pre&gt; HTTP/1.1 202 Accepted
 Content-Type: application/vnd.com.sun.cloud.Status+json
 Content-Length: nnn
 
 {
   &amp;quot;op&amp;quot;: &amp;quot;attach&amp;quot;,
   &amp;quot;progress&amp;quot;: 100,
   &amp;quot;target_uri&amp;quot;: &amp;quot;/X03/VirtualMachines/F83&amp;quot;,
   &amp;quot;status_uri&amp;quot;: &amp;quot;/statuses?op=attach-public&amp;amp;v=abcdefg&amp;quot;,
   &amp;quot;status&amp;quot;: 200
 }
&lt;/pre&gt;&lt;h1&gt;&lt;a name='Detach_VM_From_Public_Address_or_VNet'&gt;&lt;/a&gt; Detach VM From Public Address or VNet &lt;/h1&gt;
&lt;p&gt;
Detach the specified VM from a Public Address or VNet, depending on the media type of the included representation.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Synopsis:&lt;/b&gt; POST { VM's detach URI }

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Headers:&lt;/b&gt; Authorization, Content-Length, Content-Type, X-Cloud-Client-Specification-Version.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Parameters:&lt;/b&gt; N/A.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Message Body:&lt;/b&gt; Public Address or VNet resource model.  Only the &amp;quot;uri&amp;quot; element of this resource model &lt;b&gt;MUST&lt;/b&gt; be included.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Headers:&lt;/b&gt; Content-Length, Content-Type.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Message Body:&lt;/b&gt; Status for use in tracking detachment progress.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Status:&lt;/b&gt; 202, 400, 401, 403, 404.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Status &amp;quot;op&amp;quot; Value:&lt;/b&gt; &amp;quot;detach&amp;quot;.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Status &amp;quot;target_uri&amp;quot; identifies:&lt;/b&gt; The VM being detached from.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Example 1 Request:&lt;/b&gt;  Detach VM &amp;quot;web01&amp;quot; from Public Address &amp;quot;Load Balanced&amp;quot;.

&lt;/p&gt;&lt;pre&gt; POST /detach?vm=33333
 Host: example.com
 Authorization: Basic xxxxxxxxxxxxxxxxxxx
 Content-Length: nnn
 Content-Type: application/vnd.com.sun.cloud.PublicAddress+json
 X-Cloud-Client-Specification-Version: 0.1
  
 {
  &amp;quot;uri&amp;quot; : &amp;quot;&lt;a class='external' href=&quot;http://example.com/addresses/107.236.66.83&quot;&gt;http://example.com/addresses/107.236.66.83&lt;/a&gt;&amp;quot;
 }
&lt;/pre&gt;&lt;p&gt;&lt;b&gt;Example 1 Response:&lt;/b&gt;

&lt;/p&gt;&lt;pre&gt; HTTP/1.1 202 Accepted
 Content-Type: application/vnd.com.sun.cloud.Status+json
 Content-Length: nnn
 
 {
   &amp;quot;op&amp;quot;: &amp;quot;detach&amp;quot;,
   &amp;quot;progress&amp;quot;: 100,
   &amp;quot;target_uri&amp;quot;: &amp;quot;/X03/VirtualMachines/F83&amp;quot;,
   &amp;quot;status_uri&amp;quot;: &amp;quot;/statuses?op=detach&amp;amp;a=107.236.66.83&amp;quot;,
   &amp;quot;status&amp;quot;: 200
 }
&lt;/pre&gt;&lt;p&gt;&lt;b&gt;Example 2 Request:&lt;/b&gt;  Detach VM &amp;quot;web01&amp;quot; from VNet &amp;quot;Front End&amp;quot;.

&lt;/p&gt;&lt;pre&gt; POST /detach?vm=33333
 Host: example.com
 Authorization: Basic xxxxxxxxxxxxxxxxxxx
 Content-Length: nnn
 Content-Type: application/vnd.com.sun.cloud.VNet+json
 X-Cloud-Client-Specification-Version: 0.1
  
 {
  &amp;quot;uri&amp;quot; : &amp;quot;&lt;a class='external' href=&quot;http://example.com/vnets/abcdefg&quot;&gt;http://example.com/vnets/abcdefg&lt;/a&gt;&amp;quot;
 }
&lt;/pre&gt;&lt;p&gt;&lt;b&gt;Example 2 Response:&lt;/b&gt;

&lt;/p&gt;&lt;pre&gt; HTTP/1.1 202 Accepted
 Content-Type: application/vnd.com.sun.cloud.Status+json
 Content-Length: nnn
 
 {
   &amp;quot;op&amp;quot;: &amp;quot;detach&amp;quot;,
   &amp;quot;progress&amp;quot;: 0,
   &amp;quot;target_uri&amp;quot;: &amp;quot;/X03/VirtualMachines/F83&amp;quot;,
   &amp;quot;status_uri&amp;quot;: &amp;quot;/statuses?op=detach&amp;amp;v=web01&amp;quot;
 }
&lt;/pre&gt;&lt;h1&gt;&lt;a name='Create_VM_Backup_Snapshot'&gt;&lt;/a&gt; Create VM Backup Snapshot &lt;/h1&gt;
&lt;p&gt;
Capture a backup snapshot of this VM, based on the characteristics in this request.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Synopsis:&lt;/b&gt; POST { VM's back_up URI }

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Headers:&lt;/b&gt; Authorization, Content-Length, Content-Type, X-Cloud-Client-Specification-Version.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Parameters:&lt;/b&gt; N/A.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Message Body:&lt;/b&gt; Backup resource model.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Headers:&lt;/b&gt; Content-Length, Content-Type.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Message Body:&lt;/b&gt; Status for use in tracking backup progress.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Status:&lt;/b&gt; 202, 400, 401, 403, 404.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Status &amp;quot;op&amp;quot; Value:&lt;/b&gt; &amp;quot;back_up&amp;quot;.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Status &amp;quot;target_uri&amp;quot; identifies:&lt;/b&gt; The Backup being created.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Example Request:&lt;/b&gt;  Create backup of VM &amp;quot;web01&amp;quot;.

&lt;/p&gt;&lt;pre&gt; POST /back_up?vm=33333
 Host: example.com
 Authorization: Basic xxxxxxxxxxxxxxxxxxx
 Content-Length: nnn
 Content-Type: application/vnd.com.sun.cloud.Backup+json
 X-Cloud-Client-Specification-Version: 0.1
  
 {
  &amp;quot;name&amp;quot; : &amp;quot;web01_backup_YYYYMMDD&amp;quot;
 }
&lt;/pre&gt;&lt;p&gt;&lt;b&gt;Example Response:&lt;/b&gt;

&lt;/p&gt;&lt;pre&gt; HTTP/1.1 202 Accepted
 Content-Type: application/vnd.com.sun.cloud.Status+json
 Content-Length: nnn
 
 {
   &amp;quot;op&amp;quot;: &amp;quot;back_up&amp;quot;,
   &amp;quot;progress&amp;quot;: 0,
   &amp;quot;target_uri&amp;quot;: &amp;quot;/X03/VirtualMachines/F83/Backups/456&amp;quot;,
   &amp;quot;status_uri&amp;quot;: &amp;quot;/statuses?op=back_up&amp;amp;b=456&amp;quot;
 }
&lt;/pre&gt;&lt;h1&gt;&lt;a name='Control_VM'&gt;&lt;/a&gt; Control VM &lt;/h1&gt;
&lt;p&gt;
A &lt;i&gt;VM&lt;/i&gt; resource model may include one or more URIs in the &lt;i&gt;controllers&lt;/i&gt; field, each keyed by the name of a state change being requested.  Only the state changes that are legal for the current state of the VM will be included.  A client application requests a state change by doing a POST to the corresponding URI, and including in the request body an arbitrary set of name/value pairs used to influence the operation of the state change.

&lt;/p&gt;&lt;p&gt;By convention, the name/value pairs included in the request may contain a field named &lt;i&gt;note&lt;/i&gt; whose value is a text string intended for recording in a log on the server, to help identify this request during log file analysis.
&lt;b&gt;Synopsis:&lt;/b&gt; POST {URI provided in VM representation}

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Headers:&lt;/b&gt; Accept, Authorization, Content-Length, Content-Type, X-Cloud-Client-Specification-Version.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Parameters:&lt;/b&gt; N/A.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Message Body:&lt;/b&gt; Name/value pairs, with media type &amp;quot;application/json&amp;quot;.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Headers:&lt;/b&gt; Content-Length, Content-Type.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Message Body:&lt;/b&gt; Status for use in tracking request progress.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Response Status:&lt;/b&gt; 202, 400, 401, 403, 404.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Status &amp;quot;op&amp;quot; Value:&lt;/b&gt; &amp;quot;start-VM&amp;quot;, &amp;quot;stop-VM&amp;quot;, &amp;quot;reboot-VM&amp;quot;, &amp;quot;hibernate-VM&amp;quot;, &amp;quot;resume-VM&amp;quot;

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Status &amp;quot;target_uri&amp;quot; identifies:&lt;/b&gt; The VM receiving the request.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Example Request:&lt;/b&gt; Start this VM.

&lt;/p&gt;&lt;pre&gt; POST /vms/33333?control=start
 Host: example.com
 Authorization: Basic xxxxxxxxxxxxxxxxxxx
 Content-Length: nnn
 Content-Type: application/json
 X-Compute-Client-Specification-Version: 0.1
 
 {
   &amp;quot;note&amp;quot; : &amp;quot;Start this web tier server&amp;quot;
 }
&lt;/pre&gt;&lt;p&gt;&lt;b&gt;Example Response:&lt;/b&gt;

&lt;/p&gt;&lt;pre&gt; HTTP/1.1 202 Accepted
 Content-Type: application/vnd.com.sun.cloud.Status+json
 Content-Length: nnn
 
 {
   &amp;quot;op&amp;quot;: &amp;quot;start-VM&amp;quot;,
   &amp;quot;progress&amp;quot;: 0,
   &amp;quot;target_uri&amp;quot;: &amp;quot;/vms/33333&amp;quot;,
   &amp;quot;status_uri&amp;quot;: &amp;quot;/statuses?op=start-VM&amp;amp;vm=33333&amp;quot;
 }
&lt;/pre&gt;&lt;p&gt;
Here is a table describing the effects and usage of the available control URIs. 

&lt;/p&gt;&lt;div style=&quot;overflow-x: auto;&quot;&gt;&lt;div style=&quot;margin: 0px 2px 0px 2px;&quot;&gt;
&lt;table - border=&quot;1&quot; width=&quot;100%&quot;&gt;&lt;tr&gt;&lt;th&gt; Change Type
&lt;/th&gt;&lt;th&gt; Start State
&lt;/th&gt;&lt;th&gt; Transitional State
&lt;/th&gt;&lt;th&gt; Transitional State
&lt;/th&gt;&lt;th&gt; Transitional State
&lt;/th&gt;&lt;th&gt; Destination State
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; start
&lt;/td&gt;&lt;td&gt; STOPPED
&lt;/td&gt;&lt;td&gt; STARTING
&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt; STARTED
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; stop
&lt;/td&gt;&lt;td&gt; STARTED
&lt;/td&gt;&lt;td&gt; STOPPING
&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt; STOPPED
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; reboot
&lt;/td&gt;&lt;td&gt; STARTED
&lt;/td&gt;&lt;td&gt; STOPPING
&lt;/td&gt;&lt;td&gt; STOPPED
&lt;/td&gt;&lt;td&gt; STARTING
&lt;/td&gt;&lt;td&gt; STARTED
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; hibernate
&lt;/td&gt;&lt;td&gt; STARTED
&lt;/td&gt;&lt;td&gt; SLEEPING
&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt; ASLEEP
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; resume
&lt;/td&gt;&lt;td&gt; ASLEEP
&lt;/td&gt;&lt;td&gt; WAKING
&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt; STARTED
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;
Copyright &amp;copy; Sun Microsystems, 2009.  This work is licensed under &lt;a class='external' href=&quot;http://creativecommons.org/licenses/by/3.0/&quot;&gt;Creative Commons Attribution 3.0 Unported License&lt;/a&gt;&lt;/p&gt;</text-as-html>
  <updated-at type="datetime">2009-09-24T20:28:39Z</updated-at>
  <wiki-id type="integer">3636</wiki-id>
</page>
