Upgrade Host Operating System in Cluster

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

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateClusterOS": {
    "excludePackages": [
      "kernel",
      "systemd*"
    ],
    "updatePackages": [
      "zstack-release"
    ],
    "releaseVersion": "c74"
  },
  "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 '{"updateClusterOS":{"excludePackages":["kernel","systemd*"],"updatePackages":["zstack-release"],"releaseVersion":"c74"}}' http://localhost:8080/zstack/v1/clusters/31c4951f39ae38969802e833448369ae/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlResource UUID, uniquely identifies the resource 2.3
excludePackages (optional)Listbody (contained in updateClusterOS structure)List of packages not to upgrade 3.7.0
updatePackages (optional)Listbody (contained in updateClusterOS structure)List of packages to upgrade 3.7.0
releaseVersion (optional)Stringbody (contained in updateClusterOS structure)Version of the repository for upgrade 3.7.0
resourceUuid (optional)Stringbody (contained in updateClusterOS structure)  3.7.0
tagUuids (optional)Listbody (contained in updateClusterOS structure)Tag UUID list 3.7.0
systemTags (optional)ListbodySystem tag 2.3
userTags (optional)ListbodyUser tag 2.3

API Response

Response Example

{
  "inventory": {
    "uuid": "932696598b64375ea4ae6226cc0c1407"
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. If null, the operation succeeded. See details error2.3
inventoryLongJobInventorySee details inventory2.2

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 resource2.2.4
nameStringResource name2.2.4
descriptionStringResource description2.2.4
apiIdStringAPI ID used to associate TaskProgress2.2.4
jobNameStringJob name2.2.4
jobDataStringJob data2.2.4
jobResultStringJob result2.2.4
targetResourceUuidStringTarget resource UUID2.2.4
managementNodeUuidStringManagement Node UUID2.2.4
createDateTimestampCreation time2.2.4
lastOpDateTimestampLast modification time2.2.4
executeTimeLong 3.7.0
stateLongJobStateSee details state2.2.4

state

NameTypeDescriptionStarting Version
WaitingLongJobState 3.7.0
SuspendedLongJobState 3.7.0
RunningLongJobState 3.7.0
SucceededLongJobState 3.7.0
CancelingLongJobState 3.7.0
CanceledLongJobState 3.7.0
FailedLongJobState 3.7.0

SDK Examples

Java SDK

UpdateClusterOSAction action = new UpdateClusterOSAction();
action.uuid = "31c4951f39ae38969802e833448369ae";
action.excludePackages = asList("kernel","systemd*");
action.updatePackages = asList("zstack-release");
action.releaseVersion = "c74";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateClusterOSAction.Result res = action.call();

Python SDK

UpdateClusterOSAction action = UpdateClusterOSAction()
action.uuid = "31c4951f39ae38969802e833448369ae"
action.excludePackages = [kernel, systemd*]
action.updatePackages = [zstack-release]
action.releaseVersion = "c74"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateClusterOSAction.Result res = action.call()