Modifies a scheduled task.
Description
You can use the following parameters to specify the scaling method of a scheduled task:
- If you use the
ScheduledAction
parameter, you must select an existing scaling rule for the scheduled task. - If you use the
ScalingGroupId
parameter, you must specify at least one of the minimum number, maximum number, and expected number of instances in the scheduled task for a scaling group.
ScheduledAction
and ScalingGroupId
parameters at the same time.
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 must be 2 to 64 characters in length and can contain letters, digits, underscores (_), hyphens (-), and periods (.). The name must start with a letter or a digit. The name of the scheduled task must be unique in the region and within the Alibaba Cloud account. |
Description | String | No | Test scheduled task. |
The description of the scheduled task. The description must be 2 to 200 characters in length. |
ScheduledAction | String | No | ari:acs:ess:cn-hangzhou:14069264****:scalingrule/asr-bp12tcnol686y1ik**** |
The scaling rule that you want to execute when the scheduled task is triggered. Specify
the unique identifier of the scaling rule. If you specify the Note You cannot specify the
ScheduledAction and ScalingGroupId parameters at the same time.
|
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 enter a time point later than 365 days from the scheduled task modification. |
LaunchTime | String | No | 2014-08-18T10:52Z |
The point in time at which the scheduled task was triggered. Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mmZ format. The time must be in UTC. You cannot enter a time point later than 90 days from the scheduled task modification.
|
RecurrenceType | String | No | Daily |
The interval at which the scheduled task is repeatedly executed. Valid values:
After you modify the scheduled task, the values that you specify for the |
RecurrenceValue | String | No | 2 |
The number of recurrences of the scheduled task.
After you modify the scheduled task, the values that you specify for the |
TaskEnabled | Boolean | No | true |
Specifies whether to enable the scheduled task. Valid values:
Default value: true. |
LaunchExpirationTime | Integer | No | 600 |
The time period during which the failed scheduled task can be retried. Unit: seconds. Valid values: 0 to 1800. Default value: 600. |
MinValue | Integer | No | 0 |
The minimum number of instances in the scaling group if you specify the ScalingGroupId parameter. |
MaxValue | Integer | No | 10 |
The maximum number of instances in the scaling group if you specify the ScalingGroupId parameter. |
DesiredCapacity | Integer | No | 10 |
The expected number of instances in the scaling group if you specify the ScalingGroupId parameter. Note You must specify the
DesiredCapacity parameter when you create the scaling group.
|
ScalingGroupId | String | No | asg-bp18p2yfxow2dloq**** |
The ID of the scaling group whose number of instances is changed when the scheduled
task is triggered. If you specify the Note You cannot specify the
ScheduledAction and ScalingGroupId parameters at the same time.
|
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 ID of the request. |
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, visit the API Error Center.
HTTP status code |
Error code |
Error message |
Description |
---|---|---|---|
404 |
InvalidScheduledTaskId.NotFound |
The specified scheduled task does not exist. |
The error message returned because the specified scheduled task does not exist within the Alibaba Cloud account. |
400 |
InvalidScheduledTaskName.Duplicate |
The specified value of parameter ScheduledTaskName is duplicated. |
The error message returned because the specified name of the scheduled task already exists. |
400 |
ScheduledAction.RegionMismatch |
The specified scheduled task and the specified scheduled action are not in the same Region. |
The error message returned because the specified scaling rule and the specified scheduled task do not reside in the same region. |