Product SiteDocumentation Site

14.4.  Snapshots Sub-Collection

A virtual machine may have any number of snapshots of its disk state and these are represented and managed through a collection which behaves similarly to other collections, as described by Chapter 8, Common Features.
Virtual machine snapshots are represented by a snapshot element containing the following snapshot-specific properties:

Element property icons

The icons used in the properties column of this table are described in Table 8.1, “Element property icons”
Element Type Description Properties
vm complex 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" complex A link to the previous snapshot of this virtual machine
When adding a new snapshot, only the description property may be specified.

Note

Note that it is not possible to modify snapshot properties using PUT.
Example 14.7. An XML representation of a virtual machine snapshot
<snapshot id="f5288fd5-5178-4b7d-b87c-c01a40e40168"
  href="/rhevm-api/vms/5114bb3e-a4e6-44b2-b783-b3eea7d84720/snapshots/
  f5288fd5-5178-4b7d-b87c-c01a40e40168">
    <description>foobar</description>
    <actions>
        <link rel="restore"
        href="/rhevm-api/vms/5114bb3e-a4e6-44b2-b783-b3eea7d84720/snapshots/
        f5288fd5-5178-4b7d-b87c-c01a40e40168/restore"/>
    </actions>
    <link rel="prev"
      href="/rhevm-api/vms/5114bb3e-a4e6-44b2-b783-b3eea7d84720/snapshots/
      ce411b3e-e4e0-4482-8b2f-d1ed998b9130"/>
    <vm id="5114bb3e-a4e6-44b2-b783-b3eea7d84720"
      href="/rhevm-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 /rhevm-api/vms/5114bb3e-a4e6-44b2-b783-b3eea7d84720/snapshots/f5288fd5-5178-4b7d-b87c-c01a40e40168/restore HTTP/1.1
Content-type: application/xml