Update Cluster DRS
Headers
Authorization: OAuth the-session-uuidBody
{
"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/actionsParameter 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 | The resource name |
| 4.0.0 |
description (Optional) | String | body(included in the | The detailed description of the resource |
| 4.0.0 |
automationLevel (Optional) | String | body(included in the | Whether scheduling is triggered manually or automatically |
| 4.0.0 |
thresholds (Optional) | List | body(included in the | The threshold criteria |
| 4.0.0 |
thresholdDuration (Optional) | Integer | body(included in the | 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 | The enabled state of the Cluster DRS |
| 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()