QueryBareMetal2Instance

API Request

URLs
GET zstack/v1/baremetal2/bm-instances
GET zstack/v1/baremetal2/bm-instances/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal2/bm-instances?q=uuid=36cd7d9df10737999a92f9ce1395842d
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal2/bm-instances/8c77fa2039993ac9ac02ddcc5fc67fcd

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryBareMetal2Instance, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "chassisUuid": "463018b125d742e8acb3d6a5412eb674",
      "lastChassisUuid": "5facc3e540e3464daef9dc123aae9f2b",
      "gatewayUuid": "2cdd33f2d2f14b599965b2b351c77c10",
      "lastGatewayUuid": "e96b15632b2d4975ae4252a8d33b3904",
      "chassisOfferingUuid": "db5d18b6551e4af492bda6cef97045e3",
      "status": "Connected",
      "uuid": "f6898853cff24b2a85c388f4c676d1a7",
      "name": "BM-1",
      "description": "This is a BareMetal2 Instance.",
      "zoneUuid": "8f741ad043a54c98a9729c3871cfc985",
      "clusterUuid": "1bf322359f0e41668a67e119fc2184d1",
      "imageUuid": "17ddfe24cce247f2a27a13ad78b1536a",
      "rootVolumeUuid": "e1551175153c4d4f89edfccf85e15fbe",
      "platform": "Linux",
      "type": "baremetal2",
      "memorySize": 8.589934592E9,
      "cpuNum": 8.0,
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM",
      "state": "Running"
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error 4.0.0
inventories List See inventories 4.0.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.0.0
description String The brief description of the error. 4.0.0
details String The details about the error. 4.0.0
elaboration String The reserved field. Default value: null. 4.0.0
opaque LinkedHashMap The reserved field. Default value: null. 4.0.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.0.0
#inventories
Name Type Description Starting Version
chassisUuid String The UUID of the bare metal chassis. 4.0.0
lastChassisUuid String The UUID of the bare metal chassis where the instance last resides. 4.0.0
gatewayUuid String The gateway UUID. 4.0.0
lastGatewayUuid String The UUID of the last gateway. 4.0.0
chassisOfferingUuid String The chassis offering UUID. 4.0.0
gatewayAllocatorStrategy String The gateway allocation policy. 4.0.0
status String The connection status of the elastic baremetal instance. 4.0.0
uuid String The UUID of the elastic baremetal instance. 4.0.0
name String The elastic baremetal instance name. 4.0.0
description String The detailed description of the elastic baremetal instance. 4.0.0
zoneUuid String The zone UUID. 4.0.0
clusterUuid String The cluster UUID. 4.0.0
imageUuid String The image UUID. 4.0.0
rootVolumeUuid String The root volume UUID 4.0.0
platform String The platform type. 4.0.0
defaultL3NetworkUuid String The UUID of the default L3 network. 4.0.0
type String The type of the elastic baremetal instance. 4.0.0
hypervisorType String The virtualization type. 4.0.0
memorySize Long The memory size. 4.0.0
cpuNum Integer The number of CPU cores. 4.0.0
cpuSpeed Long The processing speed of the CPU. 4.0.0
createDate Timestamp The time when the elastic baremetal instance was created. 4.0.0
lastOpDate Timestamp The time when the elastic baremetal instance was last modified. 4.0.0
state String The state of the elastic baremetal instance. 4.0.0
provisionNic BareMetal2InstanceProvisionNicInventory See provisionNic 4.0.0
vmNics List See vmNics 4.0.0
allVolumes List See allVolumes 4.0.0
#provisionNic
Name Type Description Starting Version
uuid String The UUID of the NIC that connects to the deployment network. 4.0.0
networkUuid String The deployment network UUID. 4.0.0
interfaceName String The name of the NIC. 4.0.0
ip String The IP address of the NIC. 4.0.0
netmask String The netmask of the NIC. 4.0.0
gateway String The gateway IP address. 4.0.0
metadata String 4.0.0
createDate Timestamp The time when the NIC was created. 4.0.0
lastOpDate Timestamp The time when the NIC was last modified. 4.0.0
#vmNics
Name Type Description Starting Version
uuid String The UUID of the NIC of the elastic baremetal instance. 4.0.0
vmInstanceUuid String The UUID of the elastic baremetal instance. 4.0.0
l3NetworkUuid String The L3 network UUID. 4.0.0
ip String The IP address of the NIC. 4.0.0
mac String The MAC address of the NIC. 4.0.0
hypervisorType String The virtualization type. 4.0.0
netmask String The netmask of the NIC. 4.0.0
gateway String The gateway IP address. 4.0.0
metaData String 4.0.0
ipVersion Integer The version of the IP address. 4.0.0
deviceId Integer The device ID. 4.0.0
type String The NIC type. 4.0.0
createDate Timestamp The time when the NIC was created. 4.0.0
lastOpDate Timestamp The time when the NIC was last modified. 4.0.0
usedIps List See usedIps 4.0.0
#usedIps
Name Type Description Starting Version
uuid String The UUID of the IP address. 4.0.0
ipRangeUuid String The IP range UUID. 4.0.0
l3NetworkUuid String The L3 network UUID. 4.0.0
ipVersion Integer The IP version. 4.0.0
ip String The IP address. 4.0.0
netmask String The netmask of the IP address. 4.0.0
gateway String The gateway IP address. 4.0.0
usedFor String 4.0.0
ipInLong long 4.0.0
vmNicUuid String The NIC UUID. 4.0.0
createDate Timestamp The time when the IP address was created. 4.0.0
lastOpDate Timestamp The time when the IP address was last modified. 4.0.0
#allVolumes
Name Type Description Starting Version
uuid String The volume UUID. 4.0.0
name String The volume name. 4.0.0
description String The detailed description of the volume. 4.0.0
primaryStorageUuid String The primary storage UUID. 4.0.0
vmInstanceUuid String The elastic baremetal instance UUID. 4.0.0
diskOfferingUuid String The volume offering UUID. 4.0.0
rootImageUuid String The root image UUID. 4.0.0
installPath String The installation path of the volume in the primary storage. 4.0.0
type String The type of the volume. 4.0.0
format String The format of the volume. 4.0.0
size Long The size of the volume. 4.0.0
actualSize Long The actual storage space that the volume takes up. 4.0.0
deviceId Integer 4.0.0
state String The state of the volume. 4.0.0
status String The status of the volume. 4.0.0
createDate Timestamp The time when the volume was created. 4.0.0
lastOpDate Timestamp The time when the volume was last modified. 4.0.0
isShareable Boolean Indicates whether the volume is shareable. 4.0.0
volumeQos String The QoS of the volume, for example, 1048576. 4.0.0

SDK Sample

Java SDK
QueryBareMetal2GatewayAction action = new QueryBareMetal2GatewayAction();
action.conditions = asList("uuid=089cc9f73e31367c8d3db89f736957b2");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryBareMetal2GatewayAction.Result res = action.call();
Python SDK
QueryBareMetal2GatewayAction action = QueryBareMetal2GatewayAction()
action.conditions = ["uuid=88779d1fce2138c28744a2ed1265df1d"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryBareMetal2GatewayAction.Result res = action.call()