PrimaryStorageMigrateVolume
API Request
URLs
PUT zstack/v1/primary-storage/volumes/{volumeUuid}/actionsHeaders
Authorization: OAuth the-session-uuidBody
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"primaryStorageMigrateVolume": {
"dstPrimaryStorageUuid": "aafceb95938e42a6be5475f19a92eec9"
},
"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 '{"primaryStorageMigrateVolume":{"dstPrimaryStorageUuid":"ed4370b338da37d8a537bfb738e736f2"}}' \
http://localhost:8080/zstack/v1/primary-storage/volumes/b6e9b22601f7319fadd329d065b0cd1b/actionsRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| volumeUuid | String | url | The volume UUID. | 2.2 | |
| dstPrimaryStorageUuid | String | body (contained in the primaryStorageMigrateVolume structure) | The UUID of the destination primary storage. | 2.2 | |
| systemTags | List | body | Optional. The system tags. | 2.2 | |
| userTags | List | body | Optional. The user tags. | 2.2 |
API Response
Sample
Response
{
"inventory": {
"uuid": "5fa2d1c7adcd4963b1f9016075764fcb",
"name": "test-volume",
"primaryStorageUuid": "6ebc0be6faaa41f28874daa6076322bd",
"vmInstanceUuid": "2c528326ddcf43dd9bdd1d80da7a15ef",
"diskOfferingUuid": "2af3082d23444be9833c32c53ea2b1ed",
"rootImageUuid": "254bdaf01a33407082d8afe540b76796",
"installPath": "/Cloud_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-5fa2d1c7adcd4963b1f9016075764fcb/5fa2d1c7adcd4963b1f9016075764fcb.qcow2",
"type": "Root",
"format": "qcow2",
"size": 1.073741824E11,
"actualSize": 2.147483648E10,
"deviceId": 0.0,
"state": "Enabled",
"status": "Ready",
"createDate": "Oct 26, 2017 3:38:58 PM",
"lastOpDate": "Oct 26, 2017 3:38:58 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. | 2.2 |
| inventory | VolumeInventory | See inventory. | 2.2 |
#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. | 2.2 |
| description | String | The detailed description of the error. | 2.2 |
| details | String | The details about the error. | 2.2 |
| elaboration | String | The reserved field. Default value: null. | 2.2 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 2.2 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 2.2 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 2.2 |
| name | String | The resource name. | 2.2 |
| description | String | The detailed description of the resource. | 2.2 |
| primaryStorageUuid | String | The primary storage UUID. | 2.2 |
| vmInstanceUuid | String | The VM instance UUID. | 2.2 |
| diskOfferingUuid | String | The disk offering UUID. | 2.2 |
| rootImageUuid | String | 2.2 | |
| installPath | String | 2.2 | |
| type | String | 2.2 | |
| format | String | 2.2 | |
| size | Long | 2.2 | |
| actualSize | Long | 2.2 | |
| deviceId | Integer | 2.2 | |
| state | String | 2.2 | |
| status | String | 2.2 | |
| createDate | Timestamp | The creation date. | 2.2 |
| lastOpDate | Timestamp | The last operation date. | 2.2 |
| isShareable | Boolean | 2.2 |
SDK Sample
Java
SDK
PrimaryStorageMigrateVolumeAction action = new PrimaryStorageMigrateVolumeAction();
action.volumeUuid = "af5d94f0f24c45f79280fc4661919b2c";
action.dstPrimaryStorageUuid = "e8d756d48e5d48a69f5bec6221ddbc79";
action.sessionId = "c186caf64d0043158b2c5ea9784697ab";
PrimaryStorageMigrateVolumeAction.Result res = action.call();Python
SDK
PrimaryStorageMigrateVolumeAction action = PrimaryStorageMigrateVolumeAction()
action.volumeUuid = "7e170d744c014517b3b38f20111f400d"
action.dstPrimaryStorageUuid = "8c2cc857b81d4d75b404809e57e02deb"
action.sessionId = "ec12693efdf14d72b2a59de9c039870a"
PrimaryStorageMigrateVolumeAction.Result res = action.call()