Update Cluster

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

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateCluster": {
    "name": "cluster1",
    "description": "test"
  },
  "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 '{"updateCluster":{"name":"cluster1","description":"test"}}' \
http://localhost:8080/zstack/v1/clusters/851a3783e1503de2a1b9222014c843c4/actions

Parameter List

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

API Response

Response Example

{
  "inventory": {
    "name": "cluster1",
    "uuid": "9dd0fbecb0e04260ad161c66d1da9f96",
    "description": "test",
    "state": "Enabled",
    "hypervisorType": "KVM",
    "createDate": "Jun 7, 2017 9:20:29 PM",
    "lastOpDate": "Jun 7, 2017 9:20:29 PM",
    "zoneUuid": "25b7ddce968f4cbbb58aa5a205e116ee",
    "type": "zstack"
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. If null, the operation succeeded. See details error0.6
inventoryClusterInventorySee 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
nameStringResource name0.6
uuidStringResource UUID, uniquely identifies the resource0.6
descriptionStringResource description0.6
stateStringCluster state0.6
hypervisorTypeStringHypervisor type0.6
createDateTimestampCreation time0.6
lastOpDateTimestampLast modification time0.6
zoneUuidStringData Center UUID0.6
typeStringReserved field0.6

SDK Examples

Java SDK

UpdateClusterAction action = new UpdateClusterAction();
action.uuid = "ce185b26a4f14153941a868435d94498";
action.name = "cluster1";
action.description = "test";
action.sessionId = "5abfadbc97d64b4687ba6281de117d2d";
UpdateClusterAction.Result res = action.call();

Python SDK

UpdateClusterAction action = UpdateClusterAction()
action.uuid = "a643ba1b98524c60acced530ce2ded1b"
action.name = "cluster1"
action.description = "test"
action.sessionId = "cc779e5d5344493d9bd1cb1ced887321"
UpdateClusterAction.Result res = action.call()