Create Snapshot Group

POST/zstack/v1/volume-snapshots/group

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "rootVolumeUuid": "901cae4fd9f43a1ca20da4146ddaec50",
    "name": "test"
  },
  "systemTags": [],
  "userTags": []
}

The systemTags and userTags fields in the above example are optional. They are listed to indicate that the body can contain these two fields.

Curl Example

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

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
rootVolumeUuidStringbody (contained in the params structure)Root disk UUID 3.6.0
nameStringbody (contained in the params structure)Resource name 3.6.0
description (optional)Stringbody (contained in the params structure)Detailed description of the resource 3.6.0
resourceUuid (optional)Stringbody (contained in the params structure)  3.6.0
tagUuids (optional)Listbody (contained in the params structure)Tag UUID list 3.6.0
systemTags (optional)Listbody  3.6.0
userTags (optional)Listbody  3.6.0

API Response

Response Example

{
  "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"
      }
    ]
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error3.6.0
inventoryVolumeSnapshotGroupInventoryFor details, see inventory3.6.0

error

NameTypeDescriptionStarting Version
codeStringError code number. A globally unique identifier for the error, for example, SYS.1000, HOST.10013.6.0
descriptionStringBrief description of the error3.6.0
detailsStringDetailed information about the error3.6.0
elaborationStringReserved field. Default is null3.6.0
opaqueLinkedHashMapReserved field. Default is null3.6.0
causeErrorCodeRoot error. The source error that caused the current error. This field is null if no root error exists3.6.0

inventory

NameTypeDescriptionStarting Version
uuidStringUUID of the resource. Uniquely identifies the resource3.6.0
snapshotCountIntegerNumber of snapshots in the group3.6.0
nameStringResource name3.6.0
descriptionStringDetailed description of the resource3.6.0
vmInstanceUuidStringVirtual Machine UUID3.6.0
createDateTimestampCreation time3.6.0
lastOpDateTimestampLast modification time3.6.0
volumeSnapshotRefsListFor details, see volumeSnapshotRefs3.6.0

volumeSnapshotRefs

NameTypeDescriptionStarting Version
volumeSnapshotUuidStringDisk snapshot UUID3.6.0
volumeSnapshotGroupUuidStringSnapshot group UUID3.6.0
deviceIdintDevice mount order when the snapshot was taken3.6.0
snapshotDeletedbooleanWhether the snapshot has been deleted3.6.0
volumeUuidStringDisk UUID3.6.0
volumeNameStringDisk name3.6.0
volumeTypeStringDisk type3.6.0
volumeSnapshotInstallPathStringSnapshot installation path3.6.0
volumeSnapshotNameStringSnapshot name3.6.0
createDateTimestampCreation time3.6.0
lastOpDateTimestampLast modification time3.6.0

SDK Examples

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()