Change Data Center Availability State

PUT/zstack/v1/zones/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "changeZoneState": {
    "stateEvent": "enable"
  },
  "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 '{"changeZoneState":{"stateEvent":"enable"}}' \
http://localhost:8080/zstack/v1/zones/af28b8e014ba35619ab68739fe72c2a3/actions

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

uuid

String

url

Resource UUID, uniquely identifies the resource

 

0.6

stateEvent

String

body (contained in changeZoneState structure)

State trigger event

  • enable
  • disable

0.6

systemTags (optional)

List

body

System tag

 

0.6

userTags (optional)

List

body

User tag

 

0.6

API Response

Response Example

{
  "inventory": {
    "uuid": "5ea6fdd8a3a24fa2b17b1b89ad29da6b",
    "name": "TestZone",
    "description": "Test",
    "state": "Enabled",
    "type": "zstack",
    "createDate": "Jun 7, 2017 9:21:08 PM",
    "lastOpDate": "Jun 7, 2017 9:21:08 PM"
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. If null, the operation succeeded. See details error0.6
inventoryZoneInventorySee details inventory0.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

inventory

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource0.6
nameStringResource name0.6
descriptionStringResource description0.6
stateString 0.6
typeString 0.6
createDateTimestampCreation time0.6
lastOpDateTimestampLast modification time0.6

SDK Examples

Java SDK

ChangeZoneStateAction action = new ChangeZoneStateAction();
action.uuid = "61defcb978894aec8839a099bd0eb1a2";
action.stateEvent = "enable";
action.sessionId = "166c291cd367487c9032f4f23531863c";
ChangeZoneStateAction.Result res = action.call();

Python SDK

ChangeZoneStateAction action = ChangeZoneStateAction()
action.uuid = "8feaadcae6f847a7b7fe707d150b7fef"
action.stateEvent = "enable"
action.sessionId = "b6988f47cb2e4a13abe7b2116d3a2a78"
ChangeZoneStateAction.Result res = action.call()