Document navigation

Shared Block Primary Storage Operations

AddSharedBlockGroupPrimaryStorage

API Request

URLs
POST zstack/v1/primary-storage/sharedblockgroup
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "diskUuids": [
      "1b5682b663b937a59adb9e318cab6b05"
    ],
    "name": "shared-block-group-1",
    "type": "SharedBlock",
    "zoneUuid": "eee8b39ad50b300c8935e554a967691b"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"diskUuids":["1b5682b663b937a59adb9e318cab6b05"],"name":"shared-block-group-1","type":"SharedBlock","zoneUuid":"eee8b39ad50b300c8935e554a967691b"}}' http://localhost:8080/zstack/v1/primary-storage/sharedblockgroup
Request Parameters
Name Type Location Description Optional Value Starting Version
diskUuids List body (contained in the params structure) The unique identifier of the disk. For example, UUID, WWN, and WWID. 2.3.2
name String body (contained in the params structure) The resource name. 2.3.2
description String body (contained in the params structure) Optional. The detailed description of the resource. 2.3.2
type String body (contained in the params structure) Optional. The primary storage type: SharedBlock. 2.3.2
url String body (contained in the params structure) The reserved field. 2.3.2
zoneUuid String body (contained in the params structure) The zone UUID. 2.3.2
resourceUuid String body (contained in the params structure) Optional. The resource UUID. 2.3.2
systemTags List body Optional. The system tags. 2.3.2
userTags List body Optional. The user tags. 2.3.2
Note:
  • When you add a Shared Block primary storage in ZStack Cloud, you can specify the default volume provisioning strategy by adding the primaryStorageVolumeProvisioningStrategy option to SystemTags.
    • Format of the primaryStorageVolumeProvisioningStrategy option: primaryStorageVolumeProvisioningStrategy::ThinProvisioning, primaryStorageVolumeProvisioningStrategy::ThickProvisioning
    • Example: primaryStorageVolumeProvisioningStrategy::ThinProvisioning, primaryStorageVolumeProvisioningStrategy::ThickProvisioning

API Response

Sample Response
{
  "inventory": {
    "name": "PS1",
    "url": "/Cloud_ps",
    "type": "LocalStorage",
    "state": "Enabled",
    "status": "Connected",
    "attachedClusterUuids": [
      "c6e9684e8bb93a9192c946dcd0564b39"
    ]
  }
}
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
inventory PrimaryStorageInventory Seeinventory. 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
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 2.3.2
zoneUuid String The zone UUID. 2.3.2
name String The resource name. 2.3.2
url String 2.3.2
description String The detailed description of the resource. 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 The creation date. 2.3.2
lastOpDate Timestamp The last operation date. 2.3.2
attachedClusterUuids List 2.3.2

SDK Sample

Java SDK
AddSharedBlockGroupPrimaryStorageAction action = new AddSharedBlockGroupPrimaryStorageAction();
action.diskUuids = asList("1b5682b663b937a59adb9e318cab6b05");
action.name = "shared-block-group-1";
action.type = "SharedBlock";
action.zoneUuid = "eee8b39ad50b300c8935e554a967691b";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddSharedBlockGroupPrimaryStorageAction.Result res = action.call();
Python SDK
AddSharedBlockGroupPrimaryStorageAction action = AddSharedBlockGroupPrimaryStorageAction()
action.diskUuids = [1b5682b663b937a59adb9e318cab6b05]
action.name = "shared-block-group-1"
action.type = "SharedBlock"
action.zoneUuid = "eee8b39ad50b300c8935e554a967691b"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddSharedBlockGroupPrimaryStorageAction.Result res = action.call()

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

QuerySharedBlockGroupPrimaryStorage

API Request

URLs
GET zstack/v1/primary-storage/sharedblockgroup
GET zstack/v1/primary-storage/sharedblockgroup/{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/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

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": [
    {
      "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": 1.073741824E9,
      "availablePhysicalCapacity": 1.073741824E9,
      "type": "SharedBlock",
      "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
zoneUuid String The zone UUID. 2.3.2
name String The resource name. 2.3.2
url String The reserved field. 2.3.2
description String The detailed description of the resource. 2.3.2
totalCapacity Long The total capacity. 2.3.2
availableCapacity Long The available capacity. 2.3.2
totalPhysicalCapacity Long The total physical capacity. 2.3.2
availablePhysicalCapacity Long The available physical capacity. 2.3.2
systemUsedCapacity Long The system used capacity. 2.3.2
type String The type of the primary storage. 2.3.2
state String The state. 2.3.2
status String The status. 2.3.2
mountPath String The reserved field. 2.3.2
createDate Timestamp The creation date. 2.3.2
lastOpDate Timestamp The last operation date. 2.3.2
attachedClusterUuids List The attached cluster UUID list. 2.3.2
sharedBlocks List See sharedBlocks. 2.3.2
sharedBlockGroupType SharedBlockGroupType See sharedBlockGroupType. 2.3.2
#sharedBlocks
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
#sharedBlockGroupType
Name Type Description Starting Version
name String The resource name. 2.3.2
ordinal int 2.3.2

SDK Sample

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

AddSharedBlockToSharedBlockGroup

API Request

URLs
POST zstack/v1/primary-storage/sharedblockgroup/{uuid}/sharedblocks
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "diskUuid": "3bc916e4700e36c9ad9575fcf47222ab"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"diskUuid":"3bc916e4700e36c9ad9575fcf47222ab"}}' http://localhost:8080/zstack/v1/primary-storage/sharedblockgroup/506367e0d66d3fdb92eda345ed347c21/sharedblocks
Request Parameters
Name Type Location Description Optional Value Starting Version
diskUuid String body (contained in the params structure) The unique identifier of the disk. For example, UUID, WWN, and WWID. 2.3.2
uuid String url The LUN group UUID. 2.3.2
systemTags List body Optional. The system tags. 2.3.2
userTags List body Optional. The user tags. 2.3.2

API Response

Sample Response
{
  "inventory": {
    "sharedBlocks": [
      {
        "uuid": "5bc4ef2f6f703bfd9aef732be038103d",
        "sharedBlockGroupUuid": "08f3dd28f1c433fe871e3fe760476981",
        "type": "LvmLogicalVolumeBasic",
        "diskUuid": "b9a89d214e3b37eda7a1aa948c59db13",
        "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": "08f3dd28f1c433fe871e3fe760476981",
    "name": "shared block group primary storage",
    "description": "shared block group primary storage description",
    "availableCapacity": 1.073741824E9,
    "availablePhysicalCapacity": 1.073741824E9,
    "type": "SharedBlock",
    "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
inventory SharedBlockGroupPrimaryStorageInventory See inventory 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 short 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
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 2.3.2
zoneUuid String The zone UUID. 2.3.2
name String The resource name. 2.3.2
url String The reserved field. 2.3.2
description String The detailed description of the resource. 2.3.2
totalCapacity Long The total capacity. 2.3.2
availableCapacity Long The available capacity. 2.3.2
totalPhysicalCapacity Long The total physical capacity. 2.3.2
availablePhysicalCapacity Long The available physical capacity. 2.3.2
systemUsedCapacity Long The system used capacity. 2.3.2
type String The type of the primary storage. 2.3.2
state String The state. 2.3.2
status String The status. 2.3.2
mountPath String The reserved field. 2.3.2
createDate Timestamp The creation date. 2.3.2
lastOpDate Timestamp The last operation date. 2.3.2
attachedClusterUuids List The attached cluster UUID list. 2.3.2
sharedBlocks List See sharedBlocks. 2.3.2
sharedBlockGroupType SharedBlockGroupType See sharedBlockGroupType. 2.3.2
#sharedBlocks
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
#sharedBlockGroupType
Name Type Description Starting Version
name String The resource name. 2.3.2
ordinal int 2.3.2

SDK Sample

Java SDK
AddSharedBlockToSharedBlockGroupAction action = new AddSharedBlockToSharedBlockGroupAction();
action.diskUuid = "3bc916e4700e36c9ad9575fcf47222ab";
action.uuid = "506367e0d66d3fdb92eda345ed347c21";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddSharedBlockToSharedBlockGroupAction.Result res = action.call();
Python SDK
AddSharedBlockToSharedBlockGroupAction action = AddSharedBlockToSharedBlockGroupAction()
action.diskUuid = "3bc916e4700e36c9ad9575fcf47222ab"
action.uuid = "506367e0d66d3fdb92eda345ed347c21"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddSharedBlockToSharedBlockGroupAction.Result res = action.call()

GetSharedBlockCandidate

API Request

URLs
GET zstack/v1/primary-storage/sharedblockgroup/sharedblock-candidates
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/primary-storage/sharedblockgroup/sharedblock-candidates?clusterUuid=a8efc4d72a2334dcad7f71bcb4821d6f
Request Parameters
Name Type Location Description Optional Value Starting Version
clusterUuid String query The cluster UUID. 2.6.0
systemTags List query Optional. The system tags. 2.6.0
userTags List query Optional. The user tags. 2.6.0

API Response

Sample Response
{
  "results": [
    {
      "wwid": "ata-Samsung_SSD_850_EVO_M.2_250GB_S33CNX0H600299D",
      "vendor": "DELL",
      "model": "MD32xx",
      "wwn": "0x6b083fe000daf018",
      "serial": "6b083fe000daf018000015505abbe00a",
      "hctl": "",
      "type": "mpath",
      "size": 3.000318820352E13
    },
    {}
  ]
}
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.6.0
results List See results. 2.6.0
#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.6.0
description String The brief description of the error. 2.6.0
details String The details about the error. 2.6.0
elaboration String The reserved field. Default value: null. 2.6.0
opaque LinkedHashMap The reserved field. Default value: null. 2.6.0
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.6.0
#results
Name Type Description Starting Version
wwid String The device WWID. 2.6.0
vendor String The device vendor. 2.6.0
model String The device model. 2.6.0
wwn String The device WWN. 2.6.0
serial String The device serial No. 2.6.0
hctl String The SCSI device HCTL. 2.6.0
type String The device type. 2.6.0
size Long The device size. 2.6.0

SDK Sample

Java SDK
GetSharedBlockCandidateAction action = new GetSharedBlockCandidateAction();
action.clusterUuid = "a8efc4d72a2334dcad7f71bcb4821d6f";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetSharedBlockCandidateAction.Result res = action.call();
Python SDK
GetSharedBlockCandidateAction action = GetSharedBlockCandidateAction()
action.clusterUuid = "a8efc4d72a2334dcad7f71bcb4821d6f"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetSharedBlockCandidateAction.Result res = action.call()

RefreshSharedblockDeviceCapacity

API Request

URLs
POST zstack/v1/primary-storage/sharedblockgroup/{sharedBlockGroupUuid}/sharedblocks/{uuid}
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {},
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{}}' http://localhost:8080/zstack/v1/primary-storage/sharedblockgroup/2974c033608537e68a305b0f29412776/sharedblocks/9bd10e4bcc0939a2b041755a160d7b34
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url Optional. The LUN UUID. If null, all devices that attach to the LUN will be updated. 2.6.0
sharedBlockGroupUuid String url The LUN group UUID. 2.6.0
systemTags List body Optional. The system tags. 2.6.0
userTags List body Optional. The user tags. 2.6.0

API Response

Sample Response

{
  "inventory": {
    "sharedBlocks": [
      {
        "uuid": "fd474b5a711f3bcab14061e1507b0691",
        "sharedBlockGroupUuid": "9f900d7cc336370da2dccdd832a1613d",
        "type": "LvmLogicalVolumeBasic",
        "diskUuid": "b9bec04964ab30a7bf80bdbf7ec997d9",
        "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": "9f900d7cc336370da2dccdd832a1613d",
    "name": "shared block group primary storage",
    "description": "shared block group primary storage description",
    "availableCapacity": 1.073741824E9,
    "availablePhysicalCapacity": 1.073741824E9,
    "type": "SharedBlock",
    "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.6.0
inventory SharedBlockGroupPrimaryStorageInventory See inventory. 2.6.0
#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.6.0
description String The brief description of the error. 2.6.0
details String The details about the error. 2.6.0
elaboration String The reserved field. Default value: null. 2.6.0
opaque LinkedHashMap The reserved field. Default value: null. 2.6.0
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.6.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 2.6.0
zoneUuid String The zone UUID. 2.6.0
name String The resource name. 2.6.0
url String The reserved field. 2.6.0
description String The detailed description of the resource. 2.6.0
totalCapacity Long The total capacity. 2.6.0
availableCapacity Long The available capacity. 2.6.0
totalPhysicalCapacity Long The total physical capacity. 2.6.0
availablePhysicalCapacity Long The available physical capacity. 2.6.0
systemUsedCapacity Long The system used capacity. 2.6.0
type String The type of the primary storage. 2.6.0
state String The state. 2.6.0
status String The status. 2.6.0
mountPath String The reserved field. 2.6.0
createDate Timestamp The creation date. 2.6.0
lastOpDate Timestamp The last operation date. 2.6.0
attachedClusterUuids List The attached clusters. 2.6.0
sharedBlocks List See sharedBlocks. 2.6.0
sharedBlockGroupType SharedBlockGroupType See sharedBlockGroupType. 2.6.0
#sharedBlocks
Name Type Description Starting Version
uuid String The resource UUID. 2.6.0
sharedBlockGroupUuid String The LUN group UUID. 2.6.0
diskUuid String The unique identifier of the disk. For example, UUID, WWN, and WWID. 2.6.0
name String The resource name. 2.6.0
description String The detailed description of the resource. 2.6.0
createDate Timestamp The creation date. 2.6.0
lastOpDate Timestamp The last operation date. 2.6.0
type SharedBlockType See type. 2.6.0
state SharedBlockState See state. 2.6.0
status SharedBlockStatus See status. 2.6.0
#type
Name Type Description Starting Version
name String The resource name. 2.6.0
ordinal int 2.6.0
#state
Name Type Description Starting Version
name String The resource name. 2.6.0
ordinal int 2.6.0
#status
Name Type Description Starting Version
name String The resource name. 2.6.0
ordinal int 2.6.0
#sharedBlockGroupType
Name Type Description Starting Version
name String The resource name. 2.6.0
ordinal int 2.6.0

SDK Sample

Java SDK

RefreshSharedblockDeviceCapacityAction action = new RefreshSharedblockDeviceCapacityAction();
action.uuid = "9bd10e4bcc0939a2b041755a160d7b34";
action.sharedBlockGroupUuid = "2974c033608537e68a305b0f29412776";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RefreshSharedblockDeviceCapacityAction.Result res = action.call();
Python SDK

RefreshSharedblockDeviceCapacityAction action = RefreshSharedblockDeviceCapacityAction()
action.uuid = "9bd10e4bcc0939a2b041755a160d7b34"
action.sharedBlockGroupUuid = "2974c033608537e68a305b0f29412776"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RefreshSharedblockDeviceCapacityAction.Result res = action.call()

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()
API Reference | 5.5.30 | ZStack Cloud · ZCF | ZStack Resource Center