Power Off Host

PUT/zstack/v1/hosts/power-off/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "powerOffHost": {
    "adminPassword": "password",
    "hostUuids": [
      "ff0192fa70113da886101145c084bd00"
    ],
    "waitTaskCompleted": false
  },
  "systemTags": [],
  "userTags": []
}

In the above example, systemTags and userTags fields can be omitted. They are listed to indicate that these two 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 '{"powerOffHost":{"adminPassword":"password","hostUuids":["ff0192fa70113da886101145c084bd00"],"waitTaskCompleted":false}}' \
http://localhost:8080/zstack/v1/hosts/power-off/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
adminPasswordStringbody (contained in powerOffHost structure)  0.6
hostUuidsListbody (contained in powerOffHost structure)  0.6
waitTaskCompleted (optional)booleanbody (contained in powerOffHost structure)  0.6
maxWaitTime (optional)Longbody (contained in powerOffHost structure)  0.6
systemTags (optional)ListbodySystem tag 0.6
userTags (optional)ListbodyUser tag 0.6

API Response

Response Example

{
  "results": []
}
NameTypeDescriptionStarting Version
successboolean 0.6
resultsListSee details results0.6
errorErrorCodeError code. If not null, the operation failed. If null, the operation succeeded. See details error0.6

results

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource0.6
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. If null, the operation succeeded. See details error0.6

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier of the error, e.g. 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 error that caused the current error. If there is no original error, this field is null0.6

SDK Examples

Java SDK

PowerOffHostAction action = new PowerOffHostAction();
action.adminPassword = "password";
action.hostUuids = asList("ff0192fa70113da886101145c084bd00");
action.waitTaskCompleted = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
PowerOffHostAction.Result res = action.call();

Python SDK

PowerOffHostAction action = PowerOffHostAction()
action.adminPassword = "password"
action.hostUuids = [ff0192fa70113da886101145c084bd00]
action.waitTaskCompleted = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
PowerOffHostAction.Result res = action.call()