Creates a scheduled task.
Operation description
Operation description
If a scheduled task fails to trigger a scaling rule because a scaling activity is in progress in the scaling group or the scaling group is disabled, the scheduled task automatically retries within the period specified by
LaunchExpirationTime. Otherwise, the scheduled task is skipped.- If multiple scheduled tasks trigger scaling rules for the same scaling group within a similar time frame, the details of the triggered scaling activities are as follows:
Scaling groups with the expected number of instances configured: The scaling activities triggered by multiple scheduled tasks are parallel scaling activities. For example, when multiple scheduled tasks are executed within a similar time frame, the scaling group can trigger multiple parallel scaling activities simultaneously.
Scaling groups without the expected number of instances configured: The earliest triggered scheduled task executes the scaling activity first. Because a scaling group can have only one scaling activity at a time, subsequent scheduled tasks automatically retry within the period specified by
LaunchExpirationTime. If the previous scaling activity is completed while a subsequent scheduled task is still retrying within theLaunchExpirationTimeperiod, the scaling rule of that scheduled task is executed and the corresponding scaling activity is triggered.
- Scheduled tasks support the following two scaling methods:
Use the
ScheduledActionparameter to specify the scaling rule to execute.Use the
ScalingGroupIdparameter to specify the number of instances in the scaling group.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ess:CreateScheduledTask |
create |
*ScalingGroup
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The ID of the region where the scheduled task resides. |
cn-qingdao |
| ScheduledTaskName |
string |
No |
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 (.). It must start with a digit, letter, or Chinese character. The name must be unique within the same account in the same region. Default value: the value of |
scheduled**** |
| Description |
string |
No |
The description of the scheduled task. The description must be 2 to 200 characters in length. |
Test scheduled task. |
| ScheduledAction |
string |
No |
The scaling rule to execute when the scheduled task is triggered. Set this parameter to the unique identifier of the scaling rule. If you specify this parameter, the scaling method of the scheduled task is to use an existing scaling rule. Note
You cannot specify both |
ari:acs:ess:cn-hangzhou:140692647****:scalingrule/asr-bp12tcnol686y1ik**** |
| RecurrenceEndTime |
string |
No |
The end time of the recurrence for the scheduled task. Specify the time in the ISO 8601 standard in UTC. Format: |
2014-08-17T16:55Z |
| LaunchTime |
string |
No |
The point in time at which the scheduled task is triggered. Specify the time in the ISO 8601 standard in UTC. Format:
|
2014-08-17T16:52Z |
| RecurrenceType |
string |
No |
The recurrence type of the scheduled task. Valid values:
You must specify both |
Daily |
| RecurrenceValue |
string |
No |
The recurrence value of the scheduled task.
You must specify both |
1 |
| TaskEnabled |
boolean |
No |
Specifies whether to enable the scheduled task. Valid values:
Default value: true. |
true |
| LaunchExpirationTime |
integer |
No |
The time period during which a failed scheduled task is retried. Unit: seconds. Valid values: 0 to 1800. Default value: 600. |
600 |
| MinValue |
integer |
No |
The minimum number of instances in the scaling group when the scaling method of the scheduled task is to set the number of instances in the scaling group. |
0 |
| MaxValue |
integer |
No |
The maximum number of instances in the scaling group when the scaling method of the scheduled task is to set the number of instances in the scaling group. |
10 |
| DesiredCapacity |
integer |
No |
The expected number of instances in the scaling group when the scaling method of the scheduled task is to set the number of instances in the scaling group. Note
The scaling group must have the expected number of instances feature enabled, which means |
10 |
| ScalingGroupId |
string |
No |
The ID of the scaling group whose number of instances is modified when the scheduled task is triggered. If you specify this parameter, the scaling method of the scheduled task is to set the number of instances in the scaling group. You must specify a value for at least one of the following parameters: Note
You cannot specify both |
asg-bp18p2yfxow2dloq**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| ScheduledTaskId |
string |
The ID of the scheduled task. The ID is globally unique and generated by the system. |
edRtShc57WGXdt8TlPbr**** |
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
Examples
Success response
JSON format
{
"ScheduledTaskId": "edRtShc57WGXdt8TlPbr****",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.