Snapshot Interfaces
CreateVolumeSnapshotGroup
API Request
URLs
POST zstack/v1/volume-snapshots/groupHeaders
Authorization: OAuth the-session-uuidBody
Note: The systemTags and userTags fields in the above example are optional. They are listed to indicate that the body can contain these two fields.
{
"params": {
"rootVolumeUuid": "901cae4fd9f43a1ca20da4146ddaec50",
"name": "test"
},
"systemTags": [],
"userTags": []
}
Note: 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/groupParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| rootVolumeUuid | String | body (contained in the params structure) | Root disk UUID | 3.6.0 | |
| name | String | body (contained in the params structure) | Resource name | 3.6.0 | |
| description (optional) | String | body (contained in the params structure) | Detailed description of the resource | 3.6.0 | |
| resourceUuid (optional) | String | body (contained in the params structure) | Optional. The resource UUID. | 3.6.0 | |
| tagUuids (optional) | List | body (contained in the params structure) | Tag UUID list | 3.6.0 | |
| systemTags (optional) | List | body | Optional. The system tags. | 3.6.0 | |
| userTags (optional) | List | body | Optional. The user tags. | 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"
}
]
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 3.6.0 |
| inventory | VolumeSnapshotGroupInventory | For details, see inventory | 3.6.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001 | 3.6.0 |
| description | String | Brief description of the error | 3.6.0 |
| details | String | Detailed information about the error | 3.6.0 |
| elaboration | String | Reserved field. Default is null | 3.6.0 |
| opaque | LinkedHashMap | Reserved field. Default is null | 3.6.0 |
| cause | ErrorCode | Root error. The source error that caused the current error. This field is null if no root error exists | 3.6.0 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource. Uniquely identifies the resource | 3.6.0 |
| snapshotCount | Integer | Number of snapshots in the group | 3.6.0 |
| name | String | Resource name | 3.6.0 |
| description | String | Detailed description of the resource | 3.6.0 |
| vmInstanceUuid | String | Virtual Machine UUID | 3.6.0 |
| createDate | Timestamp | Creation time | 3.6.0 |
| lastOpDate | Timestamp | Last modification time | 3.6.0 |
| volumeSnapshotRefs | List | For details, see volumeSnapshotRefs | 3.6.0 |
#volumeSnapshotRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| volumeSnapshotUuid | String | Disk snapshot UUID | 3.6.0 |
| volumeSnapshotGroupUuid | String | Snapshot group UUID | 3.6.0 |
| deviceId | int | Device mount order when the snapshot was taken | 3.6.0 |
| snapshotDeleted | boolean | Whether the snapshot has been deleted | 3.6.0 |
| volumeUuid | String | Disk UUID | 3.6.0 |
| volumeName | String | Disk name | 3.6.0 |
| volumeType | String | Disk type | 3.6.0 |
| volumeSnapshotInstallPath | String | Snapshot installation path | 3.6.0 |
| volumeSnapshotName | String | Snapshot name | 3.6.0 |
| createDate | Timestamp | Creation time | 3.6.0 |
| lastOpDate | Timestamp | Last modification time | 3.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()DeleteVolumeSnapshotGroup
API Request
URLs
DELETE zstack/v1/volume-snapshots/group/{uuid}?deleteMode={deleteMode}Headers
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/volume-snapshots/group/f7b2175eebba3161b029689cb32f9b14?deleteMode=PermissiveParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | UUID of the resource. Uniquely identifies the resource | 3.6.0 | |
| deleteMode (optional) | String | body | Optional. The delete mode. | 3.6.0 | |
| systemTags (optional) | List | body | Optional. The system tags. | 3.6.0 | |
| userTags (optional) | List | body | Optional. The user tags. | 3.6.0 |
API Response
Response Example
{
"results": [
{
"success": false,
"error": {
"code": "SYS.1001",
"description": "internal error"
}
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 3.6.0 |
| results | List | For details, see results | 3.6.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001 | 3.6.0 |
| description | String | Brief description of the error | 3.6.0 |
| details | String | Detailed information about the error | 3.6.0 |
| elaboration | String | Reserved field. Default is null | 3.6.0 |
| opaque | LinkedHashMap | Reserved field. Default is null | 3.6.0 |
| cause | ErrorCode | Root error. The source error that caused the current error. This field is null if no root error exists | 3.6.0 |
#results
| Name | Type | Description | Starting Version |
|---|---|---|---|
| snapshotUuid | String | Snapshot UUID | 3.6.0 |
| volumeUuid | String | Disk UUID | 3.6.0 |
| success | boolean | Whether the operation succeeded. | 3.6.0 |
| error | ErrorCode | For details, see error | 3.6.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001 | 3.6.0 |
| description | String | Brief description of the error | 3.6.0 |
| details | String | Detailed information about the error | 3.6.0 |
| elaboration | String | Reserved field. Default is null | 3.6.0 |
| opaque | LinkedHashMap | Reserved field. Default is null | 3.6.0 |
| cause | ErrorCode | Root error. The source error that caused the current error. This field is null if no root error exists | 3.6.0 |
SDK Examples
Java
SDK
DeleteVolumeSnapshotGroupAction action = new DeleteVolumeSnapshotGroupAction();
action.uuid = "f7b2175eebba3161b029689cb32f9b14";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteVolumeSnapshotGroupAction.Result res = action.call();Python
SDK
DeleteVolumeSnapshotGroupAction action = DeleteVolumeSnapshotGroupAction()
action.uuid = "f7b2175eebba3161b029689cb32f9b14"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteVolumeSnapshotGroupAction.Result res = action.call()UpdateVolumeSnapshotGroup
API Request
URLs
PUT zstack/v1/volume-snapshots/group/{uuid}/actionsHeaders
Authorization: OAuth the-session-uuidBody
Note: The systemTags and userTags fields in the above example are optional. They are listed to indicate that the body can contain these two fields.
{
"updateVolumeSnapshotGroup": {
"name": "new name"
},
"systemTags": [],
"userTags": []
}
Note: 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 PUT -d '{"updateVolumeSnapshotGroup":{"name":"new name"}}' http://localhost:8080/zstack/v1/volume-snapshots/group/c39089cddbd836628f346b14beafe2d3/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| name (Optional) | String | body (Contained in the updateVolumeSnapshotGroup structure) | Resource name | 3.6.0 | |
| description (Optional) | String | body (Contained in the updateVolumeSnapshotGroup structure) | Detailed description of the resource | 3.6.0 | |
| uuid | String | url | The UUID of the resource. Uniquely identifies the resource | 3.6.0 | |
| systemTags (Optional) | List | body | Optional. The system tags. | 3.6.0 | |
| userTags (Optional) | List | body | Optional. The user tags. | 3.6.0 |
API Response
Response Example
{
"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 failed. This field is null when the operation succeeds. For details, see error | 3.6.0 |
| inventory | VolumeSnapshotGroupInventory | For details, see inventory | 3.6.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001 | 3.6.0 |
| description | String | A brief description of the error | 3.6.0 |
| details | String | The detailed error information | 3.6.0 |
| elaboration | String | A reserved field. The default value is null | 3.6.0 |
| opaque | LinkedHashMap | A reserved field. The default value is null | 3.6.0 |
| cause | ErrorCode | The root error. The source error that caused the current error. If no root error exists, this field is null | 3.6.0 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The UUID of the resource. Uniquely identifies the resource | 3.6.0 |
| snapshotCount | Integer | The number of snapshots in the group | 3.6.0 |
| name | String | Resource name | 3.6.0 |
| description | String | Detailed description of the resource | 3.6.0 |
| vmInstanceUuid | String | Virtual Machine UUID | 3.6.0 |
| createDate | Timestamp | Creation time | 3.6.0 |
| lastOpDate | Timestamp | Last modification time | 3.6.0 |
| volumeSnapshotRefs | List | For details, see volumeSnapshotRefs | 3.6.0 |
#volumeSnapshotRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| volumeSnapshotUuid | String | Disk snapshot UUID | 3.6.0 |
| volumeSnapshotGroupUuid | String | Snapshot group UUID | 3.6.0 |
| deviceId | int | The device ID of the disk when the snapshot was taken | 3.6.0 |
| snapshotDeleted | boolean | Whether the snapshot has been deleted | 3.6.0 |
| volumeUuid | String | Disk UUID | 3.6.0 |
| volumeName | String | Disk name | 3.6.0 |
| volumeType | String | Disk type | 3.6.0 |
| volumeSnapshotInstallPath | String | Snapshot install path | 3.6.0 |
| volumeSnapshotName | String | Snapshot name | 3.6.0 |
| createDate | Timestamp | Creation time | 3.6.0 |
| lastOpDate | Timestamp | Last modification time | 3.6.0 |
SDK Examples
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/groupGET zstack/v1/volume-snapshots/group/{uuid}Headers
Authorization: OAuth the-session-uuidCurl Example
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=9480c1736b9c3798b3030cd990f0db8fcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/volume-snapshots/group/91c3de9ffbc73475a84b8038c8a2349cQueryable Fields
Run the CLI command-line tool, enter QueryVolumeSnapshotGroup and press the Tab key to view all queryable fields and the resource names available for cross-table queries.
API Response
Response Example
{
"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 failed. This field is null when the operation succeeds. For details, see error | 3.6.0 |
| inventories | List | For details, see inventories | 3.6.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001 | 3.6.0 |
| description | String | A brief description of the error | 3.6.0 |
| details | String | The detailed error information | 3.6.0 |
| elaboration | String | A reserved field. The default value is null | 3.6.0 |
| opaque | LinkedHashMap | A reserved field. The default value is null | 3.6.0 |
| cause | ErrorCode | The root error. The source error that caused the current error. If no root error exists, this field is null | 3.6.0 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The UUID of the resource. Uniquely identifies the resource | 3.6.0 |
| snapshotCount | Integer | The number of snapshots in the group | 3.6.0 |
| name | String | Resource name | 3.6.0 |
| description | String | Detailed description of the resource | 3.6.0 |
| vmInstanceUuid | String | Virtual Machine UUID | 3.6.0 |
| createDate | Timestamp | Creation time | 3.6.0 |
| lastOpDate | Timestamp | Last modification time | 3.6.0 |
| volumeSnapshotRefs | List | For details, see volumeSnapshotRefs | 3.6.0 |
#volumeSnapshotRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| volumeSnapshotUuid | String | Disk snapshot UUID | 3.6.0 |
| volumeSnapshotGroupUuid | String | Snapshot group UUID | 3.6.0 |
| deviceId | int | The device ID of the disk when the snapshot was taken | 3.6.0 |
| snapshotDeleted | boolean | Whether the snapshot has been deleted | 3.6.0 |
| volumeUuid | String | Disk UUID | 3.6.0 |
| volumeName | String | Disk name | 3.6.0 |
| volumeType | String | Disk type | 3.6.0 |
| volumeSnapshotInstallPath | String | Snapshot install path | 3.6.0 |
| volumeSnapshotName | String | Snapshot name | 3.6.0 |
| createDate | Timestamp | Creation time | 3.6.0 |
| lastOpDate | Timestamp | Last modification time | 3.6.0 |
SDK Examples
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/availabilitiesHeaders
Authorization: OAuth the-session-uuidCurl Example
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=cc389f9eb3223c698f565621d2abcf72Parameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuids | List | query | Snapshot group UUIDs | 3.6.0 | |
| systemTags (Optional) | List | query | Optional. The system tags. | 3.6.0 | |
| userTags (Optional) | List | query | Optional. The user tags. | 3.6.0 |
API Response
Response Example
{
"results": [
{
"uuid": "78dd38e3e58134cead860f270143a474",
"available": true,
"reason": ""
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 3.6.0 |
| results | List | For details, see results | 3.6.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001 | 3.6.0 |
| description | String | A brief description of the error | 3.6.0 |
| details | String | The detailed error information | 3.6.0 |
| elaboration | String | A reserved field. The default value is null | 3.6.0 |
| opaque | LinkedHashMap | A reserved field. The default value is null | 3.6.0 |
| cause | ErrorCode | The root error. The source error that caused the current error. If no root error exists, this field is null | 3.6.0 |
#results
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The UUID of the resource. Uniquely identifies the resource | 3.6.0 |
| available | boolean | Whether the snapshot group can be reverted | 3.6.0 |
| reason | String | The reason why the snapshot group cannot be reverted. Empty if it can be reverted | 3.6.0 |
SDK Examples
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}/actionsHeaders
Authorization: OAuth the-session-uuidBody
Note: The systemTags and userTags fields in the above example are optional. They are listed to indicate that the body can contain these two fields.
{
"revertVmFromSnapshotGroup": {},
"systemTags": [],
"userTags": []
}
Note: 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 PUT -d '{"revertVmFromSnapshotGroup":{}}' http://localhost:8080/zstack/v1/volume-snapshots/group/37050441a903313297e65e09ccbeb30f/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | UUID of the snapshot group | 3.6.0 | |
| systemTags (Optional) | List | body | Optional. The system tags. | 3.6.0 | |
| userTags (Optional) | List | body | Optional. The user tags. | 3.6.0 |
API Response
On success, this API returns an empty JSON structure
{}. On failure, the returned JSON structure contains 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 Examples
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()UngroupVolumeSnapshotGroup
API Request
URLs
DELETE zstack/v1/volume-snapshots/ungroup/{uuid}Headers
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/volume-snapshots/ungroup/8903cef5a11c3457881bfd7bd5f04757Parameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | UUID of the snapshot group | 3.6.0 | |
| systemTags (Optional) | List | body | Optional. The system tags. | 3.6.0 | |
| userTags (Optional) | List | body | Optional. The user tags. | 3.6.0 |
API Response
On success, this API returns an empty JSON structure
{}. On failure, the returned JSON structure contains 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 Examples
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/referenceHeaders
Authorization: OAuth the-session-uuidCurl Example
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=L3NetworkVOParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| resourceUuid | String | query | Resource UUID | 4.4.24 | |
| resourceType | String | query | Resource type | 4.4.24 | |
| systemTags (Optional) | List | query | System tags | 4.4.24 | |
| userTags (Optional) | List | query | 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 | Resource UUID | 4.4.24 |
| success | boolean | Whether the operation succeeded. | 4.4.24 |
| inventories | List | For details, see inventories | 4.4.24 |
| error | ErrorCode | The error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 4.4.24 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The UUID of the resource. Uniquely identifies the resource | 4.4.24 |
| snapshotCount | Integer | The number of snapshots in the group | 4.4.24 |
| name | String | Resource name | 4.4.24 |
| description | String | Detailed description of the resource | 4.4.24 |
| vmInstanceUuid | String | Virtual Machine UUID | 4.4.24 |
| createDate | Timestamp | Creation time | 4.4.24 |
| lastOpDate | Timestamp | Last modification time | 4.4.24 |
| volumeSnapshotRefs | List | For details, see volumeSnapshotRefs | 4.4.24 |
#volumeSnapshotRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| volumeSnapshotUuid | String | Disk snapshot UUID | 4.4.24 |
| volumeSnapshotGroupUuid | String | Snapshot group UUID | 4.4.24 |
| deviceId | int | The device ID of the disk when the snapshot was taken | 4.4.24 |
| snapshotDeleted | boolean | Whether the snapshot has been deleted | 4.4.24 |
| volumeUuid | String | Disk UUID | 4.4.24 |
| volumeName | String | Disk name | 4.4.24 |
| volumeType | String | Disk type | 4.4.24 |
| volumeSnapshotInstallPath | String | Snapshot install path | 4.4.24 |
| volumeSnapshotName | String | Snapshot name | 4.4.24 |
| createDate | Timestamp | Creation time | 4.4.24 |
| lastOpDate | Timestamp | Last modification time | 4.4.24 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001 | 4.4.24 |
| description | String | A brief description of the error | 4.4.24 |
| details | String | The detailed error information | 4.4.24 |
| elaboration | String | A reserved field. The default value is null | 4.4.24 |
| opaque | LinkedHashMap | A reserved field. The default value is null | 4.4.24 |
| cause | ErrorCode | The root error. The source error that caused the current error. If no root error exists, this field is null | 4.4.24 |
SDK Examples
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()ValidateVolumeSnapshotChain
API Request
URLs
PUT zstack/v1/volumes/{uuid}/actionsHeaders
Authorization: OAuth the-session-uuidBody
Note: The
{
"validateVolumeSnapshotChain": {},
"systemTags": [],
"userTags": []
}
Note: 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 PUT -d '{"validateVolumeSnapshotChain":{}}' \
http://localhost:8080/zstack/v1/volumes/c741336c9efe334490ed027e7130af1e/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The UUID of the resource. Uniquely identifies the resource. Validates the current snapshot chain of this disk | 4.3.0 | |
| systemTags (Optional) | List | body | System tags | 4.3.0 | |
| userTags (Optional) | List | body | User tags | 4.3.0 |
API Response
On success, this API returns an empty JSON structure
{}. On failure, the returned JSON structure contains 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 Examples
Java
SDK
ValidateVolumeSnapshotChainAction action = new ValidateVolumeSnapshotChainAction();
action.uuid = "c741336c9efe334490ed027e7130af1e";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ValidateVolumeSnapshotChainAction.Result res = action.call();Python
SDK
ValidateVolumeSnapshotChainAction action = ValidateVolumeSnapshotChainAction()
action.uuid = "c741336c9efe334490ed027e7130af1e"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ValidateVolumeSnapshotChainAction.Result res = action.call()UndoSnapshotCreation
Undo Snapshot Creation
API Request
URLs
PUT zstack/v1/volumes/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
Note: In the preceding example, the
{
"undoSnapshotCreation": {
"snapShotUuid": "7677380457d136629f44c93c99978acc"
},
"systemTags": [],
"userTags": []
}
Note: In the preceding example, the systemTags and userTags fields can be omitted. They are shown 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 PUT -d '{"undoSnapshotCreation":{"snapShotUuid":"7677380457d136629f44c93c99978acc"}}' http://localhost:8080/zstack/v1/volumes/7fc32ad187c939d8aca65977560c2714/actions
Parameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | Resource UUID, which uniquely identifies the resource | 3.17.0 | |
| snapShotUuid | String | body (included in the undoSnapshotCreation structure) |
The snap shot UUID. | 3.17.0 | |
| systemTags (Optional) | List | body | System tags | 3.17.0 | |
| userTags (Optional) | List | body | User tags | 3.17.0 |
API Response
Response Example
{
"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 2:20:57 PM",
"lastOpDate": "Nov 14, 2017 2:20:57 PM"
}
}
| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the request succeeded | 3.17.0 |
| inventory | VolumeInventory | For details, see inventory | 3.17.0 |
| error | ErrorCode | For details, see error | 3.17.0 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, which uniquely identifies the resource | 3.17.13 |
| name | String | Resource name | 3.17.13 |
| description | String | Detailed resource description | 3.17.13 |
| primaryStorageUuid | String | Data Storage UUID | 3.17.13 |
| vmInstanceUuid | String | Virtual Machine UUID | 3.17.13 |
| diskOfferingUuid | String | Disk Offering UUID | 3.17.13 |
| rootImageUuid | String | The root image UUID. | 3.17.13 |
| installPath | String | The installation path. | 3.17.13 |
| type | String | The resource type. | 3.17.13 |
| format | String | The format. | 3.17.13 |
| size | Long | The size. | 3.17.13 |
| actualSize | Long | The actual size. | 3.17.13 |
| deviceId | Integer | The device ID. | 3.17.13 |
| state | String | The resource state. | 3.17.13 |
| status | String | The resource status. | 3.17.13 |
| createDate | Timestamp | Creation time | 3.17.13 |
| lastOpDate | Timestamp | Last modification time | 3.17.13 |
| isShareable | Boolean | Whether the resource is shareable. | 3.17.13 |
| volumeQos | String | The volume QoS. | 3.17.13 |
| lastDetachDate | Timestamp | The last detach date. | 3.17.13 |
| lastVmInstanceUuid | String | The last VM instance UUID. | 3.17.13 |
| encrypted | Boolean | Whether the resource is encrypted. | 5.1.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code, which globally and uniquely identifies the error, for example, SYS.1000 or HOST.1001 | 0.6 |
| description | String | Summary description of the error | 0.6 |
| details | String | Details of the error | 0.6 |
| elaboration | String | Reserved field. The default value is null | 0.6 |
| opaque | LinkedHashMap | Reserved field. The default value is null | 0.6 |
| cause | ErrorCode | Root error that caused the current error. This field is null if there is no source error | 0.6 |
SDK Examples
Java SDK
UndoSnapshotCreationAction action = new UndoSnapshotCreationAction();
action.uuid = "7fc32ad187c939d8aca65977560c2714";
action.snapShotUuid = "7677380457d136629f44c93c99978acc";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UndoSnapshotCreationAction.Result res = action.call();
Python SDK
action = UndoSnapshotCreationAction()
action.uuid = "7fc32ad187c939d8aca65977560c2714"
action.snapShotUuid = "7677380457d136629f44c93c99978acc"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()
CheckMemorySnapshotGroupConflict
API Request
URLs
GET zstack/v1/memory-snapshots/groups/{uuid}/conflict-detectionHeaders
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/memory-snapshots/groups/ff06c5015505317fae8e020694bad500/conflict-detectionParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | Memory snapshot group UUID | 4.10.16 | |
| systemTags (Optional) | List | query | System tags | 4.10.16 | |
| userTags (Optional) | List | query | User tags | 4.10.16 |
API Response
Response Example
{
"vmNicConflict": [
{
"ip": "127.0.0.1",
"mac": "00:16:3e:00:00:01",
"vmNicName": "vmNicName",
"vmInstanceName": "vmInstanceName",
"vmInstanceUuid": "ff01ec80fd11327cba7519b66119d900"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 4.10.0 |
| vmNicConflict | List | For details, see vmNicConflict | 4.10.0 |
| error | ErrorCode | For details, see error | 4.10.0 |
#vmNicConflict
| Name | Type | Description | Starting Version |
|---|---|---|---|
| ip | String | Conflicting IP | 4.10.16 |
| mac | String | Conflicting MAC | 4.10.16 |
| vmNicName | String | NIC name | 4.10.16 |
| vmInstanceName | String | Virtual Machine name | 4.10.16 |
| vmInstanceUuid | String | Virtual Machine UUID | 4.10.16 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001 | 0.6 |
| description | String | A brief description of the error | 0.6 |
| details | String | The detailed error information | 0.6 |
| elaboration | String | A reserved field. The default value is null | 0.6 |
| opaque | LinkedHashMap | A reserved field. The default value is null | 0.6 |
| cause | ErrorCode | The root error. The source error that caused the current error. If no root error exists, this field is null | 0.6 |
SDK Examples
Java SDK
CheckMemorySnapshotGroupConflictAction action = new CheckMemorySnapshotGroupConflictAction();
action.uuid = "ff06c5015505317fae8e020694bad500";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CheckMemorySnapshotGroupConflictAction.Result res = action.call();Python SDK
action = CheckMemorySnapshotGroupConflictAction()
action.uuid = "ff06c5015505317fae8e020694bad500"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()