GET/zstack/v1/primary-storage/sharedblockgroup GET/zstack/v1/primary-storage/sharedblockgroup/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/primary-storage/sharedblockgroup
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/primary-storage/sharedblockgroup/ab5776cffa893955a533f7e89cdaf025
可查询字段
运行CLI命令行工具,输入QuerySharedBlock并按Tab键查看所有可查询字段以及可跨表查询的资源名。
返回示例
{
"inventories": [
{
"sharedBlocks": [
{
"uuid": "2bf68818dc2c3ffbb9c9f283c8a1f524",
"sharedBlockGroupUuid": "23ef265b88143074b88ad450afe5cbac",
"type": "LvmLogicalVolumeBasic",
"diskUuid": "b4d9459d02533fdeb4dee8b8bf943bed",
"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"
}
],
"sharedBlockGroupType": "LvmVolumeGroupBasic",
"uuid": "23ef265b88143074b88ad450afe5cbac",
"name": "shared block group primary storage",
"description": "shared block group primary storage description",
"availableCapacity": 1073741824.0,
"availablePhysicalCapacity": 1073741824.0,
"type": "SharedBlock",
"state": "Enabled",
"status": "Connected",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}
| 名字 | 类型 | 描述 | 起始版本 |
|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 2.3.2 |
| inventories | List | 详情参考inventories | 2.3.2 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 2.3.2 |
| description | String | 错误的概要描述 | 2.3.2 |
| details | String | 错误的详细信息 | 2.3.2 |
| elaboration | String | 保留字段,默认为null | 2.3.2 |
| opaque | LinkedHashMap | 保留字段,默认为null | 2.3.2 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 2.3.2 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 2.3.2 |
| zoneUuid | String | 数据中心UUID | 2.3.2 |
| name | String | 资源名称 | 2.3.2 |
| url | String | 未使用 | 2.3.2 |
| description | String | 资源的详细描述 | 2.3.2 |
| totalCapacity | Long | 总空间 | 2.3.2 |
| availableCapacity | Long | 可用空间 | 2.3.2 |
| totalPhysicalCapacity | Long | 总物理空间 | 2.3.2 |
| availablePhysicalCapacity | Long | 物理可用空间 | 2.3.2 |
| systemUsedCapacity | Long | 系统使用空间 | 2.3.2 |
| type | String | 数据存储类型 | 2.3.2 |
| state | String | 启用状态 | 2.3.2 |
| status | String | 连接状态 | 2.3.2 |
| mountPath | String | 未使用 | 2.3.2 |
| createDate | Timestamp | 创建时间 | 2.3.2 |
| lastOpDate | Timestamp | 最后一次修改时间 | 2.3.2 |
| attachedClusterUuids | List | 挂载的集群 | 2.3.2 |
| sharedBlocks | List | 详情参考sharedBlocks | 2.3.2 |
| sharedBlockGroupType | SharedBlockGroupType | 详情参考sharedBlockGroupType | 2.3.2 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 2.3.2 |
| sharedBlockGroupUuid | String | 共享块设备组UUID | 2.3.2 |
| diskUuid | String | 磁盘唯一标示(例如UUID, WWN, WWID) | 2.3.2 |
| name | String | 资源名称 | 2.3.2 |
| description | String | 资源的详细描述 | 2.3.2 |
| createDate | Timestamp | 创建时间 | 2.3.2 |
| lastOpDate | Timestamp | 最后一次修改时间 | 2.3.2 |
| type | SharedBlockType | 详情参考type | 2.3.2 |
| state | SharedBlockState | 详情参考state | 2.3.2 |
| status | SharedBlockStatus | 详情参考status | 2.3.2 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|
| name | String | 资源名称 | 2.3.2 |
| ordinal | int | | 2.3.2 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|
| name | String | 资源名称 | 2.3.2 |
| ordinal | int | | 2.3.2 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|
| name | String | 资源名称 | 2.3.2 |
| ordinal | int | | 2.3.2 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|
| name | String | 资源名称 | 2.3.2 |
| ordinal | int | | 2.3.2 |
Java SDK
QuerySharedBlockGroupPrimaryStorageAction action = new QuerySharedBlockGroupPrimaryStorageAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySharedBlockGroupPrimaryStorageAction.Result res = action.call();
Python SDK
QuerySharedBlockGroupPrimaryStorageAction action = QuerySharedBlockGroupPrimaryStorageAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySharedBlockGroupPrimaryStorageAction.Result res = action.call()