Document navigation

Snapshot Group Operations

CreateVolumeSnapshotGroup

API Request

URLs
POST zstack/v1/volume-snapshots/group
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "rootVolumeUuid": "901cae4fd9f43a1ca20da4146ddaec50",
    "name": "test"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"rootVolumeUuid":"901cae4fd9f43a1ca20da4146ddaec50","name":"test"}}' http://localhost:8080/zstack/v1/volume-snapshots/group
Request Parameters
Name Type Location Description Optional Value Starting Version
rootVolumeUuid String body (contained in the params structure) The root volume UUID. 3.6.0
name String body (contained in the params structure) The resource name. 3.6.0
description String body (contained in the params structure) Optional. The detailed description of the resource. 3.6.0
resourceUuid String body (contained in the params structure) Optional. The resource UUID. 3.6.0
tagUuids List body (contained in the params structure) Optional. The tag UUID list. 3.6.0
systemTags List body Optional. The system tags. 3.6.0
userTags List body Optional. The user tags. 3.6.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "4b13e23059033e2dbfac63b5b16eba11",
    "snapshotCount": 1.0,
    "name": "group",
    "vmInstanceUuid": "9ff17180fded31c2b9e4e5751ebcb2ba",
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM",
    "volumeSnapshotRefs": [
      {
        "volumeSnapshotUuid": "e83b2d306f0d353a889096ca0b44b444",
        "volumeSnapshotGroupUuid": "4b13e23059033e2dbfac63b5b16eba11",
        "deviceId": 0.0,
        "snapshotDeleted": false,
        "volumeUuid": "edc07fe8d8a335ec8aa00f23b88fc1c6",
        "volumeName": "ROOT-volume",
        "volumeType": "Root",
        "volumeSnapshotInstallPath": "/Cloud_ps/to/path/snap.qcow2",
        "volumeSnapshotName": "group-ROOT-volume",
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "lastOpDate": "Nov 14, 2017 10:20:57 PM"
      }
    ]
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.6.0
inventory VolumeSnapshotGroupInventory See inventory. 3.6.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.6.0
description String The brief description of the error. 3.6.0
details String The details about the error. 3.6.0
elaboration String The reserved field. Default value: null. 3.6.0
opaque LinkedHashMap The reserved field. Default value: null. 3.6.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.6.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.6.0
snapshotCount Integer The number of snapshots in the snapshot group. 3.6.0
name String The resource name. 3.6.0
description String The detailed description of the resource. 3.6.0
vmInstanceUuid String The VM instance UUID. 3.6.0
createDate Timestamp The creation date. 3.6.0
lastOpDate Timestamp The last operation date. 3.6.0
volumeSnapshotRefs List See volumeSnapshotRefs. 3.6.0
#volumeSnapshotRefs
Name Type Description Starting Version
volumeSnapshotUuid String The volume snapshot UUID. 3.6.0
volumeSnapshotGroupUuid String The snapshot group UUID. 3.6.0
deviceId int The device ID of the volume when the snapshot is taken. 3.6.0
snapshotDeleted boolean Whether the snapshot is deleted. 3.6.0
volumeUuid String The volume UUID. 3.6.0
volumeName String The volume name. 3.6.0
volumeType String The volume type. 3.6.0
volumeSnapshotInstallPath String The path to install the snapshot. 3.6.0
volumeSnapshotName String The snapshot name. 3.6.0
createDate Timestamp The creation date. 3.6.0
lastOpDate Timestamp The last operation date. 3.6.0

SDK Sample

Java SDK
CreateVolumeSnapshotGroupAction action = new CreateVolumeSnapshotGroupAction();
action.rootVolumeUuid = "901cae4fd9f43a1ca20da4146ddaec50";
action.name = "test";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateVolumeSnapshotGroupAction.Result res = action.call();
Python SDK
CreateVolumeSnapshotGroupAction action = CreateVolumeSnapshotGroupAction()
action.rootVolumeUuid = "901cae4fd9f43a1ca20da4146ddaec50"
action.name = "test"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateVolumeSnapshotGroupAction.Result res = action.call()

DeleteVolumeSnapshotGroup

API Request

URLs
DELETE zstack/v1/volume-snapshots/group/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/volume-snapshots/group/f7b2175eebba3161b029689cb32f9b14
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.6.0
direction String body Optional. The data merge direction. Pull: Merge forward; Commit: Merge backward; Auto: Automatically select the optimal merge direction. 5.4.0
scope String body Optional. The data merge mode. Single: Merge only a single snapshot; Chain: Merge the entire snapshot chain; Auto: Automatically determine the best possible merge scope. 5.4.0
deleteMode String body Optional. The delete mode. 3.6.0
systemTags List body Optional. The system tags. 3.6.0
userTags List body Optional. The user tags. 3.6.0

API Response

Sample Response
{
  "results": [
    {
      "success": false,
      "error": {
        "code": "SYS.1001",
        "description": "internal error"
      }
    }
  ]
}
Name Type Description Starting Version
success boolean 0.6
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.6.0
results List See results. 3.6.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.6.0
description String The brief description of the error. 3.6.0
details String The details about the error. 3.6.0
elaboration String The reserved field. Default value: null. 3.6.0
opaque LinkedHashMap The reserved field. Default value: null. 3.6.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.6.0
#results
Name Type Description Starting Version
snapshotUuid String The snapshot UUID. 3.6.0
volumeUuid String The volume UUID. 3.6.0
success boolean 3.6.0
error ErrorCode See error. 3.6.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.6.0
description String The brief description of the error. 3.6.0
details String The details about the error. 3.6.0
elaboration String The reserved field. Default value: null. 3.6.0
opaque LinkedHashMap The reserved field. Default value: null. 3.6.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.6.0

SDK Sample

Java SDK
DeleteVolumeSnapshotGroupAction action = new DeleteVolumeSnapshotGroupAction();
action.uuid = "f7b2175eebba3161b029689cb32f9b14";
action.direction = "auto";
action.scope = "chain";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteVolumeSnapshotGroupAction.Result res = action.call();
Python SDK
DeleteVolumeSnapshotGroupAction action = DeleteVolumeSnapshotGroupAction()
action.uuid = "f7b2175eebba3161b029689cb32f9b14"
action.direction = "auto"
action.scope = "chain"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteVolumeSnapshotGroupAction.Result res = action.call()

UpdateVolumeSnapshotGroup

API Request

URLs
PUT zstack/v1/volume-snapshots/group/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateVolumeSnapshotGroup": {
    "name": "new name"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateVolumeSnapshotGroup":{"name":"new name"}}' http://localhost:8080/zstack/v1/volume-snapshots/group/c39089cddbd836628f346b14beafe2d3/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
name String body (contained in the updateVolumeSnapshotGroup structure) Optional. The resource name. 3.6.0
description String body (contained in the updateVolumeSnapshotGroup structure) Optional. The detailed description of the resource. 3.6.0
uuid String url The resource UUID. 3.6.0
systemTags List body Optional. The system tags. 3.6.0
userTags List body Optional. The user tags. 3.6.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "a261086918fe3c04be683430f15920a2",
    "snapshotCount": 1.0,
    "name": "group",
    "vmInstanceUuid": "98ac921100b43981b493071b6430bb2b",
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM",
    "volumeSnapshotRefs": [
      {
        "volumeSnapshotUuid": "7ac8675cd8a9389ca343a2a7d49c47d7",
        "volumeSnapshotGroupUuid": "a261086918fe3c04be683430f15920a2",
        "deviceId": 0.0,
        "snapshotDeleted": false,
        "volumeUuid": "6fb0e4a0c3d6315bbb5c08a1a33bc231",
        "volumeName": "ROOT-volume",
        "volumeType": "Root",
        "volumeSnapshotInstallPath": "/Cloud_ps/to/path/snap.qcow2",
        "volumeSnapshotName": "group-ROOT-volume",
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "lastOpDate": "Nov 14, 2017 10:20:57 PM"
      }
    ]
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.6.0
inventory VolumeSnapshotGroupInventory See inventory. 3.6.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.6.0
description String The brief description of the error. 3.6.0
details String The details about the error. 3.6.0
elaboration String The reserved field. Default value: null. 3.6.0
opaque LinkedHashMap The reserved field. Default value: null. 3.6.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.6.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.6.0
snapshotCount Integer The number of snapshots in the snapshot group. 3.6.0
name String The resource name. 3.6.0
description String The detailed description of the resource. 3.6.0
vmInstanceUuid String The VM instance UUID. 3.6.0
createDate Timestamp The creation date. 3.6.0
lastOpDate Timestamp The last operation date. 3.6.0
volumeSnapshotRefs List See volumeSnapshotRefs. 3.6.0
#volumeSnapshotRefs
Name Type Description Starting Version
volumeSnapshotUuid String The volume snapshot UUID. 3.6.0
volumeSnapshotGroupUuid String The snapshot group UUID. 3.6.0
deviceId int The device ID of the volume when the snapshot is taken. 3.6.0
snapshotDeleted boolean Whether the snapshot is deleted. 3.6.0
volumeUuid String The volume UUID. 3.6.0
volumeName String The volume name. 3.6.0
volumeType String The volume type. 3.6.0
volumeSnapshotInstallPath String The path to install the snapshot. 3.6.0
volumeSnapshotName String The snapshot name. 3.6.0
createDate Timestamp The creation date. 3.6.0
lastOpDate Timestamp The last operation date. 3.6.0

SDK Sample

Java SDK
UpdateVolumeSnapshotGroupAction action = new UpdateVolumeSnapshotGroupAction();
action.name = "new name";
action.uuid = "c39089cddbd836628f346b14beafe2d3";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateVolumeSnapshotGroupAction.Result res = action.call();
Python SDK
UpdateVolumeSnapshotGroupAction action = UpdateVolumeSnapshotGroupAction()
action.name = "new name"
action.uuid = "c39089cddbd836628f346b14beafe2d3"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateVolumeSnapshotGroupAction.Result res = action.call()

QueryVolumeSnapshotGroup

API Request

URLs
GET zstack/v1/volume-snapshots/group
GET zstack/v1/volume-snapshots/group/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/volume-snapshots/group?q=uuid=9480c1736b9c3798b3030cd990f0db8f
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/volume-snapshots/group/91c3de9ffbc73475a84b8038c8a2349c

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryVolumeSnapshotGroup, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "uuid": "2c95e5285a733df6a2b70e198282f594",
      "snapshotCount": 1.0,
      "name": "group",
      "vmInstanceUuid": "371076859fa9326fba89633429f0aa06",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM",
      "volumeSnapshotRefs": [
        {
          "volumeSnapshotUuid": "bb6bc37f1c483ac1b7703b6ba58a2081",
          "volumeSnapshotGroupUuid": "2c95e5285a733df6a2b70e198282f594",
          "deviceId": 0.0,
          "snapshotDeleted": false,
          "volumeUuid": "6ff4fae70b79328bb0233313adb1226b",
          "volumeName": "ROOT-volume",
          "volumeType": "Root",
          "volumeSnapshotInstallPath": "/Cloud_ps/to/path/snap.qcow2",
          "volumeSnapshotName": "group-ROOT-volume",
          "createDate": "Nov 14, 2017 10:20:57 PM",
          "lastOpDate": "Nov 14, 2017 10:20:57 PM"
        }
      ]
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.6.0
inventories List See inventories. 3.6.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.6.0
description String The brief description of the error. 3.6.0
details String The details about the error. 3.6.0
elaboration String The reserved field. Default value: null. 3.6.0
opaque LinkedHashMap The reserved field. Default value: null. 3.6.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.6.0
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 3.6.0
snapshotCount Integer The number of snapshots in the snapshot group. 3.6.0
name String The resource name. 3.6.0
description String The detailed description of the resource. 3.6.0
vmInstanceUuid String The VM instance UUID. 3.6.0
createDate Timestamp The creation date. 3.6.0
lastOpDate Timestamp The last operation date. 3.6.0
volumeSnapshotRefs List See volumeSnapshotRefs. 3.6.0
#volumeSnapshotRefs
Name Type Description Starting Version
volumeSnapshotUuid String The volume snapshot UUID. 3.6.0
volumeSnapshotGroupUuid String The snapshot group UUID. 3.6.0
deviceId int The device ID of the volume when the snapshot is taken. 3.6.0
snapshotDeleted boolean Whether the snapshot is deleted. 3.6.0
volumeUuid String The volume UUID. 3.6.0
volumeName String The volume name. 3.6.0
volumeType String The volume type. 3.6.0
volumeSnapshotInstallPath String The path to install the snapshot. 3.6.0
volumeSnapshotName String The snapshot name. 3.6.0
createDate Timestamp The creation date. 3.6.0
lastOpDate Timestamp The last operation date. 3.6.0

SDK Sample

Java SDK
QueryVolumeSnapshotGroupAction action = new QueryVolumeSnapshotGroupAction();
action.conditions = asList("uuid=102cde8f217430aaaf5652460adb7d7e");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryVolumeSnapshotGroupAction.Result res = action.call();
Python SDK
QueryVolumeSnapshotGroupAction action = QueryVolumeSnapshotGroupAction()
action.conditions = ["uuid=3ad89f9fbe823083b1918f872381a1f5"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryVolumeSnapshotGroupAction.Result res = action.call()

CheckVolumeSnapshotGroupAvailability

API Request

URLs
GET zstack/v1/volume-snapshots/groups/availabilities
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/volume-snapshots/groups/availabilities?uuids=cc389f9eb3223c698f565621d2abcf72
Request Parameters
Name Type Location Description Optional Value Starting Version
uuids List query The snapshot group UUIDs. 3.6.0
systemTags List query Optional. The system tags. 3.6.0
userTags List query Optional. The user tags. 3.6.0

API Response

Sample Response
{
  "results": [
    {
      "uuid": "78dd38e3e58134cead860f270143a474",
      "available": true,
      "reason": ""
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.6.0
results List See results. 3.6.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.6.0
description String The brief description of the error. 3.6.0
details String The details about the error. 3.6.0
elaboration String The reserved field. Default value: null. 3.6.0
opaque LinkedHashMap The reserved field. Default value: null. 3.6.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.6.0
#results
Name Type Description Starting Version
uuid String The resource UUID. 3.6.0
available boolean Whether the volume snapshot group is available. 3.6.0
reason String The reason why the volume snapshot group is unavailable. If the volume snapshot group is available, this parameter is null. 3.6.0

SDK Sample

Java SDK
CheckVolumeSnapshotGroupAvailabilityAction action = new CheckVolumeSnapshotGroupAvailabilityAction();
action.uuids = asList("cc389f9eb3223c698f565621d2abcf72");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CheckVolumeSnapshotGroupAvailabilityAction.Result res = action.call();
Python SDK
CheckVolumeSnapshotGroupAvailabilityAction action = CheckVolumeSnapshotGroupAvailabilityAction()
action.uuids = [cc389f9eb3223c698f565621d2abcf72]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CheckVolumeSnapshotGroupAvailabilityAction.Result res = action.call()

RevertVmFromSnapshotGroup

API Request

URLs
PUT zstack/v1/volume-snapshots/group/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "revertVmFromSnapshotGroup": {},
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"revertVmFromSnapshotGroup":{}}' http://localhost:8080/zstack/v1/volume-snapshots/group/37050441a903313297e65e09ccbeb30f/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The snapshot group UUID. 3.6.0
systemTags List body Optional. The system tags. 3.6.0
userTags List body Optional. The user tags. 3.6.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
"error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
}
}

SDK Sample

Java SDK
RevertVmFromSnapshotGroupAction action = new RevertVmFromSnapshotGroupAction();
action.uuid = "37050441a903313297e65e09ccbeb30f";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RevertVmFromSnapshotGroupAction.Result res = action.call();
Python SDK
RevertVmFromSnapshotGroupAction action = RevertVmFromSnapshotGroupAction()
action.uuid = "37050441a903313297e65e09ccbeb30f"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RevertVmFromSnapshotGroupAction.Result res = action.call()

UndoSnapshotCreation

API Request

URLs
PUT zstack/v1/volumes/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "undoSnapshotCreation": {
    "snapShotUuid": "7677380457d136629f44c93c99978acc"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"undoSnapshotCreation":{"snapShotUuid":"7677380457d136629f44c93c99978acc"}}' http://localhost:8080/zstack/v1/volumes/7fc32ad187c939d8aca65977560c2714/actions
Request Parameters
Name Type Location Description Valid Values Starting Version
uuid String url The resource UUID. 4.8.0
snapShotUuid String body (contained in the undoSnapshotCreation structure) 4.8.0
systemTags List body Optional. The system tags. 4.8.0
userTags List body Optional. The user tags. 4.8.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "7c3af161f36e3c2ca8661e8f825a9a4d",
    "name": "test-volume",
    "primaryStorageUuid": "c5b8c1bc2db337ac83b5a867046e145d",
    "vmInstanceUuid": "d6d25288e0973da58921dc13cb58c653",
    "diskOfferingUuid": "5547f17f3df234278ce7f44bb8fdf131",
    "rootImageUuid": "a976ad9fc6493bd88ea7ef05e9028dc1",
    "installPath": "/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-7c3af161f36e3c2ca8661e8f825a9a4d/7c3af161f36e3c2ca8661e8f825a9a4d.qcow2",
    "type": "Root",
    "format": "qcow2",
    "size": 107374182400,
    "actualSize": 21474836480,
    "deviceId": 0,
    "state": "Enabled",
    "status": "Ready",
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM"
  }
}
Name Type Description Starting Version
success boolean 4.8.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.8.0
inventory VolumeInventory See inventory. 4.8.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.8.0
description String The brief description of the error. 4.8.0
details String The details about the error. 4.8.0
elaboration String The reserved field. Default value: null. 4.8.0
opaque LinkedHashMap The reserved field. Default value: null. 4.8.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.8.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 4.8.0
name String The resource name. 4.8.0
description String The resource description. 4.8.0
primaryStorageUuid String The primary storage UUID. 4.8.0
vmInstanceUuid String The VM instance UUID. 4.8.0
diskOfferingUuid String The disk offering UUID. 4.8.0
rootImageUuid String 4.8.0
installPath String 4.8.0
type String 4.8.0
format String 4.8.0
size Long 4.8.0
actualSize Long 4.8.0
deviceId Integer 4.8.0
state String 4.8.0
status String 4.8.0
createDate Timestamp The creation date. 4.8.0
lastOpDate Timestamp The last operation date. 4.8.0
isShareable Boolean 4.8.0
volumeQos String 4.8.0
lastDetachDate Timestamp 4.8.0
lastVmInstanceUuid String 4.8.0

SDK Sample

Java SDK
UndoSnapshotCreationAction action = new UndoSnapshotCreationAction();
action.uuid = "7fc32ad187c939d8aca65977560c2714";
action.snapShotUuid = "7677380457d136629f44c93c99978acc";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UndoSnapshotCreationAction.Result res = action.call();
Python SDK
UndoSnapshotCreationAction action = UndoSnapshotCreationAction()
action.uuid = "7fc32ad187c939d8aca65977560c2714"
action.snapShotUuid = "7677380457d136629f44c93c99978acc"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UndoSnapshotCreationAction.Result res = action.call()

UngroupVolumeSnapshotGroup

API Request

URLs
DELETE zstack/v1/volume-snapshots/ungroup/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/volume-snapshots/ungroup/8903cef5a11c3457881bfd7bd5f04757
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The snapshot group UUID. 3.6.0
systemTags List body Optional. The system tags. 3.6.0
userTags List body Optional. The user tags. 3.6.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
"error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
}
}

SDK Sample

Java SDK
UngroupVolumeSnapshotGroupAction action = new UngroupVolumeSnapshotGroupAction();
action.uuid = "8903cef5a11c3457881bfd7bd5f04757";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UngroupVolumeSnapshotGroupAction.Result res = action.call();
Python SDK
UngroupVolumeSnapshotGroupAction action = UngroupVolumeSnapshotGroupAction()
action.uuid = "8903cef5a11c3457881bfd7bd5f04757"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UngroupVolumeSnapshotGroupAction.Result res = action.call()

GetMemorySnapshotGroupReference

API Request

URLs
GET zstack/v1/memory-snapshots/group/reference
Headers
Authorization: OAuth the-session-uuid
Curl Samples
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/memory-snapshots/group/reference?resourceUuid=293e9dd057c831608cf59cd377ba0d03&resourceType=L3NetworkVO
Request Parameters
Name Type Location Description Valid Value Starting Version
resourceUuid String query The resource UUID. 4.4.24
resourceType String query The resource type. 4.4.24
systemTags List query Optional. The system tags. 4.4.24
userTags List query Optional. The user tags. 4.4.24

API Response

{
  "inventories": [
    {
      "uuid": "22f6a9534922339f95c15db177ac2c75",
      "snapshotCount": 1.0,
      "name": "group",
      "vmInstanceUuid": "e5c0251850be3ffe85db33e7ecf12b75",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM",
      "volumeSnapshotRefs": [
        {
          "volumeSnapshotUuid": "bfb9af2450753ac292c46c3afcadd7a6",
          "volumeSnapshotGroupUuid": "22f6a9534922339f95c15db177ac2c75",
          "deviceId": 0.0,
          "snapshotDeleted": false,
          "volumeUuid": "976ab88982753cc8951efd915b76573f",
          "volumeName": "ROOT-volume",
          "volumeType": "Root",
          "volumeSnapshotInstallPath": "/zstack_ps/to/path/snap.qcow2",
          "volumeSnapshotName": "group-ROOT-volume",
          "createDate": "Nov 14, 2017 10:20:57 PM",
          "lastOpDate": "Nov 14, 2017 10:20:57 PM"
        }
      ]
    }
  ],
  "resourceUuid": "c8a0949c175c380db27cc5c78e8d01f7"
}
Name Type Description Starting Version
resourceUuid String The resource UUID. 4.4.24
success boolean 4.4.24
inventories List See inventories 4.4.24
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error 4.4.24
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 4.4.24
snapshotCount Integer The number of snapshots in the group. 4.4.24
name String The resource name. 4.4.24
description String Optional. The detailed description of the resource. 4.4.24
vmInstanceUuid String The VM UUID. 4.4.24
createDate Timestamp The creation date. 4.4.24
lastOpDate Timestamp The last operation date. 4.4.24
volumeSnapshotRefs List See volumeSnapshotRefs 4.4.24
#volumeSnapshotRefs
Name Type Description Starting Version
volumeSnapshotUuid String The volume snapshot UUID. 4.4.24
volumeSnapshotGroupUuid String The snapshot group UUID. 4.4.24
deviceId int The device ID of the volume when the snapshot is taken. 4.4.24
snapshotDeleted boolean Whether the snapshot is deleted. 4.4.24
volumeUuid String The volume UUID. 4.4.24
volumeName String The volume name. 4.4.24
volumeType String The volume type. 4.4.24
volumeSnapshotInstallPath String The path to install the snapshot. 4.4.24
volumeSnapshotName String The snapshot name. 4.4.24
createDate Timestamp The creation date. 4.4.24
lastOpDate Timestamp The last operation date. 4.4.24
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.4.24
description String The brief description of the error. 4.4.24
details String The details about the error. 4.4.24
elaboration String The reserved field. Default value: null. 4.4.24
opaque LinkedHashMap The reserved field. Default value: null. 4.4.24
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.4.24

SDK Sample

Java SDK
GetMemorySnapshotGroupReferenceAction action = new GetMemorySnapshotGroupReferenceAction();
action.resourceUuid = "293e9dd057c831608cf59cd377ba0d03";
action.resourceType = "L3NetworkVO";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetMemorySnapshotGroupReferenceAction.Result res = action.call();
Python SDK
GetMemorySnapshotGroupReferenceAction action = GetMemorySnapshotGroupReferenceAction()
action.resourceUuid = "293e9dd057c831608cf59cd377ba0d03"
action.resourceType = "L3NetworkVO"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetMemorySnapshotGroupReferenceAction.Result res = action.call()
API Reference | 5.5.30 | ZStack Cloud · ZCF | ZStack Resource Center