Modifies a scheduled task. If an existing scheduled task cannot meet your business requirements anymore, you can call the ModifyScheduledTask operation to modify the task attributes such as the scaling rule to execute, the recurrence of the scheduled task, and the retry policy, without the need to create a new task.
Usage notes
Scheduled tasks support the following scaling methods:
ScheduledAction
: Specify an existing scaling rule that you want Auto Scaling to execute when the scheduled task is triggered.ScalingGroupId
: Specify the minimum number, maximum number, or expected number of instances for the scaling group to which the scheduled task belongs.
You cannot specify both ScheduledAction
and ScalingGroupId
.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | ModifyScheduledTask | The operation that you want to perform. Set the value to ModifyScheduledTask. |
ScheduledTaskId | String | Yes | edRtShc57WGXdt8TlPbr**** | The ID of the scheduled task. |
ScheduledTaskName | String | No | scheduled**** | The name of the scheduled task. The name of a scheduled task must be 2 to 64 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter or a digit. The name of each scheduled task must be unique in a region and within an Alibaba Cloud account. |
Description | String | No | Test scheduled task. | The description of the scheduled task. The description can be 1 to 200 characters in length. |
ScheduledAction | String | No | ari:acs:ess:cn-hangzhou:14069264****:scalingrule/asr-bp12tcnol686y1ik**** | The ID of the scaling group that Auto Scaling executes when the scheduled task is triggered. You can obtain the ID of a scaling rule on the scaling rule details page. This parameter is available only if you specify ScheduledAction. Note If you specify |
RecurrenceEndTime | String | No | 2014-08-20T16:55Z | The end time of the scheduled task. Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mmZ format. The time must be in UTC. You cannot specify a point in time that is later than 365 days from the point in time at which the scheduled task is modified. |
LaunchTime | String | No | 2014-08-18T10:52Z | The point in time at which the scheduled task is executed. Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mmZ format. The time must be in UTC. You cannot specify a time point that is later than 90 days from the point in time at which the scheduled task is modified.
|
RecurrenceType | String | No | Daily | The type of the recurring execution cycle of the scheduled task. The scheduled task can be executed by day, week, or month. Valid values:
Make sure that the values that you specify for |
RecurrenceValue | String | No | 2 | The numerical value that corresponds to the recurring execution cycle of the scheduled task.
Make sure that the values that you specify for |
TaskEnabled | Boolean | No | true | Specifies whether the scheduled task is enabled. Valid values:
Default value: true. |
LaunchExpirationTime | Integer | No | 600 | The duration within which Auto Scaling can retry the execution of the scheduled task in case of failures. Unit: seconds. Valid values: 0 to 1800. Default value: 600. |
MinValue | Integer | No | 0 | The minimum number of instances that must be maintained in the scaling group. This parameter is available only if you specify ScalingGroupId. |
MaxValue | Integer | No | 10 | The maximum number of instances that can be contained in the scaling group. This parameter is available only if you specify ScalingGroupId. |
DesiredCapacity | Integer | No | 10 | The expected number of instances in the scaling group. This parameter is available only if you specify ScalingGroupId. Note This parameter takes effect only if you specify |
ScalingGroupId | String | No | asg-bp18p2yfxow2dloq**** | The ID of the scaling group whose scheduled task that you want to modify. If you specify Note If you specify |
RegionId | String | No | cn-hangzhou | The region ID of the scaling group. |
Response parameters
Parameter | Type | Example | Description |
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** | The request ID. |
Examples
Sample requests
http(s)://ess.aliyuncs.com/?Action=ModifyScheduledTask
&ScheduledTaskId=edRtShc57WGXdt8TlPbr****
&ScheduledTaskName=scheduled****
&Description=Test scheduled task.
&ScheduledAction=ari:acs:ess:cn-hangzhou:14069264****:scalingrule/asr-bp12tcnol686y1ik****
&RecurrenceEndTime=2014-08-20T16:55Z
&LaunchTime=2014-08-18T10:52Z
&RecurrenceType=Daily
&RecurrenceValue=2
&TaskEnabled=true
&LaunchExpirationTime=600
&MinValue=0
&MaxValue=10
&DesiredCapacity=10
&ScalingGroupId=asg-bp18p2yfxow2dloq****
&RegionId=cn-hangzhou
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ModifyScheduledTaskResponse>
<RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3****</RequestId>
</ModifyScheduledTaskResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}
Error codes
For a list of error codes, see Service error codes.
HTTP status code | Error code | Error message | Description |
404 | InvalidScheduledTaskId.NotFound | The specified scheduled task does not exist. | The specified scheduled task does not exist within the Alibaba Cloud account. |
400 | InvalidScheduledTaskName.Duplicate | The specified value of parameter
is duplicated. | A scheduled task with the given name already exists. |
400 | ScheduledAction.RegionMismatch | The specified scheduled task and the specified scheduled action are not in the same Region. | The specified scaling rule and the specified scheduled task are located in different regions. |