Create Block Volume

POST/zstack/v1/block-volumes

Headers

Authorization: OAuth the-session-uuid

Body

{
  "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-volumes

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
nameStringbody (nested in params structure)Resource name 4.7.11
description (optional)Stringbody (nested in params structure)Resource description 4.7.11
sizeLongbody (nested in params structure)Capacity 4.7.11
primaryStorageUuidStringbody (nested in params structure)Primary Storage UUID 4.7.11
accessPathIdIntegerbody (nested in params structure)Access path ID 4.7.11
accessPathIqnStringbody (nested in params structure)Access path IQN 4.7.11
burstTotalBw (optional)Longbody (nested in params structure)Burst bandwidth 4.7.11
burstTotalIops (optional)Longbody (nested in params structure)Burst IOPS 4.7.11
maxTotalBw (optional)Longbody (nested in params structure)Maximum bandwidth 4.7.11
maxTotalIops (optional)Longbody (nested in params structure)Maximum IOPS 4.7.11
resourceUuid (optional)Stringbody (nested in params structure)Resource UUID 4.7.11
tagUuids (optional)Listbody (nested in params structure)Tag UUID list 4.7.11
systemTags (optional)ListbodySystem tags 4.7.11
userTags (optional)ListbodyUser tags 4.7.11

API Response

Response Example

{
  "inventory": {}
}
NameTypeDescriptionStarting Version
successboolean 4.7.11
inventoryBlockVolumeInventoryFor details, see inventory4.7.11
errorErrorCodeError code. If not null, indicates the operation failed. This field is null when the operation succeeds. For details, see error4.7.11

inventory

NameTypeDescriptionStarting Version
iscsiPathString 4.7.11
vendorString 4.7.11
uuidStringResource UUID, uniquely identifies the resource4.7.11
nameStringResource name4.7.11
descriptionStringResource description4.7.11
primaryStorageUuidStringPrimary Storage UUID4.7.11
vmInstanceUuidStringVM instance UUID4.7.11
diskOfferingUuidStringDisk offering UUID4.7.11
rootImageUuidString 4.7.11
installPathString 4.7.11
typeString 4.7.11
formatString 4.7.11
sizeLong 4.7.11
actualSizeLong 4.7.11
deviceIdInteger 4.7.11
stateString 4.7.11
statusString 4.7.11
createDateTimestampCreation time4.7.11
lastOpDateTimestampLast modification time4.7.11
isShareableBoolean 4.7.11
volumeQosString 4.7.11
lastDetachDateTimestamp 4.7.11
lastVmInstanceUuidString 4.7.11

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier for the error, such as SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, defaults to null0.6
opaqueLinkedHashMapReserved field, defaults to null0.6
causeErrorCodeRoot cause. The source error that triggered the current error. If there is no original error, this field is null0.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()