Change Bare Metal Chassis State

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

Headers

Authorization: OAuth the-session-uuid

Body

{
  "changeBaremetalChassisState": {
    "stateEvent": "enable"
  },
  "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 '{"changeBaremetalChassisState":{"stateEvent":"enable"}}' \
http://localhost:8080/zstack/v1/baremetal/chassis/1a600f11b61e3585bbd26d06166ff640/actions

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

uuid

String

url

UUID of the resource, uniquely identifying the resource

 

2.6.0

stateEvent

String

body(included in the changeBaremetalChassisState structure)

State event

  • enable
  • disable

2.6.0

systemTags (Optional)

List

body

System Tag

 

2.6.0

userTags (Optional)

List

body

User Tag

 

2.6.0

API Response

Response Example

{
  "inventory": {
    "uuid": "506008545fa7391cb2586ae7d6180696",
    "ipmiAddress": "1.1.1.1",
    "ipmiPort": 623,
    "ipmiUsername": "root",
    "ipmiPassword": "password",
    "state": "Enabled",
    "status": "Available"
  }
}
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
inventoryBaremetalChassisInventoryFor 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
ipmiAddressStringIPMI address2.6.0
ipmiPortIntegerIPMI port2.6.0
ipmiUsernameStringIPMI username2.6.0
stateString 2.6.0
statusString 2.6.0
createDateTimestampCreate time2.6.0
lastOpDateTimestampLast modification time2.6.0

SDK Examples

Java SDK

ChangeBaremetalChassisStateAction action = new ChangeBaremetalChassisStateAction();
action.uuid = "1a600f11b61e3585bbd26d06166ff640";
action.stateEvent = "enable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeBaremetalChassisStateAction.Result res = action.call();

Python SDK

action = ChangeBaremetalChassisStateAction()
action.uuid = "1a600f11b61e3585bbd26d06166ff640"
action.stateEvent = "enable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()