Query Data Storage

GET/zstack/v1/primary-storage

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth f889c6a0220c4b34b3007f72bd04e839" \
-X GET http://localhost:8080/zstack/v1/primary-storage?q=uuid=2160b1e46b0a422fbc9ce6e4a7de1023

Queryable Fields

Run the CLI command tool, enter QueryPrimaryStorage and press Tab to view all queryable fields and resource names that can be queried across tables.

API Response

Response Example

{
  "inventories": [
    {
      "name": "PS1",
      "url": "/Cloud_ps",
      "type": "LocalStorage",
      "state": "Enabled",
      "status": "Connected",
      "attachedClusterUuids": [
        "efbdb96e4f9c457eacf11dcb19923af9"
      ]
    }
  ]
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. When the operation succeeds, this field is null. See error0.6
inventoriesListSee inventories0.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

inventories

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource0.6
zoneUuidStringData Center UUID0.6
nameStringResource Name0.6
urlString 0.6
descriptionStringResource Description0.6
totalCapacityLong 0.6
availableCapacityLong 0.6
totalPhysicalCapacityLong 0.6
availablePhysicalCapacityLong 0.6
systemUsedCapacityLong 0.6
typeString 0.6
stateString 0.6
statusString 0.6
mountPathString 0.6
createDateTimestampCreate Time0.6
lastOpDateTimestampLast Modification Time0.6
attachedClusterUuidsList 0.6

SDK Examples

Java SDK

QueryPrimaryStorageAction action = new QueryPrimaryStorageAction();
action.conditions = asList("uuid=56235f6bf5c24513bce99d4ec824c63f");
action.sessionId = "16f5568fa9aa48e79b3a3ed579787fd0";
QueryPrimaryStorageAction.Result res = action.call();

Python SDK

QueryPrimaryStorageAction action = QueryPrimaryStorageAction()
action.conditions = ["uuid=52f2459af9ce4c35a0c7de9c98aaebb0"]
action.sessionId = "ade5be353d114f948f976ae43d397815"
QueryPrimaryStorageAction.Result res = action.call()