Reboot Bare Metal Instance

PUT/zstack/v1/baremetal/instances/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "rebootBaremetalInstance": {
    "pxeBoot": false
  },
  "systemTags": [],
  "userTags": []
}

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

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"rebootBaremetalInstance":{"pxeBoot":false}}' \
http://localhost:8080/zstack/v1/baremetal/instances/c3be8e4c6f783f0c9aecd9600b2c3768/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlUUID of the resource, uniquely identifying the resource 2.6.0
systemTags (Optional)ListbodySystem Tag 2.6.0
userTags (Optional)ListbodyUser Tag 2.6.0
pxeBoot (Optional)Booleanbody(included in the rebootBaremetalInstance structure)Whether to boot via network PXE 2.6.0

API Response

Response Example

{
  "inventory": {
    "uuid": "227ea410fadd38668fb7dd5679d3f095",
    "name": "BM-1",
    "description": "This is a baremetal instance.",
    "zoneUuid": "946022bde3053bf29c7cbbf466241c7f",
    "clusterUuid": "a7b427907a883ae2acf0a6d408eae0e5",
    "chassisUuid": "0746a3cc213a345d89d31bfd82b00e12",
    "imageUuid": "828c0bc2e8f132bc924ed0a616860e66",
    "platform": "Linux",
    "state": "Rebooting",
    "status": "Provisioned",
    "createDate": "Nov 14, 2017 2:20:57 PM",
    "lastOpDate": "Nov 14, 2017 2:20:57 PM",
    "bmNics": [
      {
        "uuid": "fe99549e3f4f3683b4fb37f623de9115",
        "baremetalInstanceUuid": "227ea410fadd38668fb7dd5679d3f095",
        "l3NetworkUuid": "99f6eb7273e936f3ad638ba00b474a4b",
        "mac": "6c:b3:11:1b:0b:1e",
        "ip": "192.168.0.10",
        "netmask": "255.255.255.0",
        "gateway": "192.168.0.1",
        "pxe": false
      }
    ]
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error2.6.0
inventoryBaremetalInstanceInventoryFor details, see inventory2.6.0

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier of the error, for example SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, default is null0.6
opaqueLinkedHashMapReserved field, default is null0.6
causeErrorCodeRoot cause: the source error that triggered the current error. If there is no original error, this field is null0.6

inventory

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource2.6.0
nameStringResource name2.6.0
descriptionStringDetailed description of the resource2.6.0
zoneUuidStringData Center UUID2.6.0
clusterUuidStringCluster UUID2.6.0
pxeServerUuidString 3.1.1
chassisUuidStringBare metal chassis UUID2.6.0
imageUuidStringImage UUID2.6.0
platformStringSystem platform2.6.0
stateString 2.6.0
statusString 2.6.0
createDateTimestampCreate time2.6.0
lastOpDateTimestampLast modification time2.6.0
bmNicsListFor details, see bmNics2.6.0

bmNics

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource2.6.0
baremetalInstanceUuidStringBare metal instance UUID2.6.0
l3NetworkUuidStringDistributed Port Group UUID2.6.0
baremetalBondingUuidStringBOND UUID3.4.0
macStringNetwork card MAC address2.6.0
ipStringIP address2.6.0
netmaskStringSubnet mask2.6.0
gatewayStringGateway2.6.0
metadataString 2.6.0
pxeBooleanWhether this is a PXE boot NIC2.6.0
createDateTimestampCreate time2.6.0
lastOpDateTimestampLast modification time2.6.0

SDK Examples

Java SDK

RebootBaremetalInstanceAction action = new RebootBaremetalInstanceAction();
action.uuid = "c3be8e4c6f783f0c9aecd9600b2c3768";
action.pxeBoot = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RebootBaremetalInstanceAction.Result res = action.call();

Python SDK

action = RebootBaremetalInstanceAction()
action.uuid = "c3be8e4c6f783f0c9aecd9600b2c3768"
action.pxeBoot = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()