QuerySharedBlock

API Request

URLs
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 Sample
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

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

API Response

Sample Response
{
  "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"
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 2.3.2
inventories List See inventories. 2.3.2
#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. 2.3.2
description String The brief description of the error. 2.3.2
details String The details about the error. 2.3.2
elaboration String The reserved field. Default value: null. 2.3.2
opaque LinkedHashMap The reserved field. Default value: null. 2.3.2
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 2.3.2
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 2.3.2
sharedBlockGroupUuid String The LUN group UUID. 2.3.2
diskUuid String The unique identifier of the disk. For example, UUID, WWN, and WWID. 2.3.2
name String The resource name. 2.3.2
description String The detailed description of the resource. 2.3.2
createDate Timestamp The creation date. 2.3.2
lastOpDate Timestamp The last operation date. 2.3.2
type SharedBlockType See type. 2.3.2
state SharedBlockState See state. 2.3.2
status SharedBlockStatus See status. 2.3.2
#type
Name Type Description Starting Version
name String The resource name. 2.3.2
ordinal int 2.3.2
#state
Name Type Description Starting Version
name String The resource name. 2.3.2
ordinal int 2.3.2
#status
Name Type Description Starting Version
name String The resource name. 2.3.2
ordinal int 2.3.2

SDK Sample

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