Create Block Volume
Headers
Authorization: OAuth the-session-uuidBody
{
"params": {
"name": "example",
"description": "block volume test"
},
"systemTags": [],
"userTags": []
}In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Examples
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"example","description":"block volume test"}}' \
http://localhost:8080/zstack/v1/block-volumesParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| name | String | body (nested in params structure) | Resource name | 4.7.11 | |
| description (optional) | String | body (nested in params structure) | Resource description | 4.7.11 | |
| size | Long | body (nested in params structure) | Capacity | 4.7.11 | |
| primaryStorageUuid | String | body (nested in params structure) | Primary Storage UUID | 4.7.11 | |
| accessPathId | Integer | body (nested in params structure) | Access path ID | 4.7.11 | |
| accessPathIqn | String | body (nested in params structure) | Access path IQN | 4.7.11 | |
| burstTotalBw (optional) | Long | body (nested in params structure) | Burst bandwidth | 4.7.11 | |
| burstTotalIops (optional) | Long | body (nested in params structure) | Burst IOPS | 4.7.11 | |
| maxTotalBw (optional) | Long | body (nested in params structure) | Maximum bandwidth | 4.7.11 | |
| maxTotalIops (optional) | Long | body (nested in params structure) | Maximum IOPS | 4.7.11 | |
| resourceUuid (optional) | String | body (nested in params structure) | Resource UUID | 4.7.11 | |
| tagUuids (optional) | List | body (nested in params structure) | Tag UUID list | 4.7.11 | |
| systemTags (optional) | List | body | System tags | 4.7.11 | |
| userTags (optional) | List | body | User tags | 4.7.11 |
API Response
Response Example
{
"inventory": {}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 4.7.11 | |
| inventory | BlockVolumeInventory | For details, see inventory | 4.7.11 |
| error | ErrorCode | Error code. If not null, indicates the operation failed. This field is null when the operation succeeds. For details, see error | 4.7.11 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| iscsiPath | String | 4.7.11 | |
| vendor | String | 4.7.11 | |
| uuid | String | Resource UUID, uniquely identifies the resource | 4.7.11 |
| name | String | Resource name | 4.7.11 |
| description | String | Resource description | 4.7.11 |
| primaryStorageUuid | String | Primary Storage UUID | 4.7.11 |
| vmInstanceUuid | String | VM instance UUID | 4.7.11 |
| diskOfferingUuid | String | Disk offering UUID | 4.7.11 |
| rootImageUuid | String | 4.7.11 | |
| installPath | String | 4.7.11 | |
| type | String | 4.7.11 | |
| format | String | 4.7.11 | |
| size | Long | 4.7.11 | |
| actualSize | Long | 4.7.11 | |
| deviceId | Integer | 4.7.11 | |
| state | String | 4.7.11 | |
| status | String | 4.7.11 | |
| createDate | Timestamp | Creation time | 4.7.11 |
| lastOpDate | Timestamp | Last modification time | 4.7.11 |
| isShareable | Boolean | 4.7.11 | |
| volumeQos | String | 4.7.11 | |
| lastDetachDate | Timestamp | 4.7.11 | |
| lastVmInstanceUuid | String | 4.7.11 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier for the error, such as SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field, defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 0.6 |
| cause | ErrorCode | Root cause. The source error that triggered the current error. If there is no original error, this field is null | 0.6 |
SDK Examples
Java SDK
CreateBlockVolumeAction action = new CreateBlockVolumeAction();
action.name = "example";
action.description = "block volume test";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateBlockVolumeAction.Result res = action.call();Python SDK
CreateBlockVolumeAction action = CreateBlockVolumeAction()
action.name = "example"
action.description = "block volume test"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateBlockVolumeAction.Result res = action.call()