All Products
Search
Document Center

Auto Scaling:ModifyScheduledTask

更新時間:Nov 11, 2024

Modifies a scheduled task. If an existing scheduled task cannot meet your business requirements, you can call the ModifyScheduledTask operation to adjust its parameter settings including the scaling rule to execute and the boundary values of your scaling group, without the need to create a new scheduled task. This operation provides a flexible way to optimize scheduled tasks.

Operation 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 the minimum number, maximum number, or expected number of instances in the scheduled task.
Note You cannot specify the ScheduledAction and ScalingGroupId parameters at the same time.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ess:ModifyScheduledTaskupdate
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ScheduledTaskIdstringYes

The ID of the scheduled task.

edRtShc57WGXdt8TlPbr****
ScheduledTaskNamestringNo

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 letter or a digit. The name of the scheduled task must be unique in the region and within the Alibaba Cloud account.

scheduled****
DescriptionstringNo

The description of the scheduled task. The description must be 2 to 200 characters in length.

Test scheduled task.
ScheduledActionstringNo

The scaling rule that you want to execute when the scheduled task is triggered. Enter the ID of the scaling rule. To obtain the ID of a scaling rule, go to the scaling rule details page. If you specify ScheduledAction, you must select an existing scaling rule for the scheduled task.

Note You can specify only one of ScheduledAction and ScalingGroupId.
ari:acs:ess:cn-hangzhou:14069264****:scalingrule/asr-bp12tcnol686y1ik****
RecurrenceEndTimestringNo

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 point in time that is later than 365 days from the point in time at which the scheduled task is modified.

2014-08-20T16:55Z
LaunchTimestringNo

The point in time at which the scheduled task is triggered. The time follows 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 point in time at which the scheduled task is modified.

  • If you specify the RecurrenceType parameter, the task is repeatedly executed at the time point that is specified by the LaunchTime parameter.
  • If you do not specify the RecurrenceType parameter, the task is executed only once at the point in time that is specified by the LaunchTime parameter.
2014-08-18T10:52Z
RecurrenceTypestringNo

The interval at which the scheduled task is repeated. Valid values:

  • Daily: The scheduled task is executed once every specified number of days.
  • Weekly: The scheduled task is executed on each specified day of the week.
  • Monthly: The scheduled task is executed on each specified day of the month.
  • Cron: The scheduled task is executed based on the specified cron expression.

After you modify the scheduled task, the values that you specify for the RecurrenceType and RecurrenceValue parameters must be valid at the same time.

Daily
RecurrenceValuestringNo

The number of recurrences of the scheduled task.

  • If you set the RecurrenceType parameter to Daily, you can specify only one value for this parameter. Valid values: 1 to 31.
  • If you set the RecurrenceType parameter to Weekly, you can specify multiple values for this parameter. Separate the values with commas (,). The values that correspond to Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday are 0, 1, 2, 3, 4, 5, and 6.``
  • If you set the RecurrenceType parameter to Monthly, you can specify two values in the A-B format for this parameter. Valid values of A and B: 1 to 31. B must be greater than or equal to A.
  • If you set the RecurrenceType parameter to Cron, you can specify a cron expression. A cron expression is written in UTC time and consists of the following fields: minute, hour, day, month, and week. The expression can contain the letters L and W and the following wildcard characters: commas (,), question marks (?), hyphens (-), asterisks (*), number signs (#), and forward slashes (/).

After you modify the scheduled task, the values that you specify for the RecurrenceType and RecurrenceValue parameters must be valid at the same time.

2
TaskEnabledbooleanNo

Specifies whether to enable the scheduled task. Valid values:

  • true
  • false

Default value: true.

true
LaunchExpirationTimeintegerNo

The time period during which the failed scheduled task is retried. Unit: seconds. Valid values: 0 to 1800.

Default value: 600.

600
MinValueintegerNo

The minimum number of instances in the scaling group if you specify the ScalingGroupId parameter.

0
MaxValueintegerNo

The maximum number of instances in the scaling group if you specify the ScalingGroupId parameter.

10
DesiredCapacityintegerNo

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 a scaling group.
10
ScalingGroupIdstringNo

The ID of the scaling group whose number of instances must be modified when the scheduled task is triggered. If you specify the ScalingGroupId parameter for a scheduled task, you must specify the minimum, maximum, or expected numbers of instances for a scaling group in the scheduled task. That is, you must specify at least one of the MinValue, MaxValue, and DesiredCapacity parameters.

Note You cannot specify the ScheduledAction and ScalingGroupId parameters at the same time.
asg-bp18p2yfxow2dloq****

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}

Error codes

HTTP status codeError codeError message
400ThrottlingRequest was denied due to request throttling.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history