Get Host Local Storage Capacity

API Request

URLs

GET zstack/v1/primary-storage/local-storage/{primaryStorageUuid}/capacities

Headers

Authorization: OAuth the-session-uuid

Curl Examples

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth c5115e16f4a44fb6a66bba611f888eb3" \
-X GET http://localhost:8080/zstack/v1/primary-storage/local-storage/b839f809d5954d47aecf0b0d56fb98fa/capacities?hostUuid=b3a59363895143cf847518a0badd3ea3

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
hostUuid (optional)StringqueryHost UUID 0.6
primaryStorageUuidStringurlData Storage UUID 0.6
systemTags (optional)ListquerySystem tags 0.6
userTags (optional)ListqueryUser tags 0.6

API Response

Response Example

{
  "inventories": [
    {
      "hostUuid": "02b36a53204d496290c4f2f8b31a7575",
      "totalCapacity": 1073741824.0,
      "availableCapacity": 973078528.0,
      "totalPhysicalCapacity": 1073741824.0,
      "availablePhysicalCapacity": 973078528.0
    }
  ]
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, indicates the operation failed. This field is null when the operation succeeds. For details, see error0.6
inventoriesListFor details, see inventories0.6

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

inventories

NameTypeDescriptionStarting Version
hostUuidStringHost UUID0.6
totalCapacitylong 0.6
availableCapacitylong 0.6
totalPhysicalCapacitylong 0.6
availablePhysicalCapacitylong 0.6

SDK Examples

Java SDK

GetLocalStorageHostDiskCapacityAction action = new GetLocalStorageHostDiskCapacityAction();
action.hostUuid = "e63ea47c5aa14106a6abd89ddc8f43de";
action.primaryStorageUuid = "a193ec73e0824726bc30fa88f7f906cc";
action.sessionId = "0d48347e758c4089a85b586f6d2c0953";
GetLocalStorageHostDiskCapacityAction.Result res = action.call();

Python SDK

GetLocalStorageHostDiskCapacityAction action = GetLocalStorageHostDiskCapacityAction()
action.hostUuid = "fbaace8b570a4be6998dc376b95dcdf1"
action.primaryStorageUuid = "71d63b28517243538d83c326bc21423a"
action.sessionId = "cc34ee291d8a4d7bad091c4a66d97094"
GetLocalStorageHostDiskCapacityAction.Result res = action.call()