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