QuerySharedBlockGroupPrimaryStorageHostRef
API Request
URLs
GET zstack/v1/sharedblock-group/host-refs
GET zstack/v1/sharedblock-group/{primaryStorageUuid}/host-refs
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/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
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": [
{
"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"
}
]
}
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 |
---|---|---|---|
primaryStorageUuid | String | The UUID of the Shared Block primary storage. | 2.3.2 |
hostUuid | String | The host UUID. | 2.3.2 |
hostId | Integer | The host ID. | 2.3.2 |
createDate | Timestamp | The creation date. | 2.3.2 |
lastOpDate | Timestamp | The last operation date. | 2.3.2 |
status | PrimaryStorageHostStatus | See status. | 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
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()