Host Hardware Device APIs

GetHostBlockDevices

API Request

URLs
GET zstack/v1/hosts/{uuid}/get-block-devices
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/hosts/3a23c245d7f93f1a97da52a833a34e8c/get-block-devices
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url UUID of the resource. Uniquely identifies the resource. zsv 4.10.0
systemTags (Optional) List query System Tags zsv 4.10.0
userTags (Optional) List query User Tags zsv 4.10.0

API Response

On success, this API returns an empty JSON structure {}. On error, 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
GetHostBlockDevicesAction action = new GetHostBlockDevicesAction();
action.uuid = "3a23c245d7f93f1a97da52a833a34e8c";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetHostBlockDevicesAction.Result res = action.call();
Python SDK
GetHostBlockDevicesAction action = GetHostBlockDevicesAction()
action.uuid = "3a23c245d7f93f1a97da52a833a34e8c"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetHostBlockDevicesAction.Result res = action.call()

GetHostSensors

API Request

URLs
GET zstack/v1/hosts/{uuid}/get-sensors
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/hosts/9c72eabee3fb3acf99c32bd46d3efee5/get-sensors
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url UUID of the resource. Uniquely identifies the resource. zsv 4.10.0
systemTags (Optional) List query System Tags zsv 4.10.0
userTags (Optional) List query User Tags zsv 4.10.0

API Response

On success, this API returns an empty JSON structure {}. On error, 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
GetHostSensorsAction action = new GetHostSensorsAction();
action.uuid = "9c72eabee3fb3acf99c32bd46d3efee5";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetHostSensorsAction.Result res = action.call();
Python SDK
GetHostSensorsAction action = GetHostSensorsAction()
action.uuid = "9c72eabee3fb3acf99c32bd46d3efee5"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetHostSensorsAction.Result res = action.call()

UpdateHostNqn

API Request

URLs
PUT zstack/v1/hosts/nqn/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateHostNqn": {
    "nqn": "nqn.2014-08.org.nvmexpress:uuid:748d0363-8366-44db-803b-146effb96988"
  },
  "systemTags": [],
  "userTags": []
}
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateHostNqn":{"nqn":"nqn.2014-08.org.nvmexpress:uuid:748d0363-8366-44db-803b-146effb96988"}}' \
http://localhost:8080/zstack/v1/hosts/nqn/f8a3ebbe7419382cad360f53acc62d2a/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url UUID of the resource. Uniquely identifies the resource. 4.10.6
nqn String body (contained in the updateHostNqn structure) NVMe qualified name 4.10.6
systemTags (Optional) List body System Tags 4.10.6
userTags (Optional) List body User Tags 4.10.6

API Response

Response Example
{
  "inventory": {
    "zoneUuid": "d15a108ad4c332bcafccf0cb02e73a7a",
    "name": "example",
    "uuid": "54b838b4e5b9316a8fc89b77b18fa528",
    "clusterUuid": "8ebdb61e739335218a992632b3bc2dde",
    "description": "example",
    "managementIp": "192.168.0.1",
    "hypervisorType": "KVM",
    "state": "Enabled",
    "status": "Connected",
    "totalCpuCapacity": 4,
    "availableCpuCapacity": 2,
    "totalMemoryCapacity": 4,
    "availableMemoryCapacity": 4,
    "nqn": "nqn.2014-08.org.nvmexpress:uuid:748d0363-8366-44db-803b-146effb96988"
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.10.6
inventory HostInventory See inventory for details 4.10.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. See error for details 4.10.6
#inventory
Name Type Description Starting Version
zoneUuid String Data Center UUID 0.6
name String Resource name 0.6
uuid String UUID of the resource. Uniquely identifies the resource. 0.6
clusterUuid String Cluster UUID 0.6
description String Resource description 0.6
managementIp String The management IP. 0.6
hypervisorType String The hypervisor type. 0.6
state String The resource state. 0.6
status String The resource status. 0.6
totalCpuCapacity Long The total CPU capacity. 0.6
availableCpuCapacity Long The available CPU capacity. 0.6
cpuSockets Integer Physical CPU socket count 0.6
totalMemoryCapacity Long The total memory capacity. 0.6
availableMemoryCapacity Long The available memory capacity. 0.6
cpuNum Integer Logical CPU count 0.6
ipmiAddress String IPMI address 0.6
ipmiUsername String IPMI username 0.6
ipmiPort Integer IPMI port 0.6
ipmiPowerStatus String IPMI power status 0.6
architecture String The architecture. 0.6
nqn String NVMe qualified name 4.10.6
hostname String Host name 4.10.20
createDate Timestamp Create time 0.6
lastOpDate Timestamp Last update time 0.6
cpuStatus HwMonitorStatus See cpuStatus for details 4.10.0
memoryStatus HwMonitorStatus See memoryStatus for details 4.10.0
diskStatus HwMonitorStatus See diskStatus for details 4.10.0
nicStatus HwMonitorStatus See nicStatus for details 4.10.0
gpuStatus HwMonitorStatus See gpuStatus for details 4.10.0
powerSupplyStatus HwMonitorStatus See powerSupplyStatus for details 4.10.0
fanStatus HwMonitorStatus See fanStatus for details 4.10.0
raidStatus HwMonitorStatus See raidStatus for details 4.10.0
temperatureStatus HwMonitorStatus See temperatureStatus for details 4.10.0
#cpuStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#memoryStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#diskStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#nicStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#gpuStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#powerSupplyStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#fanStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#raidStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#temperatureStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#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 error description 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 error. The error that caused the current error. If there is no original error, this field is null. 0.6

SDK Examples

Java SDK
UpdateHostNqnAction action = new UpdateHostNqnAction();
action.uuid = "f8a3ebbe7419382cad360f53acc62d2a";
action.nqn = "nqn.2014-08.org.nvmexpress:uuid:748d0363-8366-44db-803b-146effb96988";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateHostNqnAction.Result res = action.call();
Python SDK
action = UpdateHostNqnAction()
action.uuid = "f8a3ebbe7419382cad360f53acc62d2a"
action.nqn = "nqn.2014-08.org.nvmexpress:uuid:748d0363-8366-44db-803b-146effb96988"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

QueryHBADevice

API Request

URLs
GET zstack/v1/storage-devices/hba
GET zstack/v1/storage-devices/hba/{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/hba?q=uuid=db041d8a238732be82740eaf5a43d252
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/hba/1698716626f33b6fb1637a76590e1fe6

Queryable Fields

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

API Response

Response Example
{
  "inventories": [
    {
      "portName": "10000090fab38778",
      "portState": "Online",
      "speed": "8 Gbit",
      "supportedSpeeds": "16 Gbit",
      "symbolicName": "QLE2692 FW:v9.07.00 DVR:v10.02.00.106-k",
      "supportedClasses": "Class 3",
      "uuid": "511a5ac34b423ac99a33d5c863531d2e",
      "name": "host",
      "hostUuid": "38e3ebc0b54e3cf8a99db5f7c80ee59e",
      "hbaType": "FC"
    }
  ]
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 5.3.0
inventories List See inventories for details 5.2.0
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. See error for details 5.3.0
#inventories
Name Type Description Starting Version
uuid String UUID of the resource. Uniquely identifies the resource. 5.3.0
name String Resource name 5.3.0
hostUuid String Host UUID 5.3.0
portName String Port name 5.3.0
portState String Port status 5.3.0
hbaType String Type 5.3.0
speed String Speed 5.3.0
supportedSpeeds String Supported speeds 5.3.0
symbolicName String Symbolic name 5.3.0
supportedClasses String Service class 5.3.0
createDate String Create time 5.3.0
lastOpDate String Last update time 5.3.0
#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 error description 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 error. The error that caused the current error. If there is no original error, this field is null. 0.6

SDK Examples

Java SDK
QueryFcHbaDeviceAction action = new QueryFcHbaDeviceAction();
action.conditions = asList("uuid=744cbe74c6f8365dafdbcf9568cfafa0");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryFcHbaDeviceAction.Result res = action.call();
Python SDK
QueryFcHbaDeviceAction action = QueryFcHbaDeviceAction()
action.conditions = ["uuid=e8b3f35dce0c38da8cec8a56347899e9"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryFcHbaDeviceAction.Result res = action.call()

QueryFiberChannelLun

API Request

URLs
GET zstack/v1/storage-devices/fiber-channel/luns
GET zstack/v1/storage-devices/fiber-channel/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/fiber-channel/luns
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/fiber-channel/luns/2bb2719f7d45316a80e333c90bbf6e59

Queryable Fields

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

API Response

Response Example
{
  "inventories": [
    {
      "fiberChannelStorageUuid": "9f1895c8d1b6306e908df42244901617",
      "scsiLunHostRefs": [],
      "scsiLunVmInstanceRefs": [],
      "name": "fc-lun-36b083fe000daf018000022905ba35d8f",
      "uuid": "aaab6d1a63713ae0ac18a21b9547312b",
      "wwid": "36b083fe000daf018000022905ba35d8f",
      "vendor": "DELL",
      "model": "MD32xx",
      "wwn": "0x6f01faf000d5c3e7",
      "serial": "6b083fe000daf018000015505abbe00a",
      "type": "mpath",
      "path": "pci-0000:05:00.0-fc-0x2012b083fedaf018-lun-11",
      "size": 5497558138880
    },
    {
      "fiberChannelStorageUuid": "9452ad8bb69f33c495bf0da260d80003",
      "scsiLunHostRefs": [],
      "scsiLunVmInstanceRefs": [],
      "name": "fc-lun-36f01faf000d5c3e7000023ef5ba362f2",
      "uuid": "cc050d2f06163d9dbf6d82cd61b7f008",
      "wwid": "36f01faf000d5c3e7000023ef5ba362f2",
      "vendor": "DELL",
      "model": "MD32xx",
      "wwn": "0x6b083fe000daf018",
      "serial": "6b083fe000daf018000015505abbe00a",
      "type": "mpath",
      "path": "pci-0000:05:00.0-fc-0x2012b083fedaf018-lun-12",
      "size": 5497558138880
    }
  ]
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 0.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. See error for details 3.1.0
inventories List See inventories for details 3.1.0
#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 error description 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 error. 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 UUID of the resource. 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 Create time 3.1.0
lastOpDate Timestamp Last update time 3.1.0
name String Resource name 3.1.0
state String Enabled status 3.1.0
scsiLunHostRefs List See scsiLunHostRefs for details 3.1.0
scsiLunVmInstanceRefs List See scsiLunVmInstanceRefs for details 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 Create time 3.1.0
lastOpDate Timestamp Last update 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 Create time 3.1.0
lastOpDate Timestamp Last update time 3.1.0

SDK Examples

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

QueryGpuDevice

API Request

URLs
GET zstack/v1/gpu-device/gpu-devices
GET zstack/v1/gpu-device/gpu-devices/{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/gpu-device/gpu-devices?q=uuid=db041d8a238732be82740eaf5a43d252
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/gpu-device/gpu-devices/1698716626f33b6fb1637a76590e1fe6

Queryable Fields

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

API Response

Response Example
{
  "inventories": [
    {
      "uuid": "4a8c3470c8ab468b96e5c98907ac0a4e",
      "name": "Tesla P40",
      "hostUuid": "38e3ebc0b54e3cf8a99db5f7c80ee59e",
      "deviceId": "10de",
      "vendorId": "10de",
      "vendorName": "NVIDIA",
      "gpuType": "NVIDIA",
      "status": "Enabled"
    }
  ]
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.10.0
inventories List See inventories for details 4.10.0
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. See error for details 4.10.0
#inventories
Name Type Description Starting Version
uuid String UUID of the resource. Uniquely identifies the resource. 4.10.0
name String Resource name 4.10.0
hostUuid String Host UUID 4.10.0
deviceId String Device ID 4.10.0
vendorId String Vendor ID 4.10.0
vendorName String Vendor name 4.10.0
gpuType String GPU type 4.10.0
status String Status 4.10.0
createDate String Create time 4.10.0
lastOpDate String Last update time 4.10.0
#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 error description 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 error. The error that caused the current error. If there is no original error, this field is null. 0.6

SDK Examples

Java SDK
QueryGpuDeviceAction action = new QueryGpuDeviceAction();
action.conditions = asList("uuid=744cbe74c6f8365dafdbcf9568cfafa0");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryGpuDeviceAction.Result res = action.call();
Python SDK
QueryGpuDeviceAction action = QueryGpuDeviceAction()
action.conditions = ["uuid=e8b3f35dce0c38da8cec8a56347899e9"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryGpuDeviceAction.Result res = action.call()

GetHostMultipathTopology

API Request

URLs
GET zstack/v1/storage-devices/multipath/topology
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/multipath/topology
Parameter List
Name Type Location Description Allowed Values Starting Version
hostUuid String query Host UUID 5.0.0
lunUuids List query The lun UUIDs. 5.0.0
systemTags (Optional) List query System Tags 0.6
userTags (Optional) List query User Tags 0.6

API Response

On success, this API returns an empty JSON structure {}. On error, 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
GetHostMultipathTopologyAction action = new GetHostMultipathTopologyAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetHostMultipathTopologyAction.Result res = action.call();
Python SDK
GetHostMultipathTopologyAction action = GetHostMultipathTopologyAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetHostMultipathTopologyAction.Result res = action.call()

RefreshNvmeServer

API Request

URLs
PUT zstack/v1/storage-devices/nvme/servers/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "refreshNvmeServer": {},
  "systemTags": [],
  "userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to show 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 '{"refreshNvmeServer":{}}' \
http://localhost:8080/zstack/v1/storage-devices/nvme/servers/03a08e55bf3239c7a72a3fee84593ef1/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url UUID of the resource. Uniquely identifies the resource. zsv 4.10.6
systemTags (Optional) List body Optional. The system tags. zsv 4.10.6
userTags (Optional) List body Optional. The user tags. zsv 4.10.6

API Response

Response Example
{
  "inventory": {
    "uuid": "a3ae41316951321e9170e43c71fa297a",
    "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. zsv 4.10.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. See error for details zsv 4.10.6
inventory NvmeServerInventory See inventory for details zsv 4.10.6
#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 error description 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 error. 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
uuid String UUID of the resource. 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 Create time 4.7.21
lastOpDate Timestamp Last update time 4.7.21
nvmeTargets List See nvmeTargets for details 4.7.21
nvmeClusterRefs List See nvmeClusterRefs for details 4.7.21
#nvmeTargets
Name Type Description Starting Version
uuid String UUID of the resource. 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 Status 4.6.21
createDate Timestamp Create time 4.6.21
lastOpDate Timestamp Last update time 4.6.21
nvmeLuns List See nvmeLuns for details 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 UUID of the resource. Uniquely identifies the resource. 4.6.21
wwid String Globally 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 Status 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 Create time 4.6.21
lastOpDate Timestamp Last update time 4.6.21
nvmeLunHostRefs List See nvmeLunHostRefs for details 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 Create time 4.6.21
lastOpDate Timestamp Last update 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 Create time 4.7.21
lastOpDate Timestamp Last update time 4.7.21

SDK Examples

Java SDK
RefreshNvmeServerAction action = new RefreshNvmeServerAction();
action.uuid = "03a08e55bf3239c7a72a3fee84593ef1";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RefreshNvmeServerAction.Result res = action.call();
Python SDK
RefreshNvmeServerAction action = RefreshNvmeServerAction()
action.uuid = "03a08e55bf3239c7a72a3fee84593ef1"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RefreshNvmeServerAction.Result res = action.call()

UpdateNvmeServer

API Request

URLs
PUT zstack/v1/storage-devices/nvme/servers/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateNvmeServer": {
    "name": "nvme-server-10.0.0.201"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the example above, the systemTags and userTags fields are optional. 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 '{"updateNvmeServer":{"name":"nvme-server-10.0.0.201"}}' \
http://localhost:8080/zstack/v1/storage-devices/nvme/servers/3adcddf1292f3665805d5345919ac617/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url UUID of the resource. Uniquely identifies the resource. zsv 4.10.6
name (Optional) String body(Contained in theupdateNvmeServerstructure) Resource name zsv 4.10.6
systemTags (Optional) List body Optional. The system tags. zsv 4.10.6
userTags (Optional) List body Optional. The user tags. zsv 4.10.6

API Response

Response Example
{
  "inventory": {
    "uuid": "1aeed04f5f1730028ab808617aee75ec",
    "name": "nvme-server-10.0.0.201",
    "ip": "10.0.0.201",
    "port": 3260,
    "state": "Enabled"
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. zsv 4.10.6
error ErrorCode Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, seeerror zsv 4.10.6
inventory NvmeServerInventory For details, seeinventory zsv 4.10.6
#error
Name Type Description Starting Version
code String Error code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.1001. 0.6
description String Brief description of the error 0.6
details String Detailed information about the error 0.6
elaboration String Reserved field. Defaults to null. 0.6
opaque LinkedHashMap Reserved field. Defaults to null. 0.6
cause ErrorCode Root error. The source error that caused the current error. This field is null if there is no root cause. 0.6
#inventory
Name Type Description Starting Version
uuid String UUID of the resource. 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, seenvmeTargets 4.7.21
nvmeClusterRefs List For details, seenvmeClusterRefs 4.7.21
#nvmeTargets
Name Type Description Starting Version
uuid String UUID of the resource. 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, seenvmeLuns 4.6.21
#nvmeLuns
Name Type Description Starting Version
nvmeTargetUuid String Parent NVMe target UUID 4.6.21
name String Resource name 4.6.21
uuid String UUID of the resource. Uniquely identifies the resource. 4.6.21
wwid String Globally 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, seenvmeLunHostRefs 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

SDK Examples

Java SDK
UpdateNvmeServerAction action = new UpdateNvmeServerAction();
action.uuid = "3adcddf1292f3665805d5345919ac617";
action.name = "nvme-server-10.0.0.201";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateNvmeServerAction.Result res = action.call();
Python SDK
UpdateNvmeServerAction action = UpdateNvmeServerAction()
action.uuid = "3adcddf1292f3665805d5345919ac617"
action.name = "nvme-server-10.0.0.201"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateNvmeServerAction.Result res = action.call()

CheckScsiLunClusterStatus

API Request

URLs
PUT zstack/v1/storage-devices/scsi-lun/{uuid}/cluster/{clusterUuid}
Headers
Authorization: OAuth the-session-uuid
Body
{
  "checkScsiLunClusterStatus": {},
  "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 '{"checkScsiLunClusterStatus":{}}' \
http://localhost:8080/zstack/v1/storage-devices/scsi-lun/abe6bf1e763739f88f97055c14246245/cluster/5415c2beb8a93447a27f69c109cdfb23
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url UUID of the resource. Uniquely identifies the resource. 3.1.0
clusterUuid String url Cluster 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": {
    "attachedHosts": [
      {
        "zoneUuid": "5899ac6fab7d3951acae1d43c4fd7f97",
        "name": "example",
        "uuid": "161616a23a4834cfbe3dd7000a75ef51",
        "clusterUuid": "b886a9367ff9362d8955443cc5065fab",
        "description": "example",
        "managementIp": "192.168.0.1",
        "hypervisorType": "KVM",
        "state": "Enabled",
        "status": "Connected",
        "totalCpuCapacity": 4,
        "availableCpuCapacity": 2,
        "totalMemoryCapacity": 4,
        "availableMemoryCapacity": 4
      }
    ],
    "unattachedHosts": [
      {
        "zoneUuid": "ee802d3432203cc99a9711b3d26e047d",
        "name": "example",
        "uuid": "0d28db87cedc3c729300bcc7f426f9b6",
        "clusterUuid": "5d5325e38b4331c28efe5367dc583110",
        "description": "example",
        "managementIp": "192.168.0.2",
        "hypervisorType": "KVM",
        "state": "Enabled",
        "status": "Connected",
        "totalCpuCapacity": 4,
        "availableCpuCapacity": 2,
        "totalMemoryCapacity": 4,
        "availableMemoryCapacity": 4
      }
    ],
    "isAllHostsAttached": false
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 0.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. See error for details 3.1.0
inventory ScsiLunClusterStatusInventory See inventory for details 3.1.0
#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 error description 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 error. 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
isAllHostsAttached Boolean Whether the SCSI LUN is connected to all hosts in the cluster 3.1.0
attachedHosts List See attachedHosts for details 3.1.0
unattachedHosts List See unattachedHosts for details 3.1.0
#attachedHosts
Name Type Description Starting Version
zoneUuid String Data Center UUID 0.6
name String Resource name 0.6
uuid String UUID of the resource. Uniquely identifies the resource. 0.6
clusterUuid String Cluster UUID 0.6
description String Resource description 0.6
managementIp String The management IP. 0.6
hypervisorType String The hypervisor type. 0.6
state String The resource state. 0.6
status String The resource status. 0.6
totalCpuCapacity Long The total CPU capacity. 0.6
availableCpuCapacity Long The available CPU capacity. 0.6
cpuSockets Integer Number of physical CPU sockets 0.6
totalMemoryCapacity Long The total memory capacity. 0.6
availableMemoryCapacity Long The available memory capacity. 0.6
cpuNum Integer Number of logical CPUs 0.6
ipmiAddress String IPMI address 0.6
ipmiUsername String IPMI username 0.6
ipmiPort Integer IPMI port 0.6
ipmiPowerStatus String IPMI power status 0.6
architecture String The architecture. 0.6
nqn String NVMe Qualified Name zsv 4.10.6
createDate Timestamp Create time 0.6
lastOpDate Timestamp Last update time 0.6
cpuStatus HwMonitorStatus See cpuStatus for details 4.10.0
memoryStatus HwMonitorStatus See memoryStatus for details 4.10.0
diskStatus HwMonitorStatus See diskStatus for details 4.10.0
nicStatus HwMonitorStatus See nicStatus for details 4.10.0
gpuStatus HwMonitorStatus See gpuStatus for details 4.10.0
powerSupplyStatus HwMonitorStatus See powerSupplyStatus for details 4.10.0
fanStatus HwMonitorStatus See fanStatus for details 4.10.0
raidStatus HwMonitorStatus See raidStatus for details 4.10.0
temperatureStatus HwMonitorStatus See temperatureStatus for details 4.10.0
#cpuStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#memoryStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#diskStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#nicStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#gpuStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#powerSupplyStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#fanStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#raidStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#temperatureStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#unattachedHosts
Name Type Description Starting Version
zoneUuid String Data Center UUID 0.6
name String Resource name 0.6
uuid String UUID of the resource. Uniquely identifies the resource. 0.6
clusterUuid String Cluster UUID 0.6
description String Resource description 0.6
managementIp String The management IP. 0.6
hypervisorType String The hypervisor type. 0.6
state String The resource state. 0.6
status String The resource status. 0.6
totalCpuCapacity Long The total CPU capacity. 0.6
availableCpuCapacity Long The available CPU capacity. 0.6
cpuSockets Integer Number of physical CPU sockets 0.6
totalMemoryCapacity Long The total memory capacity. 0.6
availableMemoryCapacity Long The available memory capacity. 0.6
cpuNum Integer Number of logical CPUs 0.6
ipmiAddress String IPMI address 0.6
ipmiUsername String IPMI username 0.6
ipmiPort Integer IPMI port 0.6
ipmiPowerStatus String IPMI power status 0.6
architecture String The architecture. 0.6
nqn String NVMe Qualified Name zsv 4.10.6
createDate Timestamp Create time 0.6
lastOpDate Timestamp Last update time 0.6
cpuStatus HwMonitorStatus See cpuStatus for details 4.10.0
memoryStatus HwMonitorStatus See memoryStatus for details 4.10.0
diskStatus HwMonitorStatus See diskStatus for details 4.10.0
nicStatus HwMonitorStatus See nicStatus for details 4.10.0
gpuStatus HwMonitorStatus See gpuStatus for details 4.10.0
powerSupplyStatus HwMonitorStatus See powerSupplyStatus for details 4.10.0
fanStatus HwMonitorStatus See fanStatus for details 4.10.0
raidStatus HwMonitorStatus See raidStatus for details 4.10.0
temperatureStatus HwMonitorStatus See temperatureStatus for details 4.10.0
#cpuStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#memoryStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#diskStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#nicStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#gpuStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#powerSupplyStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#fanStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#raidStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0
#temperatureStatus
Name Type Description Starting Version
Normal HwMonitorStatus Normal 4.10.0
Error HwMonitorStatus Error 4.10.0
Unknown HwMonitorStatus Unknown 4.10.0

SDK Examples

Java SDK
CheckScsiLunClusterStatusAction action = new CheckScsiLunClusterStatusAction();
action.uuid = "abe6bf1e763739f88f97055c14246245";
action.clusterUuid = "5415c2beb8a93447a27f69c109cdfb23";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CheckScsiLunClusterStatusAction.Result res = action.call();
Python SDK
CheckScsiLunClusterStatusAction action = CheckScsiLunClusterStatusAction()
action.uuid = "abe6bf1e763739f88f97055c14246245"
action.clusterUuid = "5415c2beb8a93447a27f69c109cdfb23"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CheckScsiLunClusterStatusAction.Result res = action.call()

DetachScsiLunFromHost

API Request

URLs
PUT zstack/v1/storage-devices/scsi-lun/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "detachScsiLunFromHost": {
    "hostUuid": "dce542427a3a3d1fa13324c9f67352cb"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to show 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 '{"detachScsiLunFromHost":{"hostUuid":"dce542427a3a3d1fa13324c9f67352cb"}}' \
http://localhost:8080/zstack/v1/storage-devices/scsi-lun/fb5d3f596f683bd7a3b1bf1c396d5f4d/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url SCSI LUN UUID 4.1.6
hostUuid (Optional) String body (contained in the detachScsiLunFromHost structure) Host UUID 4.1.6
systemTags (Optional) List body System Tags 4.1.6
userTags (Optional) List body User Tags 4.1.6

API Response

Response Example
{
  "inventory": {
    "scsiLunHostRefs": [],
    "scsiLunVmInstanceRefs": [],
    "name": "test-scsi-lun",
    "uuid": "e09fbca6d27332a1946326f3ae114fc3",
    "wwid": "36b083fe000daf018000022905ba35d8f",
    "vendor": "DELL",
    "model": "MD32xx",
    "wwn": "0x6f01faf000d5c3e7",
    "serial": "6b083fe000daf018000015505abbe00a",
    "type": "mpath",
    "path": "pci-0000:05:00.0-fc-0x2012b083fedaf018-lun-11",
    "size": 5497558138880,
    "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. 0.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. See error for details 4.1.6
inventory ScsiLunInventory See inventory for details 4.1.6
#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 error description 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 error. 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 UUID of the resource. 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 status 3.1.0
size Long Disk size 3.1.0
createDate Timestamp Create time 3.1.0
lastOpDate Timestamp Last update time 3.1.0
scsiLunHostRefs List See scsiLunHostRefs for details 3.1.0
scsiLunVmInstanceRefs List See scsiLunVmInstanceRefs for details 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 Create time 3.1.0
lastOpDate Timestamp Last update 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 Create time 3.1.0
lastOpDate Timestamp Last update time 3.1.0

SDK Examples

Java SDK
DetachScsiLunFromHostAction action = new DetachScsiLunFromHostAction();
action.uuid = "fb5d3f596f683bd7a3b1bf1c396d5f4d";
action.hostUuid = "dce542427a3a3d1fa13324c9f67352cb";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DetachScsiLunFromHostAction.Result res = action.call();
Python SDK
DetachScsiLunFromHostAction action = DetachScsiLunFromHostAction()
action.uuid = "fb5d3f596f683bd7a3b1bf1c396d5f4d"
action.hostUuid = "dce542427a3a3d1fa13324c9f67352cb"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DetachScsiLunFromHostAction.Result res = action.call()

GetScsiLunCandidatesForAttachingVm

API Request

URLs
GET zstack/v1/vm-instances/{vmInstanceUuid}/candidate-storage-devices
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/vm-instances/ccd1f4cb76e83c3b997fc4ed16ed529f/candidate-storage-devices
Parameter List
Name Type Location Description Allowed Values Starting Version
vmInstanceUuid String url Virtual Machine UUID 3.1.0
systemTags (Optional) List query Optional. The system tags. 3.1.0
userTags (Optional) List query Optional. The user tags. 3.1.0

API Response

Response Example
{
  "inventories": [
    {
      "scsiLunHostRefs": [
        {
          "id": 1,
          "scsiLunUuid": "d4714249ba273a5c9d1c1cb3a1a16f24",
          "hostUuid": "c922c37f885e35aeb1ae87db3446fc7e",
          "createDate": "Nov 14, 2017 2:20:57 PM"
        }
      ],
      "scsiLunVmInstanceRefs": [],
      "name": "fc-lun-36b083fe000daf018000022905ba35d8f",
      "uuid": "d4714249ba273a5c9d1c1cb3a1a16f24",
      "wwid": "36b083fe000daf018000022905ba35d8f",
      "vendor": "DELL",
      "model": "MD32xx",
      "wwn": "0x6f01faf000d5c3e7",
      "serial": "6b083fe000daf018000015505abbe00a",
      "type": "mpath",
      "path": "pci-0000:05:00.0-fc-0x2012b083fedaf018-lun-11",
      "size": 5497558138880,
      "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. 3.1.0
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. See error for details 3.1.0
inventories List See inventories for details 3.1.0
#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 error description 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 error. 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
name String Resource name 3.1.0
uuid String UUID of the resource. 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 status 3.1.0
size Long Disk size 3.1.0
createDate Timestamp Create time 3.1.0
lastOpDate Timestamp Last update time 3.1.0
scsiLunHostRefs List See scsiLunHostRefs for details 3.1.0
scsiLunVmInstanceRefs List See scsiLunVmInstanceRefs for details 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 Create time 3.1.0
lastOpDate Timestamp Last update 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 Create time 3.1.0
lastOpDate Timestamp Last update time 3.1.0

SDK Examples

Java SDK
GetScsiLunCandidatesForAttachingVmAction action = new GetScsiLunCandidatesForAttachingVmAction();
action.vmInstanceUuid = "ccd1f4cb76e83c3b997fc4ed16ed529f";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetScsiLunCandidatesForAttachingVmAction.Result res = action.call();
Python SDK
GetScsiLunCandidatesForAttachingVmAction action = GetScsiLunCandidatesForAttachingVmAction()
action.vmInstanceUuid = "ccd1f4cb76e83c3b997fc4ed16ed529f"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetScsiLunCandidatesForAttachingVmAction.Result res = action.call()

QueryScsiLun

API Request

URLs
GET zstack/v1/storage-devices/scsi-lun/luns
GET zstack/v1/storage-devices/scsi-lun/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/scsi-lun/luns
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/scsi-lun/luns/c4006c2a536f3617944e2b00aff74af6

Queryable Fields

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

API Response

Response Example
{
  "inventories": [
    {
      "scsiLunHostRefs": [
        {
          "id": 1,
          "scsiLunUuid": "6f2428969262315488684c85e14eded2",
          "hostUuid": "0b756ca2d3843412860b7ec1b9315dd4",
          "createDate": "Nov 14, 2017 2:20:57 PM"
        }
      ],
      "scsiLunVmInstanceRefs": [],
      "name": "fc-lun-36b083fe000daf018000022905ba35d8f",
      "uuid": "6f2428969262315488684c85e14eded2",
      "wwid": "36b083fe000daf018000022905ba35d8f",
      "vendor": "DELL",
      "model": "MD32xx",
      "wwn": "0x6f01faf000d5c3e7",
      "serial": "6b083fe000daf018000015505abbe00a",
      "type": "mpath",
      "path": "pci-0000:05:00.0-fc-0x2012b083fedaf018-lun-11",
      "size": 5497558138880,
      "createDate": "Nov 14, 2017 2:20:57 PM",
      "lastOpDate": "Nov 14, 2017 2:20:57 PM"
    },
    {
      "scsiLunHostRefs": [],
      "scsiLunVmInstanceRefs": [],
      "name": "iscsi-lun-scsi-14f504e46494c45524d5342436a6c2d4a4443672d30593032",
      "uuid": "7bfde6b8e5503606849a4f3781bc02d7",
      "wwid": "scsi-14f504e46494c45524d5342436a6c2d4a4443672d30593032",
      "vendor": "OPNFILER",
      "model": "VIRTUAL-DISK",
      "serial": "4f504e46494c45524d5342436a6c2d4a4443672d30593032",
      "type": "disk",
      "path": "ip-10.0.104.213:3260-iscsi-iqn.2018-09.io.zstack:tsn.0000003-lun-0",
      "size": 5497558138880,
      "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. 0.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. See error for details 3.2.0
inventories List See inventories for details 3.2.0
#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 error description 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 error. 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
name String Resource name 3.1.0
uuid String UUID of the resource. 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 status 3.1.0
size Long Disk size 3.1.0
createDate Timestamp Create time 3.1.0
lastOpDate Timestamp Last update time 3.1.0
scsiLunHostRefs List See scsiLunHostRefs for details 3.1.0
scsiLunVmInstanceRefs List See scsiLunVmInstanceRefs for details 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 Create time 3.1.0
lastOpDate Timestamp Last update 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 Create time 3.1.0
lastOpDate Timestamp Last update time 3.1.0

SDK Examples

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

GetLocalRaidPhysicalDriveSmart

API Request

URLs
GET zstack/v1/storage-devices/local-raid/physical-drives/{uuid}/smart
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/local-raid/physical-drives/4608455038ef362b809cf8aff74e0131/smart
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url UUID of the resource. Uniquely identifies the resource. 3.6
systemTags (Optional) List query Optional. The system tags. 3.6
userTags (Optional) List query Optional. The user tags. 3.6

API Response

Response Example
{
  "result": [
    {
      "id": 1,
      "attributeName": "Raw_Read_Error_Rate",
      "flag": "0x002f",
      "value": 200,
      "worst": 200,
      "thresh": 41,
      "type": "Pre-fail",
      "updated": "Always",
      "whenFailed": "-",
      "rawValue": 0
    },
    {
      "id": 3,
      "attributeName": "Spin_Up_Time",
      "flag": "0x0027",
      "value": 142,
      "worst": 142,
      "thresh": 17,
      "type": "Pre-fail",
      "updated": "Always",
      "whenFailed": "-",
      "rawValue": 3866
    },
    {
      "id": 4,
      "attributeName": "Start_Stop_Count",
      "flag": "0x0032",
      "value": 100,
      "worst": 100,
      "thresh": 0,
      "type": "Old_age",
      "updated": "Always",
      "whenFailed": "-",
      "rawValue": 22
    },
    {
      "id": 5,
      "attributeName": "Reallocated_Sector_Ct",
      "flag": "0x0033",
      "value": 200,
      "worst": 200,
      "thresh": 140,
      "type": "Pre-fail",
      "updated": "Always",
      "whenFailed": "-",
      "rawValue": 0
    },
    {
      "id": 7,
      "attributeName": "Seek_Error_Rate",
      "flag": "0x002e",
      "value": 200,
      "worst": 200,
      "thresh": 0,
      "type": "Old_age",
      "updated": "Always",
      "whenFailed": "-",
      "rawValue": 0
    },
    {
      "id": 9,
      "attributeName": "Power_On_Hours",
      "flag": "0x0032",
      "value": 97,
      "worst": 97,
      "thresh": 0,
      "type": "Old_age",
      "updated": "Always",
      "whenFailed": "-",
      "rawValue": 2585
    },
    {
      "id": 10,
      "attributeName": "Spin_Retry_Count",
      "flag": "0x0032",
      "value": 100,
      "worst": 253,
      "thresh": 0,
      "type": "Old_age",
      "updated": "Always",
      "whenFailed": "-",
      "rawValue": 0
    },
    {
      "id": 11,
      "attributeName": "Calibration_Retry_Count",
      "flag": "0x0032",
      "value": 100,
      "worst": 253,
      "thresh": 0,
      "type": "Old_age",
      "updated": "Always",
      "whenFailed": "-",
      "rawValue": 0
    },
    {
      "id": 12,
      "attributeName": "Power_Cycle_Count",
      "flag": "0x0032",
      "value": 100,
      "worst": 100,
      "thresh": 0,
      "type": "Old_age",
      "updated": "Always",
      "whenFailed": "-",
      "rawValue": 22
    },
    {
      "id": 16,
      "attributeName": "Unknown_Attribute",
      "flag": "0x0022",
      "value": 0,
      "worst": 200,
      "thresh": 0,
      "type": "Old_age",
      "updated": "Always",
      "whenFailed": "-",
      "rawValue": 34516442916
    },
    {
      "id": 183,
      "attributeName": "Runtime_Bad_Block",
      "flag": "0x0032",
      "value": 100,
      "worst": 100,
      "thresh": 0,
      "type": "Old_age",
      "updated": "Always",
      "whenFailed": "-",
      "rawValue": 0
    },
    {
      "id": 192,
      "attributeName": "Power-Off_Retract_Count",
      "flag": "0x0032",
      "value": 200,
      "worst": 200,
      "thresh": 0,
      "type": "Old_age",
      "updated": "Always",
      "whenFailed": "-",
      "rawValue": 20
    },
    {
      "id": 193,
      "attributeName": "Load_Cycle_Count",
      "flag": "0x0032",
      "value": 200,
      "worst": 200,
      "thresh": 0,
      "type": "Old_age",
      "updated": "Always",
      "whenFailed": "-",
      "rawValue": 4
    },
    {
      "id": 194,
      "attributeName": "Temperature_Celsius",
      "flag": "0x0022",
      "value": 112,
      "worst": 106,
      "thresh": 0,
      "type": "Old_age",
      "updated": "Always",
      "whenFailed": "-",
      "rawValue": 31
    },
    {
      "id": 196,
      "attributeName": "Reallocated_Event_Count",
      "flag": "0x0032",
      "value": 200,
      "worst": 200,
      "thresh": 0,
      "type": "Old_age",
      "updated": "Always",
      "whenFailed": "-",
      "rawValue": 0
    },
    {
      "id": 197,
      "attributeName": "Current_Pending_Sector",
      "flag": "0x0032",
      "value": 200,
      "worst": 200,
      "thresh": 0,
      "type": "Old_age",
      "updated": "Always",
      "whenFailed": "-",
      "rawValue": 0
    },
    {
      "id": 198,
      "attributeName": "Offline_Uncorrectable",
      "flag": "0x0030",
      "value": 200,
      "worst": 200,
      "thresh": 0,
      "type": "Old_age",
      "updated": "Offline",
      "whenFailed": "-",
      "rawValue": 0
    },
    {
      "id": 199,
      "attributeName": "UDMA_CRC_Error_Count",
      "flag": "0x0032",
      "value": 200,
      "worst": 200,
      "thresh": 0,
      "type": "Old_age",
      "updated": "Always",
      "whenFailed": "-",
      "rawValue": 0
    },
    {
      "id": 200,
      "attributeName": "Multi_Zone_Error_Rate",
      "flag": "0x08",
      "value": 200,
      "worst": 200,
      "thresh": 0,
      "type": "Old_age",
      "updated": "Offline",
      "whenFailed": "-",
      "rawValue": 0
    }
  ]
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 0.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. See error for details 3.6
result List See result for details 3.6
#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 error description 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 error. The error that caused the current error. If there is no original error, this field is null. 0.6
#result
Name Type Description Starting Version
id Integer Id 3.6
attributeName String Attribute name 3.6
flag String Flag 3.6
value Integer Current normalized value 3.6
worst Integer Worst normalized value 3.6
thresh Integer Threshold 3.6
type String Type 3.6
updated String Update 3.6
whenFailed String When failed 3.6
rawValue Long Raw value 3.6
state String Health status 3.6

SDK Examples

Java SDK
GetLocalRaidPhysicalDriveSmartAction action = new GetLocalRaidPhysicalDriveSmartAction();
action.uuid = "4608455038ef362b809cf8aff74e0131";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetLocalRaidPhysicalDriveSmartAction.Result res = action.call();
Python SDK
GetLocalRaidPhysicalDriveSmartAction action = GetLocalRaidPhysicalDriveSmartAction()
action.uuid = "4608455038ef362b809cf8aff74e0131"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetLocalRaidPhysicalDriveSmartAction.Result res = action.call()

LocateLocalRaidPhysicalDrive

API Request

URLs
PUT zstack/v1/storage-devices/local-raid/physical-drives/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "locateLocalRaidPhysicalDrive": {
    "locate": true
  },
  "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 '{"locateLocalRaidPhysicalDrive":{"locate":true}}' \
http://localhost:8080/zstack/v1/storage-devices/local-raid/physical-drives/572005810d8536c6a24ef9509f362c84/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url UUID of the resource. Uniquely identifies the resource. 3.6
locate (Optional) Boolean body(contained in the locateLocalRaidPhysicalDrive structure) Turn on or off the locator LED 3.6
systemTags (Optional) List body Optional. The system tags. 3.6
userTags (Optional) List body Optional. The user tags. 3.6

API Response

On success, this API returns an empty JSON structure {}. On error, 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
LocateLocalRaidPhysicalDriveAction action = new LocateLocalRaidPhysicalDriveAction();
action.uuid = "572005810d8536c6a24ef9509f362c84";
action.locate = true;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
LocateLocalRaidPhysicalDriveAction.Result res = action.call();
Python SDK
LocateLocalRaidPhysicalDriveAction action = LocateLocalRaidPhysicalDriveAction()
action.uuid = "572005810d8536c6a24ef9509f362c84"
action.locate = true
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
LocateLocalRaidPhysicalDriveAction.Result res = action.call()

QueryLocalRaidController

API Request

URLs
GET zstack/v1/storage-devices/local-raid/controllers
GET zstack/v1/storage-devices/local-raid/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/local-raid/controllers
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/local-raid/controllers/9f234d08bfa13c6a83bd8df8e551820c

Queryable Fields

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

API Response

Response Example
{
  "inventories": [
    {
      "uuid": "ba2fe0dcd360397a92748ea6efe9ffd6",
      "name": "raidPhysical",
      "raidLevel": "raid1",
      "raidControllerUuid": "1022305d664e34329a63f350a2fd1e02",
      "enclosureDeviceId": 252,
      "slotNumber": 1,
      "diskGroup": 0,
      "wwn": "50014ee059f2f491",
      "serialNumber": "V6GLEX2S",
      "deviceModel": "HGST HUS726T4TALA6L4",
      "size": 1000204886016,
      "driveState": "Online, Spun Up",
      "locateStatus": "Disabled",
      "driveType": "SATA",
      "mediaType": "HDD",
      "rotationRate": 7200,
      "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. 0.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. See error for details 3.6
inventories List See inventories for details 3.6
#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 error description 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 error. 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 UUID of the resource. Uniquely identifies the resource. 3.6
name String Resource name 3.6
raidLevel String Raid level 3.6
raidControllerUuid String Raid Controller Uuid 3.6
description String Resource description 3.6
enclosureDeviceId Integer Enclosure Id 3.6
slotNumber Integer Slot number 3.6
deviceId Integer Device Id 3.6
diskGroup Integer Disk Group Id 3.6
wwn String WWN 3.6
serialNumber String Serial number 3.6
deviceModel String Disk model 3.6
size Long Disk size 3.6
driveState String Disk status 3.6
driveType String Interface type 3.6
mediaType String Media type 3.6
rotationRate Integer Rotation speed 3.6
createDate Timestamp Create time 3.6
lastOpDate Timestamp Last update time 3.6
locateStatus LocateStatus See locateStatus for details 3.6
#locateStatus
Name Type Description Starting Version
Enabled LocateStatus Locator LED blinking 3.6
Disabled LocateStatus Locator LED off 3.6

SDK Examples

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

QueryLocalRaidPhysicalDrive

API Request

URLs
GET zstack/v1/storage-devices/local-raid/physical-drives
GET zstack/v1/storage-devices/local-raid/physical-drives/{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/local-raid/physical-drives
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/local-raid/physical-drives/75dae76e484537bbaea154d9348f4e15

Queryable Fields

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

API Response

Response Example
{
  "inventories": [
    {
      "uuid": "ba2fe0dcd360397a92748ea6efe9ffd6",
      "name": "raidPhysical",
      "raidLevel": "raid1",
      "raidControllerUuid": "1022305d664e34329a63f350a2fd1e02",
      "enclosureDeviceId": 252,
      "slotNumber": 1,
      "diskGroup": 0,
      "wwn": "50014ee059f2f491",
      "serialNumber": "V6GLEX2S",
      "deviceModel": "HGST HUS726T4TALA6L4",
      "size": 1000204886016,
      "driveState": "Online, Spun Up",
      "locateStatus": "Disabled",
      "driveType": "SATA",
      "mediaType": "HDD",
      "rotationRate": 7200,
      "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. 0.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. See error for details 3.6
inventories List See inventories for details 3.6
#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 error description 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 error. 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 UUID of the resource. Uniquely identifies the resource. 3.6
name String Resource name 3.6
raidLevel String Raid level 3.6
raidControllerUuid String Raid Controller Uuid 3.6
description String Resource description 3.6
enclosureDeviceId Integer Enclosure Id 3.6
slotNumber Integer Slot number 3.6
deviceId Integer Device Id 3.6
diskGroup Integer Disk Group Id 3.6
wwn String WWN 3.6
serialNumber String Serial number 3.6
deviceModel String Disk model 3.6
size Long Disk size 3.6
driveState String Disk status 3.6
driveType String Interface type 3.6
mediaType String Media type 3.6
rotationRate Integer Rotation speed 3.6
createDate Timestamp Create time 3.6
lastOpDate Timestamp Last update time 3.6
locateStatus LocateStatus See locateStatus for details 3.6
#locateStatus
Name Type Description Starting Version
Enabled LocateStatus Locator LED blinking 3.6
Disabled LocateStatus Locator LED off 3.6

SDK Examples

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

QueryPhysicalDriveSelfTestHistory

API Request

URLs
GET zstack/v1/storage-devices/local-raid/physical-drives/self-test
GET zstack/v1/storage-devices/local-raid/physical-drives/{raidPhysicalDriveUuid}/self-test
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/local-raid/physical-drives/self-test
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/local-raid/physical-drives/{raidPhysicalDriveUuid}/self-test

Queryable Fields

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

API Response

Response Example
{
  "inventories": [
    {
      "id": 1,
      "raidPhysicalDriveUuid": "18862cfe4f383f1c8f4e6e64e8de9f4c",
      "runningState": "Success",
      "testResult": "Completed without error",
      "createDate": "Nov 14, 2017 2:20:57 PM",
      "lastOpDate": "Nov 14, 2017 2:20:57 PM"
    },
    {
      "id": 2,
      "raidPhysicalDriveUuid": "adbdac3931c03ab0a1ff769558816563",
      "runningState": "Success",
      "testResult": "Completed without error",
      "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. 0.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. See error for details 3.6
inventories List See inventories for details 3.6
#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 error description 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 error. 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
id Long Id 3.6
raidPhysicalDriveUuid String Raid Physical Drive Uuid 3.6
testResult String Self-test result 3.6
createDate Timestamp Create time 3.6
lastOpDate Timestamp Last update time 3.6
runningState RunningState See runningState for details 3.6
#runningState
Name Type Description Starting Version
Running RunningState In progress 3.6
Success RunningState Completed successfully 3.6
Failed RunningState Execution failed 3.6

SDK Examples

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

RefreshLocalRaid

API Request

URLs
PUT zstack/v1/storage-devices/local-raid/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "refreshLocalRaid": {
    "hostUuid": "36e5bbc506d632a5ac8e474e6d3b0caf"
  },
  "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 '{"refreshLocalRaid":{"hostUuid":"36e5bbc506d632a5ac8e474e6d3b0caf"}}' \
http://localhost:8080/zstack/v1/storage-devices/local-raid/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
hostUuid String body(contained in the refreshLocalRaid structure) Host UUID 3.6
systemTags (Optional) List body Optional. The system tags. 3.6
userTags (Optional) List body Optional. The user tags. 3.6

API Response

Response Example
{
  "inventories": [
    {
      "name": "LSI 2208 Raid Controller",
      "uuid": "821bab441f4530b5a741bbed9ca76eb8",
      "description": "this is a description",
      "productName": "LSI 2208 MegaRAID",
      "sasAddress": "500304801f948100",
      "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. 0.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. See error for details 3.6
inventories List See inventories for details 3.6
#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 error description 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 error. 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
name String Resource name 3.6
uuid String UUID of the resource. Uniquely identifies the resource. 3.6
description String Resource description 3.6
productName String Product name 3.6
sasAddress String SAS address 3.6
hostUuid String Host UUID 3.6
createDate Timestamp Create time 3.6
lastOpDate Timestamp Last update time 3.6
adapterNumber Integer Raid card number 3.6
raidPhysicalDrives List See raidPhysicalDrives for details 3.6
#raidPhysicalDrives
Name Type Description Starting Version
uuid String UUID of the resource. Uniquely identifies the resource. 3.6
name String Resource name 3.6
raidLevel String Raid level 3.6
raidControllerUuid String Raid Controller Uuid 3.6
description String Resource description 3.6
enclosureDeviceId Integer Enclosure Id 3.6
slotNumber Integer Slot number 3.6
deviceId Integer Device Id 3.6
diskGroup Integer Disk Group Id 3.6
wwn String WWN 3.6
serialNumber String Serial number 3.6
deviceModel String Disk model 3.6
size Long Disk size 3.6
driveState String Disk status 3.6
driveType String Interface type 3.6
mediaType String Media type 3.6
rotationRate Integer Rotation speed 3.6
createDate Timestamp Create time 3.6
lastOpDate Timestamp Last update time 3.6
locateStatus LocateStatus See locateStatus for details 3.6
#locateStatus
Name Type Description Starting Version
Enabled LocateStatus Locator LED blinking 3.6
Disabled LocateStatus Locator LED off 3.6

SDK Examples

Java SDK
RefreshLocalRaidAction action = new RefreshLocalRaidAction();
action.hostUuid = "36e5bbc506d632a5ac8e474e6d3b0caf";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RefreshLocalRaidAction.Result res = action.call();
Python SDK
RefreshLocalRaidAction action = RefreshLocalRaidAction()
action.hostUuid = "36e5bbc506d632a5ac8e474e6d3b0caf"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RefreshLocalRaidAction.Result res = action.call()

SelfTestLocalRaid

API Request

URLs
PUT zstack/v1/storage-devices/local-raid/physical-drives/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "selfTestLocalRaid": {},
  "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 '{"selfTestLocalRaid":{}}' \
http://localhost:8080/zstack/v1/storage-devices/local-raid/physical-drives/e99fe11fc50f342a8d3d14503f503486/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url UUID of the resource. Uniquely identifies the resource. 3.6
systemTags (Optional) List body Optional. The system tags. 3.6
userTags (Optional) List body Optional. The user tags. 3.6

API Response

On success, this API returns an empty JSON structure {}. On error, 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
SelfTestLocalRaidAction action = new SelfTestLocalRaidAction();
action.uuid = "e99fe11fc50f342a8d3d14503f503486";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SelfTestLocalRaidAction.Result res = action.call();
Python SDK
SelfTestLocalRaidAction action = SelfTestLocalRaidAction()
action.uuid = "e99fe11fc50f342a8d3d14503f503486"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SelfTestLocalRaidAction.Result res = action.call()
API Reference | ZStack ZSphere · ZVF | ZStack Resource Center