获取数据存储容量

GET/zstack/v1/primary-storage/capacities

Headers

Authorization: OAuth the-session-uuid

Curl示例

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

参数列表

名字类型位置描述可选值起始版本
zoneUuids (可选)Listquery数据中心UUID列表 0.6
clusterUuids (可选)Listquery集群UUID列表 0.6
primaryStorageUuids (可选)Listquery数据存储UUID列表 0.6
all (可选)booleanquery当数据存储UUID列表为空时,该项为真表示查询系统中所有的数据存储。 0.6
systemTags (可选)Listquery系统标签 0.6
userTags (可选)Listquery用户标签 0.6

API返回

返回示例

{
  "totalCapacity": 1073741824.0,
  "availableCapacity": 973078528.0,
  "totalPhysicalCapacity": 1073741824.0,
  "availablePhysicalCapacity": 973078528.0
}
名字类型描述起始版本
totalCapacitylong 0.6
availableCapacitylong 0.6
totalPhysicalCapacitylong 0.6
availablePhysicalCapacitylong 0.6
successboolean 0.6
errorErrorCode错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error0.6

error

名字类型描述起始版本
codeString错误码号,错误的全局唯一标识,例如SYS.1000, HOST.10010.6
descriptionString错误的概要描述0.6
detailsString错误的详细信息0.6
elaborationString保留字段,默认为null0.6
opaqueLinkedHashMap保留字段,默认为null0.6
causeErrorCode根错误,引发当前错误的源错误,若无原错误,该字段为null0.6

SDK示例

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()