Get Data Storage Capacity

GET/zstack/v1/primary-storage/capacities

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 68c022afb7f74007980cf23a76fd2fd0" \
-X GET http://localhost:8080/zstack/v1/primary-storage/capacities?primaryStorageUuids=c8fd0638491c4c4ea70762c51d8445b5&all=false

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
zoneUuids (Optional)ListqueryData Center UUID List 0.6
clusterUuids (Optional)ListqueryCluster UUID List 0.6
primaryStorageUuids (Optional)ListqueryData Storage UUID List 0.6
all (Optional)booleanqueryWhen the Data Storage UUID list is empty, setting this to true queries all data storage in the system. 0.6
systemTags (Optional)ListquerySystem Tags 0.6
userTags (Optional)ListqueryUser Tags 0.6

API Response

Response Example

{
  "totalCapacity": 1073741824.0,
  "availableCapacity": 973078528.0,
  "totalPhysicalCapacity": 1073741824.0,
  "availablePhysicalCapacity": 973078528.0
}
NameTypeDescriptionStarting Version
totalCapacitylong 0.6
availableCapacitylong 0.6
totalPhysicalCapacitylong 0.6
availablePhysicalCapacitylong 0.6
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. When the operation succeeds, this field is null. See error0.6

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier for the error, for example 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 caused the current error. If there is no original error, this field is null0.6

SDK Examples

Java SDK

GetPrimaryStorageCapacityAction action = new GetPrimaryStorageCapacityAction();
action.primaryStorageUuids = asList("9e151bee519044c0b19bdfc12d8d24ab");
action.all = false;
action.sessionId = "79627053d567472eaed5de6b16fcdb91";
GetPrimaryStorageCapacityAction.Result res = action.call();

Python SDK

GetPrimaryStorageCapacityAction action = GetPrimaryStorageCapacityAction()
action.primaryStorageUuids = [f78f7e2087ff437da395fb308db84300]
action.all = false
action.sessionId = "112ffe3fbad14be49c896feb9076dc10"
GetPrimaryStorageCapacityAction.Result res = action.call()