Change Data Center Availability State
Headers
Authorization: OAuth the-session-uuidBody
{
"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/actionsParameter 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 |
| 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"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | Error code. If not null, the operation failed. If null, the operation succeeded. See details error | 0.6 |
| inventory | ZoneInventory | See details inventory | 0.6 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier of the error, e.g. SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field, default is null | 0.6 |
| opaque | LinkedHashMap | Reserved field, default is null | 0.6 |
| cause | ErrorCode | Root cause, the error that caused the current error. If there is no original error, this field is null | 0.6 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, uniquely identifies the resource | 0.6 |
| name | String | Resource name | 0.6 |
| description | String | Resource description | 0.6 |
| state | String | 0.6 | |
| type | String | 0.6 | |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.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()