GetCandidatePrimaryStoragesForCreatingVm
API Request
URLs
GET zstack/v1/vm-instances/candidate-storagesHeaders
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm-instances/candidate-storages?imageUuid=5f977e1354aa300bb27e0584d52bb09a&l3NetworkUuids=0276c5ffc04731d6b671c972272bd10a&dataDiskOfferingUuids=0b2b7ff196113ed79dad6bf815a6033e&dataDiskOfferingUuids=cfad76f5d345387d9215773fcd5389c5&clusterUuid=90fac86c000b335396f995bef052fb41Request Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| imageUuid | String | query | The image UUID. | 2.1 | |
| l3NetworkUuids | List | query | The L3 network UUID. | 2.1 | |
| rootDiskOfferingUuid | String | query | Optional. The UUID of the disk offering used by the root volume. This parameter is required if the image type is ISO. | 2.1 | |
| dataDiskOfferingUuids | List | query | Optional. The UUID of the disk offering used by the data volume. | 2.1 | |
| zoneUuid | String | query | Optional. The zone UUID. | 2.1 | |
| clusterUuid | String | query | Optional. The cluster UUID. | 2.1 | |
| defaultL3NetworkUuid | String | query | Optional. The UUID of the default L3 network. | 2.1 | |
| systemTags | List | query | Optional. The system tags. | 2.1 | |
| userTags | List | query | Optional. The user tags. | 2.1 |
API Response
Sample
Response
{
"rootVolumePrimaryStorages": [
{
"uuid": "971ff3d5e8864cf691a8251022f400e2",
"name": "example",
"url": "/Cloud_ps",
"description": "example",
"totalCapacity": 3.221225472E11,
"availableCapacity": 2.147483648E11,
"totalPhysicalCapacity": 3.221225472E11,
"availablePhysicalCapacity": 2.147483648E11,
"type": "LocalStorage",
"state": "Enabled",
"status": "Connected",
"createDate": "Nov 9, 2017 9:38:50 PM",
"lastOpDate": "Nov 9, 2017 9:38:50 PM",
"attachedClusterUuids": [
"1332f8ffa99844c6ae7286ca15bb6846"
]
}
],
"dataVolumePrimaryStorages": {
"c1e5bafa00ce49368600670b9d724e7b": [
{
"uuid": "f9e90cd9878a4184b3951196e054b978",
"name": "example",
"url": "/opt/zstack/nfsprimarystorage/prim-f9e90cd9878a4184b3951196e054b978",
"description": "example",
"totalCapacity": 3.221225472E11,
"availableCapacity": 2.147483648E11,
"totalPhysicalCapacity": 3.221225472E11,
"availablePhysicalCapacity": 2.147483648E11,
"type": "NFS",
"state": "Enabled",
"status": "Connected",
"createDate": "Nov 9, 2017 9:38:50 PM",
"lastOpDate": "Nov 9, 2017 9:38:50 PM",
"attachedClusterUuids": [
"b73387b8d0264553829b72b86e5c57f5"
]
}
]
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| dataVolumePrimaryStorages | Map | The primary storages that are available to the data volume. Each primary storage corresponds to a data disk offering. | 2.1 |
| success | boolean | Whether the operation succeeds. | 2.1 |
| rootVolumePrimaryStorages | List | See rootVolumePrimaryStorages. | 2.1 |
| error | ErrorCode | See error. | 2.1 |
#rootVolumePrimaryStorages
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 2.1 |
| zoneUuid | String | The zone UUID. | 2.1 |
| name | String | The resource name. | 2.1 |
| url | String | 2.1 | |
| description | String | The detailed description of the resource. | 2.1 |
| totalCapacity | Long | 2.1 | |
| availableCapacity | Long | 2.1 | |
| totalPhysicalCapacity | Long | 2.1 | |
| availablePhysicalCapacity | Long | 2.1 | |
| systemUsedCapacity | Long | 2.1 | |
| type | String | 2.1 | |
| state | String | 2.1 | |
| status | String | 2.1 | |
| mountPath | String | 2.1 | |
| createDate | Timestamp | The creation date. | 2.1 |
| lastOpDate | Timestamp | The last operation date. | 2.1 |
| attachedClusterUuids | List | 2.1 |
#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.1 |
| description | String | The brief description of the error. | 2.1 |
| details | String | The details about the error. | 2.1 |
| elaboration | String | The reserved field. Default value: null. | 2.1 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 2.1 |
| 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.1 |
SDK Sample
Java
SDK
GetCandidatePrimaryStoragesForCreatingVmAction action = new GetCandidatePrimaryStoragesForCreatingVmAction();
action.imageUuid = "5f977e1354aa300bb27e0584d52bb09a";
action.l3NetworkUuids = asList("0276c5ffc04731d6b671c972272bd10a");
action.dataDiskOfferingUuids = asList("0b2b7ff196113ed79dad6bf815a6033e","cfad76f5d345387d9215773fcd5389c5");
action.clusterUuid = "90fac86c000b335396f995bef052fb41";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetCandidatePrimaryStoragesForCreatingVmAction.Result res = action.call();Python
SDK
GetCandidatePrimaryStoragesForCreatingVmAction action = GetCandidatePrimaryStoragesForCreatingVmAction()
action.imageUuid = "5f977e1354aa300bb27e0584d52bb09a"
action.l3NetworkUuids = [0276c5ffc04731d6b671c972272bd10a]
action.dataDiskOfferingUuids = [0b2b7ff196113ed79dad6bf815a6033e, cfad76f5d345387d9215773fcd5389c5]
action.clusterUuid = "90fac86c000b335396f995bef052fb41"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetCandidatePrimaryStoragesForCreatingVmAction.Result res = action.call()