Update Cluster DRS

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

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateClusterDRS": {
    "name": "Test",
    "description": "Test",
    "automationLevel": "Manual",
    "thresholdDuration": 10,
    "state": "Enabled"
  },
  "systemTags": [],
  "userTags": []
}

In the above example, the 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 '{"updateClusterDRS":{"name":"Test","description":"Test","automationLevel":"Manual","thresholdDuration":10,"state":"Enabled"}}' \
http://localhost:8080/zstack/v1/clusters/drs/ff067b9ad438337aa3d5beea6f504f00/actions

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

uuid

String

url

The UUID of the Cluster DRS. Uniquely identifies the resource.

 

4.0.0

name (Optional)

String

body(included in the updateClusterDRS structure)

The resource name

 

4.0.0

description (Optional)

String

body(included in the updateClusterDRS structure)

The detailed description of the resource

 

4.0.0

automationLevel (Optional)

String

body(included in the updateClusterDRS structure)

Whether scheduling is triggered manually or automatically

  • Automatic
  • Manual

4.0.0

thresholds (Optional)

List

body(included in the updateClusterDRS structure)

The threshold criteria

 

4.0.0

thresholdDuration (Optional)

Integer

body(included in the updateClusterDRS structure)

The threshold evaluation duration. The system queries the workload data for the period from the current time back to thresholdDuration, calculates the result, and compares it with the threshold to determine whether the Cluster requires scheduling.

 

4.0.0

state (Optional)

String

body(included in the updateClusterDRS structure)

The enabled state of the Cluster DRS

  • Enabled
  • Disabled

4.0.0

systemTags (Optional)

List

body

System tags

 

4.0.0

userTags (Optional)

List

body

User tags

 

4.0.0

API Response

On success, this API returns an empty JSON structure {}. On failure, the returned JSON structure contains an error field, for example:

{
  "error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
  }
}

SDK Examples

Java SDK

UpdateClusterDRSAction action = new UpdateClusterDRSAction();
action.uuid = "ff067b9ad438337aa3d5beea6f504f00";
action.name = "Test";
action.description = "Test";
action.automationLevel = "Manual";
action.thresholdDuration = 10;
action.state = "Enabled";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateClusterDRSAction.Result res = action.call();

Python SDK

UpdateClusterDRSAction action = UpdateClusterDRSAction()
action.uuid = "ff067b9ad438337aa3d5beea6f504f00"
action.name = "Test"
action.description = "Test"
action.automationLevel = "Manual"
action.thresholdDuration = 10
action.state = "Enabled"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateClusterDRSAction.Result res = action.call()