Update Data Center

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

Update the name, description, system tags, or user tags of a Data Center.

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateZone": {
    "name": "TestZone2",
    "description": "test second zone"
  },
  "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 '{"updateZone":{"name":"TestZone2","description":"test second zone"}}' \
http://localhost:8080/zstack/v1/zones/3fc9a2d76b043ead90c537561edcb50e/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
name (optional)Stringbody (contained in updateZone structure)Resource name 0.6
description (optional)Stringbody (contained in updateZone structure)Resource description 0.6
uuidStringurlResource UUID, uniquely identifies the resource 0.6
systemTags (optional)ListbodySystem tag 0.6
userTags (optional)ListbodyUser tag 0.6

API Response

Response Example

{
  "inventory": {
    "uuid": "eb5d94d030e84fb286c4f281520b163b",
    "name": "TestZone",
    "description": "Test",
    "state": "Enabled",
    "type": "zstack",
    "createDate": "Jun 7, 2017 9:20:45 PM",
    "lastOpDate": "Jun 7, 2017 9:20:45 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

UpdateZoneAction action = new UpdateZoneAction();
action.name = "TestZone2";
action.description = "test second zone";
action.uuid = "e676dc07cbad45ccb96fd6033ed3c72f";
action.sessionId = "14b97d8a960b4c758389f6b6f5930210";
UpdateZoneAction.Result res = action.call();

Python SDK

UpdateZoneAction action = UpdateZoneAction()
action.name = "TestZone2"
action.description = "test second zone"
action.uuid = "20ab7e6d18134e84ac5322741be661ca"
action.sessionId = "8b46ebd366c54b808c63812ecef9fff0"
UpdateZoneAction.Result res = action.call()