Query Connection Status

GET/zstack/v1/sharedblock-group/host-refs
GET/zstack/v1/sharedblock-group/{primaryStorageUuid}/host-refs

Query SAN storage host connection status.

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/host-refs
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sharedblock-group/{primaryStorageUuid}/host-refs

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": [
    {
      "primaryStorageUuid": "a9e96e98cc2c3a3baa23e31503fc93e6",
      "hostUuid": "7c5510f255663a3cbfd53367c0172507",
      "hostId": 100.0,
      "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
primaryStorageUuidStringPrimary storage UUID2.3.2
hostUuidStringHost UUID2.3.2
hostIdIntegerHost ID2.3.2
createDateTimestampCreate date2.3.2
lastOpDateTimestampLast update date2.3.2
statusPrimaryStorageHostStatusFor details, see status2.3.2

status

NameTypeDescriptionStarting Version
nameStringResource name2.3.2
ordinalint 2.3.2

SDK Examples

Java SDK

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

Python SDK

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