QueryPrimaryStorage

API Request

URLs
GET zstack/v1/primary-storage
Headers
Authorization: OAuth the-session-uuid

Curl Sample

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

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryPrimaryStorage, and pressing the Tab key.

API Response

Sample Response
{
"inventories": [
    {
"name": "PS1",
"url": "/zstack_ps",
"type": "LocalStorage",
"state": "Enabled",
"status": "Connected",
"attachedClusterUuids": [
"efbdb96e4f9c457eacf11dcb19923af9"
      ]
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventories List See inventories. 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 detailed description of the resource. 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
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 0.6
zoneUuid String The zone UUID. 0.6
name String The resource name. 0.6
url String 0.6
description String The detailed description of the resource. 0.6
totalCapacity Long 0.6
availableCapacity Long 0.6
totalPhysicalCapacity Long 0.6
availablePhysicalCapacity Long 0.6
systemUsedCapacity Long 0.6
type String 0.6
state String 0.6
status String 0.6
mountPath String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedClusterUuids List 0.6

SDK Sample

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