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 | |
| rootDiskSize | Long | query | Optional. The size of the root volume. You
need to specify this parameter only when you set
imageUuid to ISO and do not specify
rootDiskOfferingUuid. |
4.1.2 | |
| dataDiskOfferingUuids | List | query | Optional. The UUID of the disk offering used by the data volume. | 2.1 | |
| dataDiskSizes | List | query | Optional. The size of the data volume. | 4.3.9 | |
| 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 | |
| instanceOfferingUuid | String | query | Optional. The instance offering UUID. | 5.4.0 |
API Response
Sample Response
{
"rootVolumePrimaryStorages": [
{
"uuid": "90087c635c70381baf16eb6dd5f8cfdc",
"name": "example",
"url": "/zstack_ps",
"description": "example",
"totalCapacity": 322122547200,
"availableCapacity": 214748364800,
"totalPhysicalCapacity": 322122547200,
"availablePhysicalCapacity": 214748364800,
"type": "LocalStorage",
"state": "Enabled",
"status": "Connected",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM",
"attachedClusterUuids": [
"f1d9f91b4b8b35f7b4435f86b79793be"
]
}
],
"dataVolumePrimaryStorages": {
"d180546cd56b3677bffd7d338ba2666c": [
{
"uuid": "b5e92f8dbf223a1eac8fd101f63112b6",
"name": "example",
"url": "/opt/zstack/nfsprimarystorage/prim-b5e92f8dbf223a1eac8fd101f63112b6",
"description": "example",
"totalCapacity": 322122547200,
"availableCapacity": 214748364800,
"totalPhysicalCapacity": 322122547200,
"availablePhysicalCapacity": 214748364800,
"type": "NFS",
"state": "Enabled",
"status": "Connected",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM",
"attachedClusterUuids": [
"1d76e995472839f989472c71dbb450c0"
]
}
]
}
}| 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("b6c5bbd29b103127b3eedd9aa79c886d");
action.dataDiskOfferingUuids = asList("0b2b7ff196113ed79dad6bf815a6033e","cfad76f5d345387d9215773fcd5389c5");
action.clusterUuid = "90fac86c000b335396f995bef052fb41";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetCandidatePrimaryStoragesForCreatingVmAction.Result res = action.call();GetCandidatePrimaryStoragesForCreatingVmAction action = GetCandidatePrimaryStoragesForCreatingVmAction()
action.imageUuid = "5f977e1354aa300bb27e0584d52bb09a"
action.l3NetworkUuids = [b6c5bbd29b103127b3eedd9aa79c886d]
action.dataDiskOfferingUuids = [0b2b7ff196113ed79dad6bf815a6033e, cfad76f5d345387d9215773fcd5389c5]
action.clusterUuid = "90fac86c000b335396f995bef052fb41"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetCandidatePrimaryStoragesForCreatingVmAction.Result res = action.call()
