Query Shared Block

GET/zstack/v1/sharedblock-group/sharedblocks
GET/zstack/v1/sharedblock-group/
GET/zstack/v1/sharedblock-group/sharedblock/{uuid}

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sharedblock-group/sharedblocks
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sharedblock-group/
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sharedblock-group/sharedblock/e6076fa169ed38ba8f66e73c2db7158d

Queryable Fields

Run the CLI command, enter QuerySharedBlock and press Tab to view all queryable fields and resources that support cross-table queries.

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "3787d759b8323d2e8f0b19ef0bfe930b",
      "sharedBlockGroupUuid": "0dcfcb85f7613689886ae34114064cbd",
      "type": "LvmLogicalVolumeBasic",
      "name": "test shared block",
      "description": "description",
      "state": "Enabled",
      "status": "Connected",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error2.3.2
inventoriesListFor details, see inventories2.3.2

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier for the error, e.g. SYS.1000, HOST.10012.3.2
descriptionStringBrief description of the error2.3.2
detailsStringDetailed error information2.3.2
elaborationStringReserved field, defaults to null2.3.2
opaqueLinkedHashMapReserved field, defaults to null2.3.2
causeErrorCodeRoot cause: the source error that caused the current error. If there is no original error, this field is null2.3.2

inventories

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource2.3.2
sharedBlockGroupUuidStringShared block device group UUID2.3.2
diskUuidStringDisk unique identifier (e.g. UUID, WWN, WWID)2.3.2
nameStringResource name2.3.2
descriptionStringDetailed description of the resource2.3.2
createDateTimestampCreate date2.3.2
lastOpDateTimestampLast update date2.3.2
typeSharedBlockTypeFor details, see type2.3.2
stateSharedBlockStateFor details, see state2.3.2
statusSharedBlockStatusFor details, see status2.3.2

type

NameTypeDescriptionStarting Version
nameStringResource name2.3.2
ordinalint 2.3.2

state

NameTypeDescriptionStarting Version
nameStringResource name2.3.2
ordinalint 2.3.2

status

NameTypeDescriptionStarting Version
nameStringResource name2.3.2
ordinalint 2.3.2

SDK Examples

Java SDK

QuerySharedBlockAction action = new QuerySharedBlockAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySharedBlockAction.Result res = action.call();

Python SDK

QuerySharedBlockAction action = QuerySharedBlockAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySharedBlockAction.Result res = action.call()