Create a scheduled task

This operation creates a scheduled task according to input parameters.

Description

You can create up to 20 scheduled tasks.

When the trigger of a scheduled task fails because a scaling activity in a scaling group is in progress or the scaling group is disabled, the scheduled task is automatically retried within the LaunchExpirationTime; otherwise, the scheduled trigger task is abandoned.

If multiple tasks are scheduled at similar times to execute the rule of the same group, the earliest task triggers the scaling activity first, and other tasks make attempts to execute the rule within their LaunchExpirationTime because a scaling group executes only one scaling activity at a time. If another scheduled task is still making triggering attempts within its LaunchExpirationTime after the scaling activity is finished, the scaling rule is executed and the corresponding scaling activity is triggered.

Operations performed when the scheduled task is triggered. Fill in the unique identifier of the scaling rule.

LaunchTime

String

Yes

Time point at which the scheduled task is triggered.

The date format follows the ISO8601 standard and uses UTC time. It is in the format of YYYY-MM-DDThh:mmZ.

If RecurrenceType is specified, the time point specified by this attribute is the default time point at which the circle is executed. If RecurrenceType is not specified, the task is executed once on the designated date and time.

A time point 90 days after creation or modification cannot be entered.

ScheduledTaskName

String

No

Display name of the scheduled task, which must be 2-40 characters (English or Chinese) long. It must begin with a number, an upper/lower-case letter or a Chinese character and may contain numbers, “_”, “-“ or “.”. The account name is unique in the same region.

If this parameter is not specified, the default value ScheduledScalingTaskId is used.

Description

String

No

Description of the scheduled task, which is 2-200 characters (English or Chinese) long.

LaunchExpirationTime

Integer

No

Time period within which the failed scheduled task is retried. The default value is 600s. Value range: [0, 21600]

RecurrenceType

String

No

Type of the scheduled task to be repeated. Optional values:

Daily: Recurrence interval by day for a scheduled task

Weekly: Recurrence interval by week for a scheduled task

Monthly: Recurrence interval by month for a scheduled task

Cron: Execute a scheduled task according to the specified Cron expression.

RecurrenceType, RecurrenceValue and RecurrenceEndTime must be specified.

RecurrenceValue

String

No

Value of the scheduled task to be repeated.

Daily: Only one value in the range [1,31] can be filled.

Weekly: Multiple values can be filled. The values of Sunday to Saturday are 0 to 6 in sequence. Multiple values shall be separated by commas (,).

Monthly: In the format of A-B. The value range of A and B is 1 to 31, and the B value must be greater than the A value.