Modifying an Upgrade Task
Function
Modifies the configuration of an upgrade task.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
workspace:upgradeTask:update
Write
-
-
-
-
URI
PUT /v2/{project_id}/upgrade-task/{task_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. |
| task_id | Yes | String | Task ID. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| task_name | No | String | Task name. |
| scheduled_type | No | String | Execution period type. The value can be FIXED_TIME (specified time), DAY (by day), WEEK (by week), or MONTH (by month). |
| timezone | No | String | Time zone. |
| week_list | No | String | If the period is by week, the value ranges from 1 to 7. Multiple values are separated by commas (,), for example, 1,2,7. |
| month_list | No | String | If the period is by month, the value ranges from 1 to 12, separated by commas (,). |
| date_list | No | String | If the period is by month, the value ranges from 1 to 31 and can be L (indicating the last day of the current month). |
| day_interval | No | Integer | Number of days to skip. |
| scheduled_date | No | String | If the period is by specified time, the value indicates the specified date. |
| scheduled_time | No | String | Specified execution time. |
| is_force_execute | No | Integer | Whether to forcibly upgrade the version. The value can be 0 (no) or 1 (yes). |
| min_version | No | String | Upgrade is required if the version is earlier than this version. |
| target_version | No | String | Target version. |
| expire_enable | No | Integer | Whether to enable the expiration time. The value can be 0 (no) or 1 (yes). |
| expire_time | No | String | Expiration time. |
| is_notify | No | Integer | Whether to send a notification. The value can be 0 (no) or 1 (yes). |
| extra_params | No | String | Extended parameter (in JSON format). |
| execute_strategy | No | Integer | Execution policy. The value can be 0 (full delivery) or 1 (grayscale delivery). |
| grayscale_rule | No | Integer | Grayscale rule. The value can be 0 (determined) or 1 (random). This parameter is used when execute_strategy is set to 1. |
| random_first_batch_count | No | Integer | Random number for the first batch execution. |
| gray_object_ids | No | String | Grayscale object ID list (in JSON array format). |
| gray_fail_threshold | No | Integer | First-batch execution failure threshold. |
| scheduled_end_time | No | String | End time of the time window. |
| description | No | String | Task description. |
| is_enable | No | Integer | Enabling status. The value can be 0 (disabled) or 1 (enabled). |
| apply_objects | No | Array of TaskApplyObjectInfo objects | Application object list. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| object_type | Yes | String | Application object type. The value can be DESKTOP (single desktop), ALL_DESKTOPS (all desktops), DESKTOP_POOL (desktop pool), DESKTOP_TAG (desktop tag), ALL_USERS (all users), USER (single user), USER_GROUP (user group), ALL_IMAGES (all images), APPLICATION_SERVER (application server), or APPLICATION_SERVER_GROUP (application server group). |
| object_id | No | String | Object ID. The value can be null when object_type is set to ALL_DESKTOPS, ALL_USERS, or ALL_IMAGES. |
Response Parameters
Status code: 200
ok
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Service error code. |
| error_msg | String | Service error message. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Service error code. |
| error_msg | String | Service error message. |
Example Requests
{
"task_name" : "Daily Desktop Upgrade Task",
"scheduled_type" : "DAY",
"timezone" : "Asia/Shanghai",
"scheduled_time" : "02:00",
"is_force_execute" : 1,
"min_version" : "23.0.0",
"target_version" : "24.6.3",
"expire_enable" : 1,
"expire_time" : "2026-12-31 23:59:59",
"is_notify" : 1,
"execute_strategy" : 0,
"scheduled_end_time" : "12:00:00",
"is_enable" : 1,
"description" : "Desktop upgrade is performed at 02:00 every day.",
"apply_objects" : [ {
"object_type" : "ALL_DESKTOPS",
"object_id" : null
} ]
} Example Responses
None
Status Codes
| Status Code | Description |
|---|---|
| 200 | ok |
| 400 | Invalid request parameter. |
| 500 | Internal server error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot