ZStack Cloud Platform
Single Server, Free Trial for One Year
POST zstack/v1/volume-snapshots/groupAuthorization: OAuth the-session-uuid{ "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 -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| 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) | 3.6.0 | ||
| tagUuids (optional) | List | body (contained in the params structure) | Tag UUID list | 3.6.0 | |
| systemTags (optional) | List | body | 3.6.0 | ||
| userTags (optional) | List | body | 3.6.0 |
{ "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 |
| 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 |
| 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 |
| 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 |
CreateVolumeSnapshotGroupAction action = new CreateVolumeSnapshotGroupAction(); action.rootVolumeUuid = "901cae4fd9f43a1ca20da4146ddaec50"; action.name = "test"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; CreateVolumeSnapshotGroupAction.Result res = action.call();CreateVolumeSnapshotGroupAction action = CreateVolumeSnapshotGroupAction() action.rootVolumeUuid = "901cae4fd9f43a1ca20da4146ddaec50" action.name = "test" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" CreateVolumeSnapshotGroupAction.Result res = action.call()DELETE zstack/v1/volume-snapshots/group/{uuid}?deleteMode={deleteMode}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X DELETE http://localhost:8080/zstack/v1/volume-snapshots/group/f7b2175eebba3161b029689cb32f9b14?deleteMode=Permissive| 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 | 3.6.0 | ||
| systemTags (optional) | List | body | 3.6.0 | ||
| userTags (optional) | List | body | 3.6.0 |
{ "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 |
| 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 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| snapshotUuid | String | Snapshot UUID | 3.6.0 |
| volumeUuid | String | Disk UUID | 3.6.0 |
| success | boolean | 3.6.0 | |
| error | ErrorCode | For details, see error | 3.6.0 |
| 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 |
DeleteVolumeSnapshotGroupAction action = new DeleteVolumeSnapshotGroupAction(); action.uuid = "f7b2175eebba3161b029689cb32f9b14"; action.deleteMode = "Permissive"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; DeleteVolumeSnapshotGroupAction.Result res = action.call();DeleteVolumeSnapshotGroupAction action = DeleteVolumeSnapshotGroupAction() action.uuid = "f7b2175eebba3161b029689cb32f9b14" action.deleteMode = "Permissive" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" DeleteVolumeSnapshotGroupAction.Result res = action.call()PUT zstack/v1/volume-snapshots/group/{uuid}/actionsAuthorization: OAuth the-session-uuid{ "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 -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| 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 | 3.6.0 | ||
| userTags (Optional) | List | body | 3.6.0 |
{ "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 |
| 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 |
| 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 |
| 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 |
UpdateVolumeSnapshotGroupAction action = new UpdateVolumeSnapshotGroupAction(); action.name = "new name"; action.uuid = "c39089cddbd836628f346b14beafe2d3"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; UpdateVolumeSnapshotGroupAction.Result res = action.call();UpdateVolumeSnapshotGroupAction action = UpdateVolumeSnapshotGroupAction() action.name = "new name" action.uuid = "c39089cddbd836628f346b14beafe2d3" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" UpdateVolumeSnapshotGroupAction.Result res = action.call()