GetPrimaryStorageCapacity
API Request
URLs
GET zstack/v1/primary-storage/capacities
Headers
Authorization: OAuth the-session-uuid
Curl
Sample
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
Request Parameters
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
zoneUuids | List | query | Optional. The zone UUID list. | 0.6 | |
clusterUuids | List | query | Optional. The cluster UUID list. | 0.6 | |
primaryStorageUuids | List | query | Optional. The primary storage UUID list. | 0.6 | |
all | boolean | query | Optional. When the primary storage UUID list is null, the field is true, which means that all primary storages in the system will be queried. | 0.6 | |
systemTags | List | query | Optional. The system tags. | 0.6 | |
userTags | List | query | Optional. The user tags. | 0.6 |
API Response
Sample
Response
{
"totalCapacity": 1.073741824E9,
"availableCapacity": 9.73078528E8,
"totalPhysicalCapacity": 1.073741824E9,
"availablePhysicalCapacity": 9.73078528E8
}
Name | Type | Description | Starting Version |
---|---|---|---|
totalCapacity | long | 0.6 | |
availableCapacity | long | 0.6 | |
totalPhysicalCapacity | long | 0.6 | |
availablePhysicalCapacity | long | 0.6 | |
success | boolean | 0.6 | |
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
#error
Name | Type | Description | Starting Version |
---|---|---|---|
code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
description | String | The brief description of the error. | 0.6 |
details | String | The details about the error. | 0.6 |
elaboration | String | The reserved field. Default value: null. | 0.6 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
SDK Sample
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()