13.4. Snapshots Sub-Collection

A virtual machine saves and restores disk state as a number of snapshots. These are represented and managed through a rel="snapshot" sub-collection that behaves similar to other collections, as described in Chapter 7, Common Features.
Virtual machine snapshots are represented with snapshot elements that contain the following elements:

Note

The icons used in the properties column of this table are described in Table 7.1, “Element property icons”

Table 13.9. Elements for virtual machine snapshots

Element Type Description Properties
vm id= GUID The ID and URI of the virtual machine to which this snapshot pertains.
date xsd:dateTime format: YYYY-MM-DDThh:mm:ss The date and time at which this snapshot was created.
link rel="prev" relationship A link to the previous snapshot of this virtual machine.

When adding a new snapshot, only the description element is specified.

Note

Note that it is not possible to modify snapshot elements using PUT.

Example 13.14. An XML representation of a virtual machine snapshot

<snapshot id="f5288fd5-5178-4b7d-b87c-c01a40e40168"
  href="/api/vms/5114bb3e-a4e6-44b2-b783-b3eea7d84720/snapshots/
  f5288fd5-5178-4b7d-b87c-c01a40e40168">
    <description>Virtual Machine 1 - Snapshot A</description>
    <actions>
        <link rel="restore"
        href="/api/vms/5114bb3e-a4e6-44b2-b783-b3eea7d84720/snapshots/
        f5288fd5-5178-4b7d-b87c-c01a40e40168/restore"/>
    </actions>
    <link rel="prev"
      href="/api/vms/5114bb3e-a4e6-44b2-b783-b3eea7d84720/snapshots/
      ce411b3e-e4e0-4482-8b2f-d1ed998b9130"/>
    <vm id="5114bb3e-a4e6-44b2-b783-b3eea7d84720"
      href="/api/vms/5114bb3e-a4e6-44b2-b783-b3eea7d84720"/>
    <date>2010-08-16T14:24:29</date>
</snapshot>

An API user restores to a virtual machine snapshot using the rel="restore" action link in the snapshot representation.
POST /api/vms/5114bb3e-a4e6-44b2-b783-b3eea7d84720/snapshots/f5288fd5-5178-4b7d-b87c-c01a40e40168/restore HTTP/1.1
Accept: application/xml
Content-type: application/xml

<action/>