Document navigation

SAN Storage Related Interfaces

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 example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
diskUuids List body (included in the params structure) Disk unique identifier (e.g. UUID, WWN, WWID) 2.3.2
name String body (included in the params structure) Resource name 2.3.2
description (可选) String body (included in the params structure) Detailed description of the resource 2.3.2
type (可选) String body (included in the params structure) Data storage type, which is SharedBlock 2.3.2
url String body (included in the params structure) Unused 2.3.2
zoneUuid String body (included in the params structure) Data Center UUID 2.3.2
resourceUuid (可选) String body (included 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:
  • ZStack ZSphere When adding SAN storage, you can specify the default disk provisioning method by adding primaryStorageVolumeProvisioningStrategy option to SystemTags.
    • Option format: primaryStorageVolumeProvisioningStrategy::ThinProvisioning, primaryStorageVolumeProvisioningStrategy::ThickProvisioning
    • Example: primaryStorageVolumeProvisioningStrategy::ThinProvisioning, primaryStorageVolumeProvisioningStrategy::ThickProvisioning

API Response

返回示例
{
  "inventory": {
    "name": "PS1",
    "url": "/Cloud_ps",
    "type": "LocalStorage",
    "state": "Enabled",
    "status": "Connected",
    "attachedClusterUuids": [
      "c6e9684e8bb93a9192c946dcd0564b39"
    ]
  }
}
Name Type Description Starting Version
error ErrorCode Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error 2.3.2
inventory PrimaryStorageInventory For details, see inventory 2.3.2
#error
Name Type Description Starting Version
code String Error code number, a globally unique identifier for the error, e.g. SYS.1000, HOST.1001 2.3.2
description String Brief description of the error 2.3.2
details String Detailed error information 2.3.2
elaboration String Reserved field, defaults to null 2.3.2
opaque LinkedHashMap Reserved field, defaults to null 2.3.2
cause ErrorCode Root cause: the source error that caused the current error. If there is no original error, this field is null 2.3.2
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 2.3.2
zoneUuid String Data Center UUID 2.3.2
name String Resource name 2.3.2
url String The URL. 2.3.2
description String 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 resource type. 2.3.2
state String The resource state. 2.3.2
status String The resource status. 2.3.2
mountPath String The mount path. 2.3.2
createDate Timestamp Create date 2.3.2
lastOpDate Timestamp Last update date 2.3.2
attachedClusterUuids List The attached cluster UUIDs. 2.3.2

SDK Examples

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

Query SAN storage host connection status.

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 Example
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

Run the CLI command, enter QuerySharedBlock and press Tab to view all queryable fields and resources that support cross-table queries.

API 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 Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error 2.3.2
inventories List For details, see inventories 2.3.2
#error
Name Type Description Starting Version
code String Error code number, a globally unique identifier for the error, e.g. SYS.1000, HOST.1001 2.3.2
description String Brief description of the error 2.3.2
details String Detailed error information 2.3.2
elaboration String Reserved field, defaults to null 2.3.2
opaque LinkedHashMap Reserved field, defaults to null 2.3.2
cause ErrorCode Root cause: the source error that caused the current error. If there is no original error, this field is null 2.3.2
#inventories
Name Type Description Starting Version
primaryStorageUuid String Primary storage UUID 2.3.2
hostUuid String Host UUID 2.3.2
hostId Integer Host ID 2.3.2
createDate Timestamp Create date 2.3.2
lastOpDate Timestamp Last update date 2.3.2
status PrimaryStorageHostStatus For details, see status 2.3.2
#status
Name Type Description Starting Version
name String Resource name 2.3.2
ordinal int The ordinal number. 2.3.2

SDK Examples

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 Example
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

Run the CLI command, enter QuerySharedBlock and press Tab to view all queryable fields and resources that support cross-table queries.

API 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 Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error 2.3.2
inventories List For details, see inventories 2.3.2
#error
Name Type Description Starting Version
code String Error code number, a globally unique identifier for the error, e.g. SYS.1000, HOST.1001 2.3.2
description String Brief description of the error 2.3.2
details String Detailed error information 2.3.2
elaboration String Reserved field, defaults to null 2.3.2
opaque LinkedHashMap Reserved field, defaults to null 2.3.2
cause ErrorCode Root cause: the source error that caused the current error. If there is no original error, this field is null 2.3.2
#inventories
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 2.3.2
zoneUuid String Data Center UUID 2.3.2
name String Resource name 2.3.2
url String Unused 2.3.2
description String Detailed description of the resource 2.3.2
totalCapacity Long Total capacity 2.3.2
availableCapacity Long Available capacity 2.3.2
totalPhysicalCapacity Long Total physical capacity 2.3.2
availablePhysicalCapacity Long Available physical capacity 2.3.2
systemUsedCapacity Long System used capacity 2.3.2
type String Data storage type 2.3.2
state String Enabled state 2.3.2
status String Connection status 2.3.2
mountPath String Unused 2.3.2
createDate Timestamp Create date 2.3.2
lastOpDate Timestamp Last update date 2.3.2
attachedClusterUuids List Attached clusters 2.3.2
sharedBlocks List For details, see sharedBlocks 2.3.2
sharedBlockGroupType SharedBlockGroupType For details, see sharedBlockGroupType 2.3.2
#sharedBlocks
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 2.3.2
sharedBlockGroupUuid String Shared block device group UUID 2.3.2
diskUuid String Disk unique identifier (e.g. UUID, WWN, WWID) 2.3.2
name String Resource name 2.3.2
description String Detailed description of the resource 2.3.2
createDate Timestamp Create date 2.3.2
lastOpDate Timestamp Last update date 2.3.2
type SharedBlockType For details, see type 2.3.2
state SharedBlockState For details, see state 2.3.2
status SharedBlockStatus For details, see status 2.3.2
#type
Name Type Description Starting Version
name String Resource name 2.3.2
ordinal int The ordinal number. 2.3.2
#state
Name Type Description Starting Version
name String Resource name 2.3.2
ordinal int The ordinal number. 2.3.2
#status
Name Type Description Starting Version
name String Resource name 2.3.2
ordinal int The ordinal number. 2.3.2
#sharedBlockGroupType
Name Type Description Starting Version
name String Resource name 2.3.2
ordinal int The ordinal number. 2.3.2

SDK Examples

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

Add shared block device to SAN storage.

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 example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
diskUuid String body (included in the params structure) Disk unique identifier (e.g. UUID, WWN, WWID) 2.3.2
uuid String url Primary storage UUID 2.3.2
systemTags (optional) List body Optional. The system tags. 2.3.2
userTags (optional) List body Optional. The user tags. 2.3.2

API 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 Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error 2.3.2
inventory SharedBlockGroupPrimaryStorageInventory For details, see inventory 2.3.2
#error
Name Type Description Starting Version
code String Error code number, a globally unique identifier for the error, e.g. SYS.1000, HOST.1001 2.3.2
description String Brief description of the error 2.3.2
details String Detailed error information 2.3.2
elaboration String Reserved field, defaults to null 2.3.2
opaque LinkedHashMap Reserved field, defaults to null 2.3.2
cause ErrorCode Root cause: the source error that caused the current error. If there is no original error, this field is null 2.3.2
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 2.3.2
zoneUuid String Data Center UUID 2.3.2
name String Resource name 2.3.2
url String Unused 2.3.2
description String Detailed description of the resource 2.3.2
totalCapacity Long Total capacity 2.3.2
availableCapacity Long Available capacity 2.3.2
totalPhysicalCapacity Long Total physical capacity 2.3.2
availablePhysicalCapacity Long Available physical capacity 2.3.2
systemUsedCapacity Long System used capacity 2.3.2
type String Data storage type 2.3.2
state String Enabled state 2.3.2
status String Connection status 2.3.2
mountPath String Unused 2.3.2
createDate Timestamp Create date 2.3.2
lastOpDate Timestamp Last update date 2.3.2
attachedClusterUuids List Attached clusters 2.3.2
sharedBlocks List For details, see sharedBlocks 2.3.2
sharedBlockGroupType SharedBlockGroupType For details, see sharedBlockGroupType 2.3.2
#sharedBlocks
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 2.3.2
sharedBlockGroupUuid String Shared block device group UUID 2.3.2
diskUuid String Disk unique identifier (e.g. UUID, WWN, WWID) 2.3.2
name String Resource name 2.3.2
description String Detailed description of the resource 2.3.2
createDate Timestamp Create date 2.3.2
lastOpDate Timestamp Last update date 2.3.2
type SharedBlockType For details, see type 2.3.2
state SharedBlockState For details, see state 2.3.2
status SharedBlockStatus For details, see status 2.3.2
#type
Name Type Description Starting Version
name String Resource name 2.3.2
ordinal int The ordinal number. 2.3.2
#state
Name Type Description Starting Version
name String Resource name 2.3.2
ordinal int The ordinal number. 2.3.2
#status
Name Type Description Starting Version
name String Resource name 2.3.2
ordinal int The ordinal number. 2.3.2
#sharedBlockGroupType
Name Type Description Starting Version
name String Resource name 2.3.2
ordinal int The ordinal number. 2.3.2

SDK Examples

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 Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
clusterUuid String query Cluster UUID 2.6.0
systemTags (optional) List query Optional. The system tags. 2.6.0
userTags (optional) List query Optional. The user tags. 2.6.0

API 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 Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error 2.6.0
results List For details, see results 2.6.0
#error
Name Type Description Starting Version
code String Error code number, a globally unique identifier for the error, e.g. SYS.1000, HOST.1001 2.6.0
description String Brief description of the error 2.6.0
details String Detailed error information 2.6.0
elaboration String Reserved field, defaults to null 2.6.0
opaque LinkedHashMap Reserved field, defaults to null 2.6.0
cause ErrorCode Root cause: the source error that caused the current error. If there is no original error, this field is null 2.6.0
#results
Name Type Description Starting Version
wwid String Device WWID 2.6.0
vendor String Device vendor 2.6.0
model String Device model 2.6.0
wwn String Device WWN 2.6.0
serial String Device serial number 2.6.0
hctl String SCSI device HCTL 2.6.0
type String Device type 2.6.0
size Long Device size 2.6.0

SDK Examples

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 example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example

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
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid (optional) String url Shared block device UUID. If empty, updates all devices under the shared block storage 2.6.0
sharedBlockGroupUuid String url Shared block storage UUID 2.6.0
systemTags (optional) List body Optional. The system tags. 2.6.0
userTags (optional) List body Optional. The user tags. 2.6.0

API 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 Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error 2.6.0
inventory SharedBlockGroupPrimaryStorageInventory For details, see inventory 2.6.0
#error
Name Type Description Starting Version
code String Error code number, a globally unique identifier for the error, e.g. SYS.1000, HOST.1001 2.6.0
description String Brief description of the error 2.6.0
details String Detailed error information 2.6.0
elaboration String Reserved field, defaults to null 2.6.0
opaque LinkedHashMap Reserved field, defaults to null 2.6.0
cause ErrorCode Root cause: the source error that caused the current error. If there is no original error, this field is null 2.6.0
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 2.6.0
zoneUuid String Data Center UUID 2.6.0
name String Resource name 2.6.0
url String Unused 2.6.0
description String Detailed description of the resource 2.6.0
totalCapacity Long Total capacity 2.6.0
availableCapacity Long Available capacity 2.6.0
totalPhysicalCapacity Long Total physical capacity 2.6.0
availablePhysicalCapacity Long Available physical capacity 2.6.0
systemUsedCapacity Long System used capacity 2.6.0
type String Data storage type 2.6.0
state String Enabled state 2.6.0
status String Connection status 2.6.0
mountPath String Unused 2.6.0
createDate Timestamp Create date 2.6.0
lastOpDate Timestamp Last update date 2.6.0
attachedClusterUuids List Attached clusters 2.6.0
sharedBlocks List For details, see sharedBlocks 2.6.0
sharedBlockGroupType SharedBlockGroupType For details, see sharedBlockGroupType 2.6.0
#sharedBlocks
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 2.6.0
sharedBlockGroupUuid String Shared block device group UUID 2.6.0
diskUuid String Disk unique identifier (e.g. UUID, WWN, WWID) 2.6.0
name String Resource name 2.6.0
description String Detailed description of the resource 2.6.0
createDate Timestamp Create date 2.6.0
lastOpDate Timestamp Last update date 2.6.0
type SharedBlockType For details, see type 2.6.0
state SharedBlockState For details, see state 2.6.0
status SharedBlockStatus For details, see status 2.6.0
#type
Name Type Description Starting Version
name String Resource name 2.6.0
ordinal int The ordinal number. 2.6.0
#state
Name Type Description Starting Version
name String Resource name 2.6.0
ordinal int The ordinal number. 2.6.0
#status
Name Type Description Starting Version
name String Resource name 2.6.0
ordinal int The ordinal number. 2.6.0
#sharedBlockGroupType
Name Type Description Starting Version
name String Resource name 2.6.0
ordinal int The ordinal number. 2.6.0

SDK Examples

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 Example
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

Run the CLI command, enter QuerySharedBlock and press Tab to view all queryable fields and resources that support cross-table queries.

API 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 Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error 2.3.2
inventories List For details, see inventories 2.3.2
#error
Name Type Description Starting Version
code String Error code number, a globally unique identifier for the error, e.g. SYS.1000, HOST.1001 2.3.2
description String Brief description of the error 2.3.2
details String Detailed error information 2.3.2
elaboration String Reserved field, defaults to null 2.3.2
opaque LinkedHashMap Reserved field, defaults to null 2.3.2
cause ErrorCode Root cause: the source error that caused the current error. If there is no original error, this field is null 2.3.2
#inventories
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 2.3.2
sharedBlockGroupUuid String Shared block device group UUID 2.3.2
diskUuid String Disk unique identifier (e.g. UUID, WWN, WWID) 2.3.2
name String Resource name 2.3.2
description String Detailed description of the resource 2.3.2
createDate Timestamp Create date 2.3.2
lastOpDate Timestamp Last update date 2.3.2
type SharedBlockType For details, see type 2.3.2
state SharedBlockState For details, see state 2.3.2
status SharedBlockStatus For details, see status 2.3.2
#type
Name Type Description Starting Version
name String Resource name 2.3.2
ordinal int The ordinal number. 2.3.2
#state
Name Type Description Starting Version
name String Resource name 2.3.2
ordinal int The ordinal number. 2.3.2
#status
Name Type Description Starting Version
name String Resource name 2.3.2
ordinal int The ordinal number. 2.3.2

SDK Examples

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

iSCSI Server Related Interfaces

AddIscsiServer

API Request

URLs
POST zstack/v1/storage-devices/iscsi/servers
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "ip": "10.0.0.201",
    "port": 3260.0
  },
  "systemTags": [],
  "userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"ip":"10.0.0.201","port":3260.0}}' http://localhost:8080/zstack/v1/storage-devices/iscsi/servers
Parameter List
Name Type Location Description Allowed Values Starting Version
name (optional) String body (included in the params structure) Resource Name 3.0.0
ip String body (included in the params structure) IP Address 3.0.0
port (optional) Integer body (included in the params structure) Port, defaults to 3260 3.0.0
chapUserName (optional) String body (included in the params structure) CHAP Username, defaults to empty 3.0.0
chapUserPassword (optional) String body (included in the params structure) CHAP Password, defaults to empty 3.0.0
resourceUuid (optional) String body (included in the params structure) Optional. The resource UUID. 3.0.0
systemTags (optional) List body Optional. The system tags. 3.0.0
userTags (optional) List body Optional. The user tags. 3.0.0

API Response

Response Example
{
  "inventory": {
    "uuid": "0b77c2e947ca3b40b79f6342728ec8fc",
    "name": "iscsi-server-10.0.0.201",
    "ip": "10.0.0.201",
    "port": 3260.0,
    "chapUserName": "username",
    "chapUserPassword": "password",
    "state": "Enabled",
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM"
  }
}
Name Type Description Starting Version
error ErrorCode Error code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error 3.0.0
inventory IscsiServerInventory For details, see inventory 3.0.0
#error
Name Type Description Starting Version
code String Error code number, a globally unique identifier for the error, e.g. SYS.1000, HOST.1001 3.0.0
description String Brief description of the error 3.0.0
details String Detailed error information 3.0.0
elaboration String Reserved field, defaults to null 3.0.0
opaque LinkedHashMap Reserved field, defaults to null 3.0.0
cause ErrorCode Root cause: the error that triggered the current error. If there is no original error, this field is null 3.0.0
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 3.0.0
name String Resource Name 3.0.0
ip String IP Address 3.0.0
port Integer Port 3.0.0
chapUserName String CHAP Username 3.0.0
chapUserPassword String CHAP Password 3.0.0
state String Enabled State 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0
iscsiTargets List For details, see iscsiTargets 3.0.0
iscsiClusterRefs List For details, see iscsiClusterRefs 3.0.0
#iscsiTargets
Name Type Description Starting Version
iscsiServerUuid String iSCSI Server UUID 3.0.0
uuid String Resource UUID, uniquely identifies the resource 3.0.0
iqn String iSCSI IQN 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0
iscsiLuns List For details, see iscsiLuns 3.0.0
#iscsiLuns
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 3.0.0
iscsiTargetUuid String iSCSI Target UUID 3.0.0
wwid String Unique Identifier ID 3.0.0
vendor String Device Vendor 3.0.0
model String Device Model 3.0.0
wwn String Device WWN 3.0.0
serial String Device Serial Number 3.0.0
hctl String SCSI Device HCTL 3.0.0
type String Device Type 3.0.0
path String Device Path 3.0.0
size Long Device Size 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0
#iscsiClusterRefs
Name Type Description Starting Version
iscsiServerUuid String The iscsi server UUID. 3.0.0
clusterUuid String Cluster UUID 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0

SDK Examples

Java SDK
AddIscsiServerAction action = new AddIscsiServerAction();
action.ip = "10.0.0.201";
action.port = 3260.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddIscsiServerAction.Result res = action.call();
Python SDK
AddIscsiServerAction action = AddIscsiServerAction()
action.ip = "10.0.0.201"
action.port = 3260.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddIscsiServerAction.Result res = action.call()

DeleteIscsiServer

API Request

URLs
DELETE zstack/v1/storage-devices/iscsi/servers/{uuid}?deleteMode={deleteMode}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/storage-devices/iscsi/servers/7a3f7749fd393899b4b74d2b470e15eb?deleteMode=Permissive
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url iSCSI Server UUID 3.0.0
deleteMode (optional) String url Optional. The delete mode. 3.0.0
systemTags (optional) List body Optional. The system tags. 3.0.0
userTags (optional) List body Optional. The user tags. 3.0.0

API Response

When the API succeeds, it returns an empty JSON structure {}. When an error occurs, the returned JSON structure contains an error field, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
DeleteIscsiServerAction action = new DeleteIscsiServerAction();
action.uuid = "7a3f7749fd393899b4b74d2b470e15eb";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteIscsiServerAction.Result res = action.call();
Python SDK
DeleteIscsiServerAction action = DeleteIscsiServerAction()
action.uuid = "7a3f7749fd393899b4b74d2b470e15eb"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteIscsiServerAction.Result res = action.call()

QueryIscsiServer

API Request

URLs
GET zstack/v1/storage-devices/iscsi/servers
GET zstack/v1/storage-devices/iscsi
GET zstack/v1/storage-devices/iscsi/servers/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/iscsi/servers
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/iscsi
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/iscsi/servers/cf91d809261735be9f20429880c1d19c

Queryable Fields

Run the CLI command-line tool, enter QueryIscsiServer and press Tab to see all queryable fields and resource names that can be queried across tables.

API Response

Response Example
{
  "inventories": [
    {
      "uuid": "fd97e8b6d61c399abed358ea6b2fc206",
      "name": "iscsi-server-10.0.0.201",
      "ip": "10.0.0.201",
      "port": 3260.0,
      "chapUserName": "username",
      "chapUserPassword": "password",
      "state": "Enabled",
      "iscsiTargets": [
        {
          "iscsiServerUuid": "fd97e8b6d61c399abed358ea6b2fc206",
          "uuid": "d156429110f13c2ca07bbc04e4031231",
          "iqn": "iqn.2018-01.io.cloud:tsn.00001",
          "state": "Enabled",
          "iscsiLuns": [
            {
              "uuid": "500f63c8f44939bbab102222927f9290",
              "iscsiTargetUuid": "d156429110f13c2ca07bbc04e4031231",
              "wwid": "36b083fe000daf018000015505abbe00a",
              "vendor": "DELL",
              "model": "MD32xx",
              "wwn": "0x6b083fe000daf018",
              "serial": "6b083fe000daf018000015505abbe00a",
              "hctl": "6:0:1:1",
              "type": "mpath",
              "path": "ip-0.0.0.201:3260-iscsi-iqn.2018-01.io.cloud:tsn.00001-lun-0",
              "size": 3.000318820352E13,
              "multipathDeviceUuid": "36b083fe000daf018000015505abbe00a"
            }
          ],
          "createDate": "Nov 14, 2017 10:20:57 PM",
          "lastOpDate": "Nov 14, 2017 10:20:57 PM"
        }
      ],
      "iscsiClusterRefs": [
        {
          "id": 1.0,
          "iscsiServerUuid": "fd97e8b6d61c399abed358ea6b2fc206",
          "clusterUuid": "02db8eb4e3043f55b7f1cf02df735611",
          "createDate": "Nov 14, 2017 10:20:57 PM",
          "lastOpDate": "Nov 14, 2017 10:20:57 PM"
        }
      ],
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
Name Type Description Starting Version
error ErrorCode Error code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error 3.0.0
inventories List For details, see inventories 3.0.0
#error
Name Type Description Starting Version
code String Error code number, a globally unique identifier for the error, e.g. SYS.1000, HOST.1001 3.0.0
description String Brief description of the error 3.0.0
details String Detailed error information 3.0.0
elaboration String Reserved field, defaults to null 3.0.0
opaque LinkedHashMap Reserved field, defaults to null 3.0.0
cause ErrorCode Root cause: the error that triggered the current error. If there is no original error, this field is null 3.0.0
#inventories
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 3.0.0
name String Resource Name 3.0.0
ip String IP Address 3.0.0
port Integer Port 3.0.0
chapUserName String CHAP Username 3.0.0
chapUserPassword String CHAP Password 3.0.0
state String Enabled State 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0
iscsiTargets List For details, see iscsiTargets 3.0.0
iscsiClusterRefs List For details, see iscsiClusterRefs 3.0.0
#iscsiTargets
Name Type Description Starting Version
iscsiServerUuid String iSCSI Server UUID 3.0.0
uuid String Resource UUID, uniquely identifies the resource 3.0.0
iqn String iSCSI IQN 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0
iscsiLuns List For details, see iscsiLuns 3.0.0
#iscsiLuns
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 3.0.0
iscsiTargetUuid String iSCSI Target UUID 3.0.0
wwid String Unique Identifier ID 3.0.0
vendor String Device Vendor 3.0.0
model String Device Model 3.0.0
wwn String Device WWN 3.0.0
serial String Device Serial Number 3.0.0
hctl String SCSI Device HCTL 3.0.0
type String Device Type 3.0.0
path String Device Path 3.0.0
size Long Device Size 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0
#iscsiClusterRefs
Name Type Description Starting Version
iscsiServerUuid String The iscsi server UUID. 3.0.0
clusterUuid String Cluster UUID 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0

SDK Examples

Java SDK
QueryIscsiServerAction action = new QueryIscsiServerAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryIscsiServerAction.Result res = action.call();
Python SDK
QueryIscsiServerAction action = QueryIscsiServerAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryIscsiServerAction.Result res = action.call()

RefreshIscsiServer

API Request

URLs
POST zstack/v1/storage-devices/iscsi/servers/{uuid}
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {},
  "systemTags": [],
  "userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{}}' http://localhost:8080/zstack/v1/storage-devices/iscsi/servers/0243c5d7322a36718ad76d865682ba44
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url Resource UUID, uniquely identifies the resource 3.0.0
systemTags (optional) List body Optional. The system tags. 3.0.0
userTags (optional) List body Optional. The user tags. 3.0.0

API Response

Response Example
{
  "inventory": {
    "uuid": "a4a3ef3c3ed537e6b1040ee4b7d77686",
    "name": "iscsi-server-10.0.0.201",
    "ip": "10.0.0.201",
    "port": 3260.0,
    "chapUserName": "username",
    "chapUserPassword": "password",
    "state": "Enabled",
    "iscsiTargets": [
      {
        "iscsiServerUuid": "a4a3ef3c3ed537e6b1040ee4b7d77686",
        "uuid": "3da0cdedd9763edfab39a897f87454e9",
        "iqn": "iqn.2018-01.io.cloud:tsn.00001",
        "iscsiLuns": [
          {
            "uuid": "f569b3e3baf838e59d8a115458d72a9b",
            "iscsiTargetUuid": "3da0cdedd9763edfab39a897f87454e9",
            "wwid": "36b083fe000daf018000015505abbe00a",
            "vendor": "DELL",
            "model": "MD32xx",
            "wwn": "0x6b083fe000daf018",
            "serial": "6b083fe000daf018000015505abbe00a",
            "hctl": "6:0:1:1",
            "type": "mpath",
            "path": "ip-0.0.0.201:3260-iscsi-iqn.2018-01.io.cloud:tsn.00001-lun-0",
            "size": 3.000318820352E13,
            "multipathDeviceUuid": "36b083fe000daf018000015505abbe00a"
          }
        ],
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "lastOpDate": "Nov 14, 2017 10:20:57 PM"
      }
    ],
    "iscsiClusterRefs": [
      {
        "id": 1.0,
        "iscsiServerUuid": "a4a3ef3c3ed537e6b1040ee4b7d77686",
        "clusterUuid": "da1ddc379fc137789b12bcac0ed90148",
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "lastOpDate": "Nov 14, 2017 10:20:57 PM"
      }
    ],
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM"
  }
}
Name Type Description Starting Version
error ErrorCode Error code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error 3.0.0
inventory IscsiServerInventory For details, see inventory 3.0.0
#error
Name Type Description Starting Version
code String Error code number, a globally unique identifier for the error, e.g. SYS.1000, HOST.1001 3.0.0
description String Brief description of the error 3.0.0
details String Detailed error information 3.0.0
elaboration String Reserved field, defaults to null 3.0.0
opaque LinkedHashMap Reserved field, defaults to null 3.0.0
cause ErrorCode Root cause: the error that triggered the current error. If there is no original error, this field is null 3.0.0
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 3.0.0
name String Resource Name 3.0.0
ip String IP Address 3.0.0
port Integer Port 3.0.0
chapUserName String CHAP Username 3.0.0
chapUserPassword String CHAP Password 3.0.0
state String Enabled State 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0
iscsiTargets List For details, see iscsiTargets 3.0.0
iscsiClusterRefs List For details, see iscsiClusterRefs 3.0.0
#iscsiTargets
Name Type Description Starting Version
iscsiServerUuid String iSCSI Server UUID 3.0.0
uuid String Resource UUID, uniquely identifies the resource 3.0.0
iqn String iSCSI IQN 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0
iscsiLuns List For details, see iscsiLuns 3.0.0
#iscsiLuns
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 3.0.0
iscsiTargetUuid String iSCSI Target UUID 3.0.0
wwid String Unique Identifier ID 3.0.0
vendor String Device Vendor 3.0.0
model String Device Model 3.0.0
wwn String Device WWN 3.0.0
serial String Device Serial Number 3.0.0
hctl String SCSI Device HCTL 3.0.0
type String Device Type 3.0.0
path String Device Path 3.0.0
size Long Device Size 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0
#iscsiClusterRefs
Name Type Description Starting Version
iscsiServerUuid String The iscsi server UUID. 3.0.0
clusterUuid String Cluster UUID 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0

SDK Examples

Java SDK
RefreshIscsiServerAction action = new RefreshIscsiServerAction();
action.uuid = "0243c5d7322a36718ad76d865682ba44";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RefreshIscsiServerAction.Result res = action.call();
Python SDK
RefreshIscsiServerAction action = RefreshIscsiServerAction()
action.uuid = "0243c5d7322a36718ad76d865682ba44"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RefreshIscsiServerAction.Result res = action.call()

UpdateIscsiServer

API Request

URLs
POST zstack/v1/storage-devices/iscsi/servers
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateIscsiServer": {
    "name": "test-iscsi-server"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateIscsiServer":{"name":"test-iscsi-server"}}' http://localhost:8080/zstack/v1/storage-devices/iscsi/servers/98d2177199ca301d9fd842eace2dbc67/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String body (included in the params structure) Resource UUID, uniquely identifies the resource 3.0.0
name (optional) String body (included in the params structure) Resource Name 3.0.0
chapUserName (optional) String body (included in the params structure) CHAP Username 3.0.0
chapUserPassword (optional) String body (included in the params structure) CHAP Password 3.0.0
state (optional) String body (included in the params structure) Enabled State
  • Enabled
  • Disabled
3.0.0
resourceUuid (optional) String body (included in the params structure) Optional. The resource UUID. 3.0.0
systemTags (optional) List body Optional. The system tags. 3.0.0
userTags (optional) List body Optional. The user tags. 3.0.0

API Response

Response Example
{
  "inventory": {
    "uuid": "0b77c2e947ca3b40b79f6342728ec8fc",
    "name": "iscsi-server-10.0.0.201",
    "ip": "10.0.0.201",
    "port": 3260.0,
    "chapUserName": "username",
    "chapUserPassword": "password",
    "state": "Enabled",
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM"
  }
}
Name Type Description Starting Version
error ErrorCode Error code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error 3.0.0
inventory IscsiServerInventory For details, see inventory 3.0.0
#error
Name Type Description Starting Version
code String Error code number, a globally unique identifier for the error, e.g. SYS.1000, HOST.1001 3.0.0
description String Brief description of the error 3.0.0
details String Detailed error information 3.0.0
elaboration String Reserved field, defaults to null 3.0.0
opaque LinkedHashMap Reserved field, defaults to null 3.0.0
cause ErrorCode Root cause: the error that triggered the current error. If there is no original error, this field is null 3.0.0
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 3.0.0
name String Resource Name 3.0.0
ip String IP Address 3.0.0
port Integer Port 3.0.0
chapUserName String CHAP Username 3.0.0
chapUserPassword String CHAP Password 3.0.0
state String Enabled State 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0
iscsiTargets List For details, see iscsiTargets 3.0.0
iscsiClusterRefs List For details, see iscsiClusterRefs 3.0.0
#iscsiTargets
Name Type Description Starting Version
iscsiServerUuid String iSCSI Server UUID 3.0.0
uuid String Resource UUID, uniquely identifies the resource 3.0.0
iqn String iSCSI IQN 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0
iscsiLuns List For details, see iscsiLuns 3.0.0
#iscsiLuns
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 3.0.0
iscsiTargetUuid String iSCSI Target UUID 3.0.0
wwid String Unique Identifier ID 3.0.0
vendor String Device Vendor 3.0.0
model String Device Model 3.0.0
wwn String Device WWN 3.0.0
serial String Device Serial Number 3.0.0
hctl String SCSI Device HCTL 3.0.0
type String Device Type 3.0.0
path String Device Path 3.0.0
size Long Device Size 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0
#iscsiClusterRefs
Name Type Description Starting Version
iscsiServerUuid String The iscsi server UUID. 3.0.0
clusterUuid String Cluster UUID 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0

SDK Examples

Java SDK
UpdateIscsiServerAction action = new UpdateIscsiServerAction();
action.uuid = "98d2177199ca301d9fd842eace2dbc67";
action.name = "test-iscsi-server";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateIscsiServerAction.Result res = action.call();
Python SDK
UpdateIscsiServerAction action = UpdateIscsiServerAction()
action.uuid = "98d2177199ca301d9fd842eace2dbc67"
action.name = "test-iscsi-server"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateIscsiServerAction.Result res = action.call()

AttachIscsiServerToCluster

API Request

URLs
POST zstack/v1/clusters/{clusterUuid}/storage-devices/iscsi/servers/{uuid}
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {},
  "systemTags": [],
  "userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{}}' http://localhost:8080/zstack/v1/clusters/ee5a78dfa67b34598e9fe734111592a7/storage-devices/iscsi/servers/3ae1ec6d33d53ab7b8cea6e33e517e28
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url iSCSI Server UUID 3.0.0
clusterUuid String url Cluster UUID 3.0.0
systemTags (optional) List body Optional. The system tags. 3.0.0
userTags (optional) List body Optional. The user tags. 3.0.0

API Response

Response Example
{
  "inventory": {
    "uuid": "a3d69cbb4ccc35f49354f34b9a52833d",
    "name": "iscsi-server-10.0.0.201",
    "ip": "10.0.0.201",
    "port": 3260.0,
    "chapUserName": "username",
    "chapUserPassword": "password",
    "state": "Enabled",
    "iscsiTargets": [
      {
        "iscsiServerUuid": "a3d69cbb4ccc35f49354f34b9a52833d",
        "uuid": "0a0f4da9f2ba3fddac178737e11cef73",
        "iqn": "iqn.2018-01.io.cloud:tsn.00001",
        "state": "Enabled",
        "iscsiLuns": [
          {
            "uuid": "f63e921f951435ee9d18901b8eccf986",
            "iscsiTargetUuid": "0a0f4da9f2ba3fddac178737e11cef73",
            "wwid": "36b083fe000daf018000015505abbe00a",
            "vendor": "DELL",
            "model": "MD32xx",
            "wwn": "0x6b083fe000daf018",
            "serial": "6b083fe000daf018000015505abbe00a",
            "hctl": "6:0:1:1",
            "type": "mpath",
            "path": "ip-0.0.0.201:3260-iscsi-iqn.2018-01.io.cloud:tsn.00001-lun-0",
            "size": 3.000318820352E13,
            "multipathDeviceUuid": "36b083fe000daf018000015505abbe00a"
          }
        ],
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "lastOpDate": "Nov 14, 2017 10:20:57 PM"
      }
    ],
    "iscsiClusterRefs": [
      {
        "id": 1.0,
        "iscsiServerUuid": "a3d69cbb4ccc35f49354f34b9a52833d",
        "clusterUuid": "962af991872e3ac98a2c4a7385f92541",
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "lastOpDate": "Nov 14, 2017 10:20:57 PM"
      }
    ],
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM"
  }
}
Name Type Description Starting Version
error ErrorCode Error code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error 3.0.0
inventory IscsiServerInventory For details, see inventory 3.0.0
#error
Name Type Description Starting Version
code String Error code number, a globally unique identifier for the error, e.g. SYS.1000, HOST.1001 3.0.0
description String Brief description of the error 3.0.0
details String Detailed error information 3.0.0
elaboration String Reserved field, defaults to null 3.0.0
opaque LinkedHashMap Reserved field, defaults to null 3.0.0
cause ErrorCode Root cause: the error that triggered the current error. If there is no original error, this field is null 3.0.0
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 3.0.0
name String Resource Name 3.0.0
ip String IP Address 3.0.0
port Integer Port 3.0.0
chapUserName String CHAP Username 3.0.0
chapUserPassword String CHAP Password 3.0.0
state String Enabled State 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0
iscsiTargets List For details, see iscsiTargets 3.0.0
iscsiClusterRefs List For details, see iscsiClusterRefs 3.0.0
#iscsiTargets
Name Type Description Starting Version
iscsiServerUuid String iSCSI Server UUID 3.0.0
uuid String Resource UUID, uniquely identifies the resource 3.0.0
iqn String iSCSI IQN 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0
iscsiLuns List For details, see iscsiLuns 3.0.0
#iscsiLuns
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 3.0.0
iscsiTargetUuid String iSCSI Target UUID 3.0.0
wwid String Unique Identifier ID 3.0.0
vendor String Device Vendor 3.0.0
model String Device Model 3.0.0
wwn String Device WWN 3.0.0
serial String Device Serial Number 3.0.0
hctl String SCSI Device HCTL 3.0.0
type String Device Type 3.0.0
path String Device Path 3.0.0
size Long Device Size 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0
#iscsiClusterRefs
Name Type Description Starting Version
iscsiServerUuid String The iscsi server UUID. 3.0.0
clusterUuid String Cluster UUID 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0

SDK Examples

Java SDK
AttachIscsiServerToClusterAction action = new AttachIscsiServerToClusterAction();
action.uuid = "3ae1ec6d33d53ab7b8cea6e33e517e28";
action.clusterUuid = "ee5a78dfa67b34598e9fe734111592a7";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AttachIscsiServerToClusterAction.Result res = action.call();
Python SDK
AttachIscsiServerToClusterAction action = AttachIscsiServerToClusterAction()
action.uuid = "3ae1ec6d33d53ab7b8cea6e33e517e28"
action.clusterUuid = "ee5a78dfa67b34598e9fe734111592a7"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AttachIscsiServerToClusterAction.Result res = action.call()

DetachIscsiServerFromCluster

API Request

URLs
DELETE zstack/v1/clusters/{clusterUuid}/storage-devices/iscsi/servers/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/clusters/81ecbd4ae7c9346aa3225592441c36df/storage-devices/iscsi/servers/132d1caceecd3847b30bd901485ccc44
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url iSCSI Server UUID 3.0.0
clusterUuid String url Cluster UUID 3.0.0
systemTags (optional) List body Optional. The system tags. 3.0.0
userTags (optional) List body Optional. The user tags. 3.0.0

API Response

Response Example
{
  "inventory": {
    "uuid": "2c42d5e271e93a91a4467bf936a21018",
    "ip": "10.0.0.201",
    "port": 3260.0,
    "chapUserName": "username",
    "chapUserPassword": "password",
    "state": "Enabled",
    "iscsiTargets": [
      {
        "iscsiServerUuid": "2c42d5e271e93a91a4467bf936a21018",
        "uuid": "84fb04ce8ac03803b99cab5cccd831d1",
        "iqn": "iqn.2018-01.io.cloud:tsn.00001",
        "state": "Enabled",
        "iscsiLuns": [
          {
            "uuid": "44d2c6a338123031a55ce32f102432af",
            "iscsiTargetUuid": "84fb04ce8ac03803b99cab5cccd831d1",
            "wwid": "36b083fe000daf018000015505abbe00a",
            "vendor": "DELL",
            "model": "MD32xx",
            "wwn": "0x6b083fe000daf018",
            "serial": "6b083fe000daf018000015505abbe00a",
            "hctl": "6:0:1:1",
            "type": "mpath",
            "path": "ip-0.0.0.201:3260-iscsi-iqn.2018-01.io.cloud:tsn.00001-lun-0",
            "size": 3.000318820352E13,
            "multipathDeviceUuid": "36b083fe000daf018000015505abbe00a"
          }
        ],
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "lastOpDate": "Nov 14, 2017 10:20:57 PM"
      }
    ],
    "iscsiClusterRefs": [
      {
        "id": 1.0,
        "iscsiServerUuid": "2c42d5e271e93a91a4467bf936a21018",
        "clusterUuid": "ced139d5eded3049bbfe8364804fa8c0",
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "lastOpDate": "Nov 14, 2017 10:20:57 PM"
      }
    ],
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM"
  }
}
Name Type Description Starting Version
error ErrorCode Error code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error 3.0.0
inventory IscsiServerInventory For details, see inventory 3.0.0
#error
Name Type Description Starting Version
code String Error code number, a globally unique identifier for the error, e.g. SYS.1000, HOST.1001 3.0.0
description String Brief description of the error 3.0.0
details String Detailed error information 3.0.0
elaboration String Reserved field, defaults to null 3.0.0
opaque LinkedHashMap Reserved field, defaults to null 3.0.0
cause ErrorCode Root cause: the error that triggered the current error. If there is no original error, this field is null 3.0.0
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 3.0.0
name String Resource Name 3.0.0
ip String IP Address 3.0.0
port Integer Port 3.0.0
chapUserName String CHAP Username 3.0.0
chapUserPassword String CHAP Password 3.0.0
state String Enabled State 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0
iscsiTargets List For details, see iscsiTargets 3.0.0
iscsiClusterRefs List For details, see iscsiClusterRefs 3.0.0
#iscsiTargets
Name Type Description Starting Version
iscsiServerUuid String iSCSI Server UUID 3.0.0
uuid String Resource UUID, uniquely identifies the resource 3.0.0
iqn String iSCSI IQN 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0
iscsiLuns List For details, see iscsiLuns 3.0.0
#iscsiLuns
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 3.0.0
iscsiTargetUuid String iSCSI Target UUID 3.0.0
wwid String Unique Identifier ID 3.0.0
vendor String Device Vendor 3.0.0
model String Device Model 3.0.0
wwn String Device WWN 3.0.0
serial String Device Serial Number 3.0.0
hctl String SCSI Device HCTL 3.0.0
type String Device Type 3.0.0
path String Device Path 3.0.0
size Long Device Size 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0
#iscsiClusterRefs
Name Type Description Starting Version
iscsiServerUuid String The iscsi server UUID. 3.0.0
clusterUuid String Cluster UUID 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0

SDK Examples

Java SDK
DetachIscsiServerFromClusterAction action = new DetachIscsiServerFromClusterAction();
action.uuid = "132d1caceecd3847b30bd901485ccc44";
action.clusterUuid = "81ecbd4ae7c9346aa3225592441c36df";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DetachIscsiServerFromClusterAction.Result res = action.call();
Python SDK
DetachIscsiServerFromClusterAction action = DetachIscsiServerFromClusterAction()
action.uuid = "132d1caceecd3847b30bd901485ccc44"
action.clusterUuid = "81ecbd4ae7c9346aa3225592441c36df"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DetachIscsiServerFromClusterAction.Result res = action.call()

QueryIscsiLun

API Request

URLs
GET zstack/v1/storage-devices/iscsi/luns
GET zstack/v1/storage-devices/iscsi/luns/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/iscsi/luns
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/iscsi/luns/da96929549c63b66b8afc63be70a373f

Queryable Fields

Run the CLI command-line tool, enter QueryIscsiLun and press Tab to see all queryable fields and resource names that can be queried across tables.

API Response

Response Example
{
  "inventories": [
    {
      "uuid": "d833304319da3b32bc92f21c763a8e5b",
      "wwid": "36b083fe000daf018000015505abbe00a",
      "vendor": "DELL",
      "model": "MD32xx",
      "wwn": "0x6b083fe000daf018",
      "serial": "6b083fe000daf018000015505abbe00a",
      "hctl": "6:0:1:1",
      "type": "mpath",
      "path": "ip-0.0.0.201:3260-iscsi-iqn.2018-01.io.cloud:tsn.00001-lun-0",
      "size": 3.000318820352E13,
      "multipathDeviceUuid": "36b083fe000daf018000015505abbe00a"
    },
    {
      "uuid": "a21ee1e2e3f63a61ac983c53c29552d2",
      "wwid": "36b083fe000daf018000015505abbe00a",
      "vendor": "DELL",
      "model": "MD32xx",
      "wwn": "0x6b083fe000daf018",
      "serial": "6b083fe000daf018000015505abbe00a",
      "hctl": "6:0:3:1",
      "type": "mpath",
      "path": "ip-0.0.0.201:3260-iscsi-iqn.2018-01.io.cloud:tsn.00002-lun-0",
      "size": 3.000318820352E13,
      "multipathDeviceUuid": "36b083fe000daf018000015505abbe00a"
    }
  ]
}
Name Type Description Starting Version
error ErrorCode Error code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error 3.0.0
inventories List For details, see inventories 3.0.0
#error
Name Type Description Starting Version
code String Error code number, a globally unique identifier for the error, e.g. SYS.1000, HOST.1001 3.0.0
description String Brief description of the error 3.0.0
details String Detailed error information 3.0.0
elaboration String Reserved field, defaults to null 3.0.0
opaque LinkedHashMap Reserved field, defaults to null 3.0.0
cause ErrorCode Root cause: the error that triggered the current error. If there is no original error, this field is null 3.0.0
#inventories
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 3.0.0
iscsiTargetUuid String iSCSI Target UUID 3.0.0
wwid String Unique Identifier ID 3.0.0
vendor String Device Vendor 3.0.0
model String Device Model 3.0.0
wwn String Device WWN 3.0.0
serial String Device Serial Number 3.0.0
hctl String SCSI Device HCTL 3.0.0
type String Device Type 3.0.0
path String Device Path 3.0.0
size Long Device Size 3.0.0
createDate Timestamp Creation Time 3.0.0
lastOpDate Timestamp Last Modification Time 3.0.0

SDK Examples

Java SDK
QueryIscsiLunAction action = new QueryIscsiLunAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryIscsiLunAction.Result res = action.call();
Python SDK
QueryIscsiLunAction action = QueryIscsiLunAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryIscsiLunAction.Result res = action.call()

FC Storage Related Interfaces

QueryFiberChannelStorage

API Request

URLs
GET zstack/v1/storage-devices/fiber-channel/controllers
GET zstack/v1/storage-devices/fiber-channel
GET zstack/v1/storage-devices/fiber-channel/controllers/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/fiber-channel/controllers?
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/fiber-channel?
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/fiber-channel/controllers/6ca3d260093e3c06840309e9e756b1bf

Queryable Fields

Run the CLI command tool, enter QueryFiberChannelStorage and press Tab to see all queryable fields and resource names that support cross-table queries.

API Response

Response Example
{
  "inventories": [
    {
      "uuid": "afedd6ab89d338fbaab258f981ca2295",
      "state": "Enabled",
      "fiberChannelLuns": [
        {
          "fiberChannelStorageUuid": "afedd6ab89d338fbaab258f981ca2295",
          "name": "fc-lun-36b083fe000daf018000022905ba35d8f",
          "uuid": "2e69f8443fbc3ec3a25a92ab8632f80f",
          "wwid": "36b083fe000daf018000022905ba35d8f",
          "vendor": "DELL",
          "model": "MD32xx",
          "wwn": "0x6f01faf000d5c3e7",
          "serial": "6b083fe000daf018000015505abbe00a",
          "type": "mpath",
          "path": "pci-0000:05:00.0-fc-0x2012b083fedaf018-lun-11",
          "size": 5.49755813888E12,
          "scsiLunHostRefs": [
            {
              "id": 3.0,
              "scsiLunUuid": "5a89fbd0d7793673acfa2e69acc56ce4",
              "hostUuid": "bc3f69d449aa3410bd7267a1050de980",
              "createDate": "Nov 14, 2017 10:20:57 PM",
              "lastOpDate": "Nov 14, 2017 10:20:57 PM"
            }
          ],
          "scsiLunVmInstanceRefs": []
        },
        {
          "fiberChannelStorageUuid": "afedd6ab89d338fbaab258f981ca2295",
          "name": "fc-lun-36f01faf000d5c3e7000023ef5ba362f2",
          "uuid": "52039a86c9173ff7a86ce214fc3d47cf",
          "wwid": "36f01faf000d5c3e7000023ef5ba362f2",
          "vendor": "DELL",
          "model": "MD32xx",
          "wwn": "0x6b083fe000daf018",
          "serial": "6b083fe000daf018000015505abbe00a",
          "type": "mpath",
          "path": "pci-0000:05:00.0-fc-0x2012b083fedaf018-lun-12",
          "size": 5.49755813888E12,
          "scsiLunHostRefs": [
            {
              "id": 3.0,
              "scsiLunUuid": "5a89fbd0d7793673acfa2e69acc56ce4",
              "hostUuid": "bc3f69d449aa3410bd7267a1050de980",
              "createDate": "Nov 14, 2017 10:20:57 PM",
              "lastOpDate": "Nov 14, 2017 10:20:57 PM"
            }
          ],
          "scsiLunVmInstanceRefs": []
        }
      ],
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    },
    {
      "uuid": "4e902db710403f68a7703e45d00e551d",
      "state": "Enabled",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
Name Type Description Starting Version
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 3.1.0
inventories List For details, see inventories 3.1.0
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, e.g. SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The error that caused the current error. If there is no original error, this field is null 0.6
#inventories
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 3.1.0
name String Resource name 3.1.0
wwnn String FC SAN globally unique identifier 3.1.0
state String Enabled state 3.1.0
createDate Timestamp Creation time 3.1.0
lastOpDate Timestamp Last modification time 3.1.0
fiberChannelLuns List For details, see fiberChannelLuns 3.1.0
#fiberChannelLuns
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 3.1.0
fiberChannelStorageUuid String FC SAN Storage UUID 3.1.0
wwid String Disk globally unique identifier 3.1.0
vendor String Vendor 3.1.0
model String Model 3.1.0
wwn String Disk WWN 3.1.0
serial String Disk serial number 3.1.0
type String Disk type 3.1.0
path String Disk path 3.1.0
size Long Disk size 3.1.0
createDate Timestamp Creation time 3.1.0
lastOpDate Timestamp Last modification time 3.1.0
name String Resource name 3.1.0
state String Enabled state 3.1.0
scsiLunHostRefs List For details, see scsiLunHostRefs 3.1.0
scsiLunVmInstanceRefs List For details, see scsiLunVmInstanceRefs 3.1.0
#scsiLunHostRefs
Name Type Description Starting Version
scsiLunUuid String SCSI LUN UUID 3.1.0
hostUuid String Host UUID 3.1.0
createDate Timestamp Creation time 3.1.0
lastOpDate Timestamp Last modification time 3.1.0
#scsiLunVmInstanceRefs
Name Type Description Starting Version
scsiLunUuid String SCSI LUN UUID 3.1.0
vmInstanceUuid String Virtual Machine UUID 3.1.0
createDate Timestamp Creation time 3.1.0
lastOpDate Timestamp Last modification time 3.1.0

SDK Examples

Java SDK
QueryFiberChannelStorageAction action = new QueryFiberChannelStorageAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryFiberChannelStorageAction.Result res = action.call();
Python SDK
QueryFiberChannelStorageAction action = QueryFiberChannelStorageAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryFiberChannelStorageAction.Result res = action.call()

RefreshFiberChannelStorage

API Request

URLs
POST zstack/v1/storage-devices/fiber-channel/controllers
POST zstack/v1/storage-devices/fiber-channel/controllers/{uuid}
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "uuid": "52049ca66e8135f5aac2835aecab62a0"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the example above, the systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"uuid":"52049ca66e8135f5aac2835aecab62a0"}}' http://localhost:8080/zstack/v1/storage-devices/fiber-channel/controllers
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"uuid":"52049ca66e8135f5aac2835aecab62a0"}}' http://localhost:8080/zstack/v1/storage-devices/fiber-channel/controllers/52049ca66e8135f5aac2835aecab62a0
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid (Optional) String body (contained in params structure) FC SAN Storage UUID, uniquely identifies the resource 3.1.0
zoneUuid String body (contained in params structure) Data Center UUID 3.1.0
systemTags (Optional) List body Optional. The system tags. 3.1.0
userTags (Optional) List body Optional. The user tags. 3.1.0

API Response

Response Example
{
  "inventories": [
    {
      "uuid": "971fa2e9e689304183d4eef676ad0241",
      "state": "Enabled",
      "fiberChannelLuns": [
        {
          "fiberChannelStorageUuid": "971fa2e9e689304183d4eef676ad0241",
          "name": "fc-lun-36b083fe000daf018000022905ba35d8f",
          "uuid": "2fb634b5c6ae3e1390360e982cdaf9d2",
          "wwid": "36b083fe000daf018000022905ba35d8f",
          "vendor": "DELL",
          "model": "MD32xx",
          "wwn": "0x6f01faf000d5c3e7",
          "serial": "6b083fe000daf018000015505abbe00a",
          "type": "mpath",
          "path": "pci-0000:05:00.0-fc-0x2012b083fedaf018-lun-11",
          "size": 5.49755813888E12,
          "scsiLunHostRefs": [
            {
              "id": 3.0,
              "scsiLunUuid": "fd0a53d0234e303c9ba7c316f5484a59",
              "hostUuid": "ef288e9807853188b76d3d445a35b345",
              "createDate": "Nov 14, 2017 10:20:57 PM",
              "lastOpDate": "Nov 14, 2017 10:20:57 PM"
            }
          ],
          "scsiLunVmInstanceRefs": []
        },
        {
          "fiberChannelStorageUuid": "971fa2e9e689304183d4eef676ad0241",
          "name": "fc-lun-36f01faf000d5c3e7000023ef5ba362f2",
          "uuid": "fb37b3bb268c38c3803b93ee60f25ef6",
          "wwid": "36f01faf000d5c3e7000023ef5ba362f2",
          "vendor": "DELL",
          "model": "MD32xx",
          "wwn": "0x6b083fe000daf018",
          "serial": "6b083fe000daf018000015505abbe00a",
          "type": "mpath",
          "path": "pci-0000:05:00.0-fc-0x2012b083fedaf018-lun-12",
          "size": 5.49755813888E12,
          "scsiLunHostRefs": [
            {
              "id": 3.0,
              "scsiLunUuid": "fd0a53d0234e303c9ba7c316f5484a59",
              "hostUuid": "ef288e9807853188b76d3d445a35b345",
              "createDate": "Nov 14, 2017 10:20:57 PM",
              "lastOpDate": "Nov 14, 2017 10:20:57 PM"
            }
          ],
          "scsiLunVmInstanceRefs": []
        }
      ],
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    },
    {
      "uuid": "ddc6eb334da838b08224ed6c43e67d0e",
      "state": "Enabled",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
Name Type Description Starting Version
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 3.1.0
inventories List For details, see inventories 3.1.0
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, e.g. SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The error that caused the current error. If there is no original error, this field is null 0.6
#inventories
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 3.1.0
name String Resource name 3.1.0
wwnn String FC SAN globally unique identifier 3.1.0
state String Enabled state 3.1.0
createDate Timestamp Creation time 3.1.0
lastOpDate Timestamp Last modification time 3.1.0
fiberChannelLuns List For details, see fiberChannelLuns 3.1.0
#fiberChannelLuns
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 3.1.0
fiberChannelStorageUuid String FC SAN Storage UUID 3.1.0
wwid String Disk globally unique identifier 3.1.0
vendor String Vendor 3.1.0
model String Model 3.1.0
wwn String Disk WWN 3.1.0
serial String Disk serial number 3.1.0
type String Disk type 3.1.0
path String Disk path 3.1.0
size Long Disk size 3.1.0
createDate Timestamp Creation time 3.1.0
lastOpDate Timestamp Last modification time 3.1.0
name String Resource name 3.1.0
state String Enabled state 3.1.0
scsiLunHostRefs List For details, see scsiLunHostRefs 3.1.0
scsiLunVmInstanceRefs List For details, see scsiLunVmInstanceRefs 3.1.0
#scsiLunHostRefs
Name Type Description Starting Version
scsiLunUuid String SCSI Lun UUID 3.1.0
hostUuid String Host UUID 3.1.0
createDate Timestamp Creation time 3.1.0
lastOpDate Timestamp Last modification time 3.1.0
#scsiLunVmInstanceRefs
Name Type Description Starting Version
scsiLunUuid String SCSI Lun UUID 3.1.0
vmInstanceUuid String Virtual Machine UUID 3.1.0
createDate Timestamp Creation time 3.1.0
lastOpDate Timestamp Last modification time 3.1.0

SDK Examples

Java SDK
RefreshFiberChannelStorageAction action = new RefreshFiberChannelStorageAction();
action.uuid = "52049ca66e8135f5aac2835aecab62a0";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RefreshFiberChannelStorageAction.Result res = action.call();
Python SDK
RefreshFiberChannelStorageAction action = RefreshFiberChannelStorageAction()
action.uuid = "52049ca66e8135f5aac2835aecab62a0"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RefreshFiberChannelStorageAction.Result res = action.call()

UpdateScsiLun

API Request

URLs
PUT zstack/v1/storage-devices/scsi-lun/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateScsiLun": {
    "name": "test-scsi-lun"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the example above, the systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateScsiLun":{"name":"test-scsi-lun"}}' http://localhost:8080/zstack/v1/storage-devices/scsi-lun/e2e9d7f44ee23960bc6e4e31b0a010d9/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url Resource UUID, uniquely identifies the resource 3.1.0
name (Optional) String body (contained in updateScsiLun structure) Resource name 3.1.0
state (Optional) String body (contained in updateScsiLun structure) Enabled state
  • Enabled
  • Disabled
3.1.0
systemTags (Optional) List body Optional. The system tags. 3.1.0
userTags (Optional) List body Optional. The user tags. 3.1.0

API Response

Response Example
{
  "inventory": {
    "name": "test-scsi-lun",
    "uuid": "57cefcdc1746340ba1649c446059aea0",
    "wwid": "36b083fe000daf018000022905ba35d8f",
    "vendor": "DELL",
    "model": "MD32xx",
    "wwn": "0x6f01faf000d5c3e7",
    "serial": "6b083fe000daf018000015505abbe00a",
    "type": "mpath",
    "path": "pci-0000:05:00.0-fc-0x2012b083fedaf018-lun-11",
    "size": 5.49755813888E12,
    "scsiLunHostRefs": [
      {
        "id": 1.0,
        "scsiLunUuid": "57cefcdc1746340ba1649c446059aea0",
        "hostUuid": "6e76dfbcc3b338c482ff51de1f0d76da",
        "createDate": "Nov 14, 2017 10:20:57 PM"
      }
    ],
    "scsiLunVmInstanceRefs": [],
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM"
  }
}
Name Type Description Starting Version
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 3.1.0
inventory ScsiLunInventory For details, see inventory 3.1.0
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, e.g. SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The error that caused the current error. If there is no original error, this field is null 0.6
#inventory
Name Type Description Starting Version
name String Resource name 3.1.0
uuid String Resource UUID, uniquely identifies the resource 3.1.0
wwid String Disk globally unique identifier 3.1.0
vendor String Disk vendor 3.1.0
model String Disk model 3.1.0
wwn String Disk WWN 3.1.0
serial String Disk serial number 3.1.0
type String Disk type 3.1.0
path String Disk path 3.1.0
state String Disk enabled state 3.1.0
size Long Disk size 3.1.0
createDate Timestamp Creation time 3.1.0
lastOpDate Timestamp Last modification time 3.1.0
scsiLunHostRefs List For details, see scsiLunHostRefs 3.1.0
scsiLunVmInstanceRefs List For details, see scsiLunVmInstanceRefs 3.1.0
#scsiLunHostRefs
Name Type Description Starting Version
scsiLunUuid String SCSI LUN UUID 3.1.0
hostUuid String Host UUID 3.1.0
createDate Timestamp Creation time 3.1.0
lastOpDate Timestamp Last modification time 3.1.0
#scsiLunVmInstanceRefs
Name Type Description Starting Version
scsiLunUuid String SCSI LUN UUID 3.1.0
vmInstanceUuid String Virtual Machine UUID 3.1.0
createDate Timestamp Creation time 3.1.0
lastOpDate Timestamp Last modification time 3.1.0

SDK Examples

Java SDK
UpdateScsiLunAction action = new UpdateScsiLunAction();
action.uuid = "e2e9d7f44ee23960bc6e4e31b0a010d9";
action.name = "test-scsi-lun";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateScsiLunAction.Result res = action.call();
Python SDK
UpdateScsiLunAction action = UpdateScsiLunAction()
action.uuid = "e2e9d7f44ee23960bc6e4e31b0a010d9"
action.name = "test-scsi-lun"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateScsiLunAction.Result res = action.call()

AttachScsiLunToVmInstance

API Request

URLs
POST zstack/v1/vm-instances/{vmInstanceUuid}/scsi-lun/{uuid}
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "disableMultiPathAttach": false
  },
  "systemTags": [],
  "userTags": []
}
Note:

In the example above, the systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.

Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"disableMultiPathAttach":false}}' http://localhost:8080/zstack/v1/vm-instances/e5bc51b4fdd13d35b4abe7be408435d4/scsi-lun/e4ea0f73829b3206a497c88b896613d6
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url SCSI LUN UUID, uniquely identifies the resource 3.1.0
vmInstanceUuid String url Virtual Machine UUID 3.1.0
disableMultiPathAttach (Optional) String url Disable automatic multipath device attachment 3.1.0
systemTags (Optional) List body Optional. The system tags. 3.1.0
userTags (Optional) List body Optional. The user tags. 3.1.0

API Response

Response Example
{
  "inventory": {
    "name": "fc-lun-36b083fe000daf018000022905ba35d8f",
    "uuid": "d20114f179003943904fee1127d16eba",
    "wwid": "36b083fe000daf018000022905ba35d8f",
    "vendor": "DELL",
    "model": "MD32xx",
    "wwn": "0x6f01faf000d5c3e7",
    "serial": "6b083fe000daf018000015505abbe00a",
    "type": "mpath",
    "path": "pci-0000:05:00.0-fc-0x2012b083fedaf018-lun-11",
    "size": 5.49755813888E12,
    "scsiLunHostRefs": [
      {
        "id": 1.0,
        "scsiLunUuid": "d20114f179003943904fee1127d16eba",
        "hostUuid": "e62d261d3f293e0182f85779e105eb13",
        "createDate": "Nov 14, 2017 10:20:57 PM"
      }
    ],
    "scsiLunVmInstanceRefs": [
      {
        "id": 1.0,
        "scsiLunUuid": "d20114f179003943904fee1127d16eba",
        "vmInstanceUuid": "84af387a5ef034818cc8488eaddbf5f3",
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "attachMultipath": false
      }
    ],
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM"
  }
}
Name Type Description Starting Version
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 3.1.0
inventory ScsiLunInventory For details, see inventory 3.1.0
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, e.g. SYS.1000, HOST.1001 3.1.0
description String Brief description of the error 3.1.0
details String Detailed error information 3.1.0
elaboration String Reserved field, defaults to null 3.1.0
opaque LinkedHashMap Reserved field, defaults to null 3.1.0
cause ErrorCode Root cause. The error that caused the current error. If there is no original error, this field is null 3.1.0
#inventory
Name Type Description Starting Version
name String Resource name 3.1.0
uuid String Resource UUID, uniquely identifies the resource 3.1.0
wwid String Disk globally unique identifier 3.1.0
vendor String Disk vendor 3.1.0
model String Disk model 3.1.0
wwn String Disk WWN 3.1.0
serial String Disk serial number 3.1.0
type String Disk type 3.1.0
path String Disk path 3.1.0
state String Disk enabled state 3.1.0
size Long Disk size 3.1.0
createDate Timestamp Creation time 3.1.0
lastOpDate Timestamp Last modification time 3.1.0
scsiLunHostRefs List For details, see scsiLunHostRefs 3.1.0
scsiLunVmInstanceRefs List For details, see scsiLunVmInstanceRefs 3.1.0
#scsiLunHostRefs
Name Type Description Starting Version
scsiLunUuid String SCSI LUN UUID 3.1.0
hostUuid String Host UUID 3.1.0
createDate Timestamp Creation time 3.1.0
lastOpDate Timestamp Last modification time 3.1.0
#scsiLunVmInstanceRefs
Name Type Description Starting Version
scsiLunUuid String SCSI LUN UUID 3.1.0
vmInstanceUuid String Virtual Machine UUID 3.1.0
createDate Timestamp Creation time 3.1.0
lastOpDate Timestamp Last modification time 3.1.0

SDK Examples

Java SDK
AttachScsiLunToVmInstanceAction action = new AttachScsiLunToVmInstanceAction();
action.uuid = "e4ea0f73829b3206a497c88b896613d6";
action.vmInstanceUuid = "e5bc51b4fdd13d35b4abe7be408435d4";
action.disableMultiPathAttach = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AttachScsiLunToVmInstanceAction.Result res = action.call();
Python SDK
AttachScsiLunToVmInstanceAction action = AttachScsiLunToVmInstanceAction()
action.uuid = "e4ea0f73829b3206a497c88b896613d6"
action.vmInstanceUuid = "e5bc51b4fdd13d35b4abe7be408435d4"
action.disableMultiPathAttach = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AttachScsiLunToVmInstanceAction.Result res = action.call()

DetachScsiLunFromVmInstance

API Request

URLs
DELETE zstack/v1/vm-instances/{vmInstanceUuid}/scsi-lun/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/vm-instances/68b34252ae3a386e92b74ce3a2bd7e4a/scsi-lun/4af9531a118a3b7aba404d794a4cfa51
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url Resource UUID, uniquely identifies the resource 3.1.0
vmInstanceUuid String url Virtual Machine UUID 3.1.0
systemTags (Optional) List body Optional. The system tags. 3.1.0
userTags (Optional) List body Optional. The user tags. 3.1.0

API Response

Response Example

{
  "inventory": {
    "name": "fc-lun-36b083fe000daf018000022905ba35d8f",
    "uuid": "a51554a318e333f1b96a7abe91674ede",
    "wwid": "36b083fe000daf018000022905ba35d8f",
    "vendor": "DELL",
    "model": "MD32xx",
    "wwn": "0x6f01faf000d5c3e7",
    "serial": "6b083fe000daf018000015505abbe00a",
    "type": "mpath",
    "path": "pci-0000:05:00.0-fc-0x2012b083fedaf018-lun-11",
    "size": 5.49755813888E12,
    "scsiLunHostRefs": [
      {
        "id": 1.0,
        "scsiLunUuid": "a51554a318e333f1b96a7abe91674ede",
        "hostUuid": "5c5a4a7c480e3b5791e0915785968eb1",
        "createDate": "Nov 14, 2017 10:20:57 PM"
      }
    ],
    "scsiLunVmInstanceRefs": [],
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM"
  }
}
Name Type Description Starting Version
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 3.1.0
inventory ScsiLunInventory For details, see inventory 3.1.0
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, e.g. SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The error that caused the current error. If there is no original error, this field is null 0.6
#inventory
Name Type Description Starting Version
name String Resource name 3.1.0
uuid String Resource UUID, uniquely identifies the resource 3.1.0
wwid String Disk globally unique identifier 3.1.0
vendor String Disk vendor 3.1.0
model String Disk model 3.1.0
wwn String Disk WWN 3.1.0
serial String Disk serial number 3.1.0
type String Disk type 3.1.0
path String Disk path 3.1.0
state String Disk enabled state 3.1.0
size Long Disk size 3.1.0
createDate Timestamp Creation time 3.1.0
lastOpDate Timestamp Last modification time 3.1.0
scsiLunHostRefs List For details, see scsiLunHostRefs 3.1.0
scsiLunVmInstanceRefs List For details, see scsiLunVmInstanceRefs 3.1.0
#scsiLunHostRefs
Name Type Description Starting Version
scsiLunUuid String SCSI LUN UUID 3.1.0
hostUuid String Host UUID 3.1.0
createDate Timestamp Creation time 3.1.0
lastOpDate Timestamp Last modification time 3.1.0
#scsiLunVmInstanceRefs
Name Type Description Starting Version
scsiLunUuid String SCSI LUN UUID 3.1.0
vmInstanceUuid String Virtual Machine UUID 3.1.0
createDate Timestamp Creation time 3.1.0
lastOpDate Timestamp Last modification time 3.1.0

SDK Examples

Java SDK
DetachScsiLunFromVmInstanceAction action = new DetachScsiLunFromVmInstanceAction();
action.uuid = "4af9531a118a3b7aba404d794a4cfa51";
action.vmInstanceUuid = "68b34252ae3a386e92b74ce3a2bd7e4a";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DetachScsiLunFromVmInstanceAction.Result res = action.call();
Python SDK
DetachScsiLunFromVmInstanceAction action = DetachScsiLunFromVmInstanceAction()
action.uuid = "4af9531a118a3b7aba404d794a4cfa51"
action.vmInstanceUuid = "68b34252ae3a386e92b74ce3a2bd7e4a"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DetachScsiLunFromVmInstanceAction.Result res = action.call()

NVMe Storage Related Interfaces

QueryNvmeLun

API Request

URLs
GET zstack/v1/storage-devices/nvme/luns
GET zstack/v1/storage-devices/nvme/luns/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/nvme/luns
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/nvme/luns/066996e131e03824a7ef6a22defed432

Queryable Fields

Run the CLI command tool, enter QueryNvmeLun and press Tab to view all queryable fields and resource names that can be queried across tables.

API Response

Response Example
{
  "inventories": [
    {
      "nvmeTargetUuid": "f04819a9445c3d068c075e753d48fc3c",
      "nvmeLunHostRefs": [],
      "name": "nvme-lun-36b083fe000daf018000022905ba35d8f",
      "uuid": "138c10cda11c3b8e9c7d988350d5cf64",
      "wwid": "uuid.48daeab7-7f15-405e-8481-7152cb9b0aca",
      "wwn": "uuid.48daeab7-7f15-405e-8481-7152cb9b0aca",
      "serial": "3d87eca1686c1782",
      "type": "disk",
      "path": "nvme-uuid.48daeab7-7f15-405e-8481-7152cb9b0aca ",
      "size": 5497558138880
    }
  ]
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.6.21
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 4.6.21
inventories List For details, see inventories 4.6.21
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001 4.6.21
description String Brief summary of the error 4.6.21
details String Detailed error information 4.6.21
elaboration String Reserved field, defaults to null 4.6.21
opaque LinkedHashMap Reserved field, defaults to null 4.6.21
cause ErrorCode Root cause: the source error that triggered the current error. If there is no original error, this field is null 4.6.21
#inventories
Name Type Description Starting Version
nvmeTargetUuid String NVMe device UUID 4.6.21
name String Resource name 4.6.21
uuid String Resource UUID, uniquely identifies the resource 4.6.21
wwid String Global unique identifier 4.6.21
vendor String Vendor 4.6.21
model String Model 4.6.21
wwn String The WWN. 4.6.21
serial String Serial number 4.6.21
type String Type 4.6.21
hctl String The hctl. 4.6.21
path String Path 4.6.21
state String State 4.6.21
size Long Size 4.6.21
multipathDeviceUuid String Multipath device UUID 4.6.21
source String Disk source, NVMe 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21
nvmeLunHostRefs List For details, see nvmeLunHostRefs 4.6.21
#nvmeLunHostRefs
Name Type Description Starting Version
nvmeLunUuid List NVMe disk UUID 4.6.21
hostUuid String Host UUID 4.6.21
path String Disk path 4.6.21
hctl String Disk HCTL 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21

SDK Examples

Java SDK
QueryNvmeLunAction action = new QueryNvmeLunAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryNvmeLunAction.Result res = action.call();
Python SDK
QueryNvmeLunAction action = QueryNvmeLunAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryNvmeLunAction.Result res = action.call()

QueryNvmeTarget

API Request

URLs
GET zstack/v1/storage-devices/nvme/controllers
GET zstack/v1/storage-devices/nvme
GET zstack/v1/storage-devices/nvme/controllers/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/nvme/controllers
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/nvme
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/nvme/controllers/de0f2549ed0130948f14b00916fbf9a0

Queryable Fields

Run the CLI command tool, enter QueryNvmeTarget and press Tab to view all queryable fields and resource names that can be queried across tables.

API Response

Response Example
{
  "inventories": [
    {
      "uuid": "40ab069909633d4293c62f44efb26db8",
      "state": "Enabled",
      "nvmeLuns": [
        {
          "nvmeTargetUuid": "40ab069909633d4293c62f44efb26db8",
          "nvmeLunHostRefs": [
            {
              "id": 1,
              "nvmeLunUuid": "5690b46050623763a0335e753c347fa1",
              "hostUuid": "d6f8a7ff0069304080b345c077c3aeb9",
              "createDate": "Nov 14, 2017 10:20:57 PM",
              "lastOpDate": "Nov 14, 2017 10:20:57 PM"
            }
          ],
          "name": "nvme-lun-36b083fe000daf018000022905ba35d8f",
          "uuid": "5690b46050623763a0335e753c347fa1",
          "wwid": "uuid.48daeab7-7f15-405e-8481-7152cb9b0aca",
          "wwn": "uuid.48daeab7-7f15-405e-8481-7152cb9b0aca",
          "serial": "3d87eca1686c1782",
          "type": "disk",
          "path": "nvme-uuid.48daeab7-7f15-405e-8481-7152cb9b0aca ",
          "size": 5497558138880
        }
      ],
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.6.21
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 4.6.21
inventories List For details, see inventories 4.6.21
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001 4.6.21
description String Brief summary of the error 4.6.21
details String Detailed error information 4.6.21
elaboration String Reserved field, defaults to null 4.6.21
opaque LinkedHashMap Reserved field, defaults to null 4.6.21
cause ErrorCode Root cause: the source error that triggered the current error. If there is no original error, this field is null 4.6.21
#inventories
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 4.6.21
name String Resource name 4.6.21
nqn String NVMe Qualified Name 4.6.21
state String State 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21
nvmeLuns List For details, see nvmeLuns 4.6.21
#nvmeLuns
Name Type Description Starting Version
nvmeTargetUuid String NVMe device UUID 4.6.21
name String Resource name 4.6.21
uuid String Resource UUID, uniquely identifies the resource 4.6.21
wwid String Global unique identifier 4.6.21
vendor String Vendor 4.6.21
model String Model 4.6.21
wwn String The WWN. 4.6.21
serial String Serial number 4.6.21
type String Type 4.6.21
hctl String The hctl. 4.6.21
path String Path 4.6.21
state String State 4.6.21
size Long Size 4.6.21
multipathDeviceUuid String Multipath device UUID 4.6.21
source String Disk source, NVMe 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21
nvmeLunHostRefs List For details, see nvmeLunHostRefs 4.6.21
#nvmeLunHostRefs
Name Type Description Starting Version
nvmeLunUuid List NVMe disk UUID 4.6.21
hostUuid String Host UUID 4.6.21
path String Disk path 4.6.21
hctl String Disk HCTL 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21

SDK Examples

Java SDK
QueryNvmeTargetAction action = new QueryNvmeTargetAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryNvmeTargetAction.Result res = action.call();
Python SDK
QueryNvmeTargetAction action = QueryNvmeTargetAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryNvmeTargetAction.Result res = action.call()

RefreshNvmeTarget

API Request

URLs
POST zstack/v1/storage-devices/nvme/controllers
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "zoneUuid": "7a7b52cf91933070af3c8273f30ef458"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the above example, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"zoneUuid":"7a7b52cf91933070af3c8273f30ef458"}}' \
http://localhost:8080/zstack/v1/storage-devices/nvme/controllers
Parameter List
Name Type Location Description Allowed Values Starting Version
zoneUuid String body (included in params structure) The zone UUID. Data Center UUID 4.6.21
nvmeLunUuids (Optional) List body (included in params structure) Optional. The nvme lun UUIDs. NVMe disk UUID 4.6.21
systemTags (Optional) List body Optional. The system tags. System Tag 4.6.21
userTags (Optional) List body Optional. The user tags. User Tag 4.6.21

API Response

Response Example
{
  "inventories": [
    {
      "uuid": "88ed12f1c3d7329c9b3fd00a87ce999e",
      "state": "Enabled",
      "nvmeLuns": [
        {
          "nvmeTargetUuid": "88ed12f1c3d7329c9b3fd00a87ce999e",
          "nvmeLunHostRefs": [
            {
              "id": 1,
              "nvmeLunUuid": "3adbd21bfa483cb2bc48b91c1438c788",
              "hostUuid": "8c26dfd50d963292b8a51ddc0f9957f5",
              "createDate": "Nov 14, 2017 10:20:57 PM",
              "lastOpDate": "Nov 14, 2017 10:20:57 PM"
            }
          ],
          "name": "nvme-lun-36b083fe000daf018000022905ba35d8f",
          "uuid": "3adbd21bfa483cb2bc48b91c1438c788",
          "wwid": "uuid.48daeab7-7f15-405e-8481-7152cb9b0aca",
          "wwn": "uuid.48daeab7-7f15-405e-8481-7152cb9b0aca",
          "serial": "3d87eca1686c1782",
          "type": "disk",
          "path": "nvme-uuid.48daeab7-7f15-405e-8481-7152cb9b0aca ",
          "size": 5497558138880
        }
      ],
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.6.21
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 4.6.21
inventories List For details, see inventories 4.6.21
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001 4.6.21
description String Brief summary of the error 4.6.21
details String Detailed error information 4.6.21
elaboration String Reserved field, defaults to null 4.6.21
opaque LinkedHashMap Reserved field, defaults to null 4.6.21
cause ErrorCode Root cause: the source error that triggered the current error. If there is no original error, this field is null 4.6.21
#inventories
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 4.6.21
name String Resource name 4.6.21
nqn String NVMe Qualified Name 4.6.21
state String State 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21
nvmeLuns List For details, see nvmeLuns. 4.6.21
#nvmeLuns
Name Type Description Starting Version
nvmeTargetUuid String NVMe device UUID 4.6.21
name String Resource name 4.6.21
uuid String Resource UUID, uniquely identifies the resource 4.6.21
wwid String Global unique identifier 4.6.21
vendor String Vendor 4.6.21
model String Model 4.6.21
wwn String The WWN. 4.6.21
serial String Serial number 4.6.21
type String Type 4.6.21
hctl String The hctl. 4.6.21
path String Path 4.6.21
state String State 4.6.21
size Long Size 4.6.21
multipathDeviceUuid String Multipath device UUID 4.6.21
source String Disk source, NVMe 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21
nvmeLunHostRefs List For details, see nvmeLunHostRefs. 4.6.21
#nvmeLunHostRefs
Name Type Description Starting Version
nvmeLunUuid List NVMe disk UUID 4.6.21
hostUuid String Host UUID 4.6.21
path String Disk path 4.6.21
hctl String Disk HCTL 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21

SDK Examples

Java SDK
QueryNvmeTargetAction action = new QueryNvmeTargetAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryNvmeTargetAction.Result res = action.call();
Python SDK
QueryNvmeTargetAction action = QueryNvmeTargetAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryNvmeTargetAction.Result res = action.call()

AddNvmeServer

API Request

URLs
POST zstack/v1/storage-devices/nvme/servers
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "ip": "10.0.0.201",
    "port": 4420
  },
  "systemTags": [],
  "userTags": []
}
Note: In the above example, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"ip":"10.0.0.201","port":4420}}' \
http://localhost:8080/zstack/v1/storage-devices/nvme/servers
Parameter List
Name Type Location Description Allowed Values Starting Version
name (Optional) String body (included in params structure) Name 4.7.21
ip String body (included in params structure) IP address 4.7.21
port (Optional) Integer body (included in params structure) Port 4.7.21
transport String body (included in params structure) Target transport type 4.7.21
resourceUuid (Optional) String body (included in params structure) Resource UUID 4.7.21
tagUuids (Optional) List body (included in params structure) Tag UUID list 4.7.21
systemTags (Optional) List body System Tag 4.7.21
userTags (Optional) List body User Tag 4.7.21

API Response

Response Example
{
  "inventory": {
    "uuid": "13b261814cc036629e76e2e218d3c764",
    "name": "nvme-server-10.0.0.201",
    "ip": "10.0.0.201",
    "port": 3260,
    "state": "Enabled",
    "createDate": "Nov 14, 2017 2:20:57 PM",
    "lastOpDate": "Nov 14, 2017 2:20:57 PM"
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.7.21
inventory NvmeServerInventory For details, see inventory 4.7.21
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 4.7.21
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 4.7.21
name String Resource name 4.7.21
ip String The IP address. 4.7.21
port Integer The port. 4.7.21
state String The resource state. 4.7.21
transport String The transport. 4.7.21
createDate Timestamp Creation time 4.7.21
lastOpDate Timestamp Last modification time 4.7.21
nvmeTargets List For details, see nvmeTargets 4.7.21
nvmeClusterRefs List For details, see nvmeClusterRefs 4.7.21
#nvmeTargets
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 4.6.21
name String Resource name 4.6.21
nqn String NVMe Qualified Name 4.6.21
nvmeServerUuid String NVMe server UUID 4.7.21
state String State 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21
nvmeLuns List For details, see nvmeLuns 4.6.21
#nvmeLuns
Name Type Description Starting Version
nvmeTargetUuid String NVMe device UUID 4.6.21
name String Resource name 4.6.21
uuid String Resource UUID, uniquely identifies the resource 4.6.21
wwid String Global unique identifier 4.6.21
vendor String Vendor 4.6.21
model String Model 4.6.21
wwn String The WWN. 4.6.21
serial String Serial number 4.6.21
type String Type 4.6.21
hctl String The hctl. 4.6.21
path String Path 4.6.21
state String State 4.6.21
size Long Size 4.6.21
multipathDeviceUuid String Multipath device UUID 4.6.21
source String Disk source, NVMe 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21
nvmeLunHostRefs List For details, see nvmeLunHostRefs 4.6.21
#nvmeLunHostRefs
Name Type Description Starting Version
nvmeLunUuid String NVMe disk UUID 4.6.21
hostUuid String Host UUID 4.6.21
path String Disk path 4.6.21
hctl String Disk HCTL 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21
#nvmeClusterRefs
Name Type Description Starting Version
nvmeServerUuid String The nvme server UUID. 4.7.21
clusterUuid String Cluster UUID 4.7.21
createDate Timestamp Creation time 4.7.21
lastOpDate Timestamp Last modification time 4.7.21
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001 0.6
description String Brief summary of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause: the source error that triggered the current error. If there is no original error, this field is null 0.6

SDK Examples

Java SDK
AddNvmeServerAction action = new AddNvmeServerAction();
action.ip = "10.0.0.201";
action.port = 4420;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddNvmeServerAction.Result res = action.call();
Python SDK
AddNvmeServerAction action = AddNvmeServerAction()
action.ip = "10.0.0.201"
action.port = 4420
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddNvmeServerAction.Result res = action.call()

AttachNvmeServerToCluster

API Request

URLs
POST zstack/v1/clusters/{clusterUuid}/storage-devices/nvme/servers/{uuid}
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {},
  "systemTags": [],
  "userTags": []
}
Note: In the above example, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{}}' \
http://localhost:8080/zstack/v1/clusters/1f8daabbcca53e30bde1f6511f266b53/storage-devices/nvme/servers/28aca7875015311d814e12bb7d03dbab
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url Resource UUID, uniquely identifies the resource 4.7.21
clusterUuid String url Cluster UUID 4.7.21
systemTags (Optional) List body System Tag 4.7.21
userTags (Optional) List body User Tag 4.7.21

API Response

Response Example
{
  "inventory": {
    "uuid": "cdde290bd48134bf877336209102016e",
    "name": "nvme-server-10.0.0.201",
    "ip": "10.0.0.201",
    "port": 4420,
    "state": "Enabled",
    "nvmeTargets": [
      {
        "uuid": "2bbb184e884d356badc749a5c0710e39",
        "nqn": "nqn.2014-08.org.nvmexpress.example1",
        "state": "Enabled",
        "nvmeLuns": [
          {
            "nvmeTargetUuid": "2bbb184e884d356badc749a5c0710e39",
            "nvmeLunHostRefs": [],
            "uuid": "bc5cb990bd6032c4846069cb01b32e4b",
            "wwid": "36b083fe000daf018000015505abbe00a",
            "vendor": "DELL",
            "model": "MD32xx",
            "wwn": "0x6b083fe000daf018",
            "serial": "6b083fe000daf018000015505abbe00a",
            "type": "disk",
            "hctl": "6:0:1:1",
            "path": "uuid.a5ab00e7-3bfe-4d3d-bc57-bb4032e04951",
            "size": 30003188203520
          }
        ],
        "createDate": "Nov 14, 2017 2:20:57 PM",
        "lastOpDate": "Nov 14, 2017 2:20:57 PM"
      }
    ],
    "nvmeClusterRefs": [
      {
        "id": 1,
        "nvmeServerUuid": "cdde290bd48134bf877336209102016e",
        "clusterUuid": "c471747cf3a33fbc8d2202879b407611",
        "createDate": "Nov 14, 2017 2:20:57 PM",
        "lastOpDate": "Nov 14, 2017 2:20:57 PM"
      }
    ],
    "createDate": "Nov 14, 2017 2:20:57 PM",
    "lastOpDate": "Nov 14, 2017 2:20:57 PM"
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.7.21
inventory NvmeServerInventory For details, see inventory 4.7.21
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 4.7.21
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 4.7.21
name String Resource name 4.7.21
ip String The IP address. 4.7.21
port Integer The port. 4.7.21
state String The resource state. 4.7.21
transport String The transport. 4.7.21
createDate Timestamp Creation time 4.7.21
lastOpDate Timestamp Last modification time 4.7.21
nvmeTargets List For details, see nvmeTargets 4.7.21
nvmeClusterRefs List For details, see nvmeClusterRefs 4.7.21
#nvmeTargets
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 4.6.21
name String Resource name 4.6.21
nqn String NVMe Qualified Name 4.6.21
nvmeServerUuid String NVMe server UUID 4.7.21
state String State 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21
nvmeLuns List For details, see nvmeLuns 4.6.21
#nvmeLuns
Name Type Description Starting Version
nvmeTargetUuid String NVMe device UUID 4.6.21
name String Resource name 4.6.21
uuid String Resource UUID, uniquely identifies the resource 4.6.21
wwid String Global unique identifier 4.6.21
vendor String Vendor 4.6.21
model String Model 4.6.21
wwn String The WWN. 4.6.21
serial String Serial number 4.6.21
type String Type 4.6.21
hctl String The hctl. 4.6.21
path String Path 4.6.21
state String State 4.6.21
size Long Size 4.6.21
multipathDeviceUuid String Multipath device UUID 4.6.21
source String Disk source, NVMe 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21
nvmeLunHostRefs List For details, see nvmeLunHostRefs 4.6.21
#nvmeLunHostRefs
Name Type Description Starting Version
nvmeLunUuid String NVMe disk UUID 4.6.21
hostUuid String Host UUID 4.6.21
path String Disk path 4.6.21
hctl String Disk HCTL 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21
#nvmeClusterRefs
Name Type Description Starting Version
nvmeServerUuid String The nvme server UUID. 4.7.21
clusterUuid String Cluster UUID 4.7.21
createDate Timestamp Creation time 4.7.21
lastOpDate Timestamp Last modification time 4.7.21
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001 0.6
description String Brief summary of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause: the source error that triggered the current error. If there is no original error, this field is null 0.6

SDK Examples

Java SDK
AttachNvmeServerToClusterAction action = new AttachNvmeServerToClusterAction();
action.uuid = "28aca7875015311d814e12bb7d03dbab";
action.clusterUuid = "1f8daabbcca53e30bde1f6511f266b53";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AttachNvmeServerToClusterAction.Result res = action.call();
Python SDK
AttachNvmeServerToClusterAction action = AttachNvmeServerToClusterAction()
action.uuid = "28aca7875015311d814e12bb7d03dbab"
action.clusterUuid = "1f8daabbcca53e30bde1f6511f266b53"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AttachNvmeServerToClusterAction.Result res = action.call()

DeleteNvmeServer

API Request

URLs
DELETE zstack/v1/storage-devices/nvme/servers/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/storage-devices/nvme/servers/e8dd5c1f58893f7d946ec4e3999aed0c
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url Resource UUID, uniquely identifies the resource 4.7.21
deleteMode (Optional) String body Delete mode (Permissive / Enforcing, Permissive) 4.7.21
systemTags (Optional) List body System Tag 4.7.21
userTags (Optional) List body User Tag 4.7.21

API Response

This API returns an empty JSON structure {} on success, and a JSON structure containing an error field on failure, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
DeleteNvmeServerAction action = new DeleteNvmeServerAction();
action.uuid = "e8dd5c1f58893f7d946ec4e3999aed0c";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteNvmeServerAction.Result res = action.call();
Python SDK
DeleteNvmeServerAction action = DeleteNvmeServerAction()
action.uuid = "e8dd5c1f58893f7d946ec4e3999aed0c"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteNvmeServerAction.Result res = action.call()

DetachNvmeServerFromCluster

API Request

URLs
DELETE zstack/v1/clusters/{clusterUuid}/storage-devices/nvme/servers/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/clusters/5c5365dc4af83cae8976e50f1b44b5b0/storage-devices/nvme/servers/c44c41bd90a2380a936d0267565c60ff
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url Resource UUID, uniquely identifies the resource 4.7.21
clusterUuid String url Cluster UUID 4.7.21
systemTags (Optional) List body System Tag 4.7.21
userTags (Optional) List body User Tag 4.7.21

API Response

Response Example
{
  "inventory": {
    "uuid": "ee50b8cccd27308588a83408c91eebe5",
    "name": "nvme-server-10.0.0.201",
    "ip": "10.0.0.201",
    "port": 4420,
    "state": "Enabled",
    "nvmeTargets": [
      {
        "uuid": "6460b827029f3c0c81e90769f7d560ce",
        "nqn": "nqn.2014-08.org.nvmexpress.example1",
        "state": "Enabled",
        "nvmeLuns": [
          {
            "nvmeTargetUuid": "6460b827029f3c0c81e90769f7d560ce",
            "nvmeLunHostRefs": [],
            "uuid": "960298ac721f380db77e602349a42f71",
            "wwid": "36b083fe000daf018000015505abbe00a",
            "vendor": "DELL",
            "model": "MD32xx",
            "wwn": "0x6b083fe000daf018",
            "serial": "6b083fe000daf018000015505abbe00a",
            "type": "disk",
            "hctl": "6:0:1:1",
            "path": "uuid.a5ab00e7-3bfe-4d3d-bc57-bb4032e04951",
            "size": 30003188203520
          }
        ],
        "createDate": "Nov 14, 2017 2:20:57 PM",
        "lastOpDate": "Nov 14, 2017 2:20:57 PM"
      }
    ],
    "nvmeClusterRefs": [
      {
        "id": 1,
        "nvmeServerUuid": "ee50b8cccd27308588a83408c91eebe5",
        "clusterUuid": "999ecf4771eb3f2b80ca97d88145e4e4",
        "createDate": "Nov 14, 2017 2:20:57 PM",
        "lastOpDate": "Nov 14, 2017 2:20:57 PM"
      }
    ],
    "createDate": "Nov 14, 2017 2:20:57 PM",
    "lastOpDate": "Nov 14, 2017 2:20:57 PM"
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.7.21
inventory NvmeServerInventory For details, see inventory 4.7.21
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 4.7.21
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 4.7.21
name String Resource name 4.7.21
ip String The IP address. 4.7.21
port Integer The port. 4.7.21
state String The resource state. 4.7.21
transport String The transport. 4.7.21
createDate Timestamp Creation time 4.7.21
lastOpDate Timestamp Last modification time 4.7.21
nvmeTargets List For details, see nvmeTargets 4.7.21
nvmeClusterRefs List For details, see nvmeClusterRefs 4.7.21
#nvmeTargets
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 4.6.21
name String Resource name 4.6.21
nqn String NVMe Qualified Name 4.6.21
nvmeServerUuid String NVMe server UUID 4.7.21
state String State 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21
nvmeLuns List For details, see nvmeLuns 4.6.21
#nvmeLuns
Name Type Description Starting Version
nvmeTargetUuid String NVMe device UUID 4.6.21
name String Resource name 4.6.21
uuid String Resource UUID, uniquely identifies the resource 4.6.21
wwid String Global unique identifier 4.6.21
vendor String Vendor 4.6.21
model String Model 4.6.21
wwn String The WWN. 4.6.21
serial String Serial number 4.6.21
type String Type 4.6.21
hctl String The hctl. 4.6.21
path String Path 4.6.21
state String State 4.6.21
size Long Size 4.6.21
multipathDeviceUuid String Multipath device UUID 4.6.21
source String Disk source, NVMe 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21
nvmeLunHostRefs List For details, see nvmeLunHostRefs 4.6.21
#nvmeLunHostRefs
Name Type Description Starting Version
nvmeLunUuid String NVMe disk UUID 4.6.21
hostUuid String Host UUID 4.6.21
path String Disk path 4.6.21
hctl String Disk HCTL 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21
#nvmeClusterRefs
Name Type Description Starting Version
nvmeServerUuid String The nvme server UUID. 4.7.21
clusterUuid String Cluster UUID 4.7.21
createDate Timestamp Creation time 4.7.21
lastOpDate Timestamp Last modification time 4.7.21
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001 0.6
description String Brief summary of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause: the source error that triggered the current error. If there is no original error, this field is null 0.6

SDK Examples

Java SDK
DetachNvmeServerFromClusterAction action = new DetachNvmeServerFromClusterAction();
action.uuid = "c44c41bd90a2380a936d0267565c60ff";
action.clusterUuid = "5c5365dc4af83cae8976e50f1b44b5b0";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DetachNvmeServerFromClusterAction.Result res = action.call();
Python SDK
DetachNvmeServerFromClusterAction action = DetachNvmeServerFromClusterAction()
action.uuid = "c44c41bd90a2380a936d0267565c60ff"
action.clusterUuid = "5c5365dc4af83cae8976e50f1b44b5b0"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DetachNvmeServerFromClusterAction.Result res = action.call()

QueryNvmeServer

API Request

URLs
GET zstack/v1/storage-devices/nvme/servers
GET zstack/v1/storage-devices/nvme/servers/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/nvme/servers
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/nvme/servers/dc4a7cc72a763b19b05aaba063a4cc29

Queryable Fields

Run the CLI command tool, enter QueryNvmeServer and press Tab to view all queryable fields and resource names that can be queried across tables.

API Response

This API returns an empty JSON structure {} on success, and a JSON structure containing an error field on failure, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
QueryNvmeServerAction action = new QueryNvmeServerAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryNvmeServerAction.Result res = action.call();
Python SDK
QueryNvmeServerAction action = QueryNvmeServerAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryNvmeServerAction.Result res = action.call()
API Reference | ZStack ZSphere · ZVF | ZStack Resource Center