All Products
Search
Document Center

Auto Scaling:DescribeScheduledTasks

更新時間:Nov 11, 2024

Queries scheduled tasks. A scheduled task is a predefined task that triggers the automatic execution of a scaling rule at the specified point in time. It ensures an automatic scaling of computing resources to fulfill your business demands at a minimum cost. After you create a scheduled task, you can call the DescribeScheduledTasks operation to query the details of the task, such as the execution time point and the scaling group ID. You can also call this operation to query the total number of existing scheduled tasks.

Operation description

You can query scheduled tasks by scaling rule, task ID, or task name.

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:DescribeScheduledTasksget
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the scaling group to which the scheduled task belongs.

cn-qingdao
PageNumberintegerNo

The page number. Pages start from page 1.

Default value: 1.

1
PageSizeintegerNo

The number of entries per page. Maximum value: 50.

Default value: 10.

50
ScalingGroupIdstringNo

The ID of the scaling group to which the scheduled task belongs.

asg-bp1bo5tca4m56nap****
ScheduledActionsarrayNo

The scaling rules of the scheduled tasks. Once the scheduled tasks are triggered, the scaling rules are executed.

stringNo

The scaling rule of the scheduled task. Once the scheduled task is triggered, the scaling rule is executed.

Set the value to the unique identifier of the scaling rule (ScalingRuleAri).

ari:acs:ess:cn-hangzhou:1406926474****:scalingrule/asr-bp1id5rhu8edp7kd****
ScheduledTaskIdsarrayNo

The IDs of the scheduled tasks that you want to query.

stringNo

The ID of the scheduled task that you want to query.

edRtShc57WGXdt8TlPbr****
ScheduledTaskNamesarrayNo

The names of the scheduled tasks that you want to query.

stringNo

The name of the scheduled task that you want to query.

scheduled****

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
PageNumberinteger

The page number of the returned page.

1
PageSizeinteger

The number of entries returned per page.

50
TotalCountinteger

The total number of scheduled tasks.

1
ScheduledTasksarray<object>

The information collection of the scheduled tasks.

ScheduledTaskobject

Details of the scheduled tasks.

TaskEnabledboolean

Indicates whether the scheduled task is enabled.

  • true
  • false

Default value: true.

true
RecurrenceValuestring

The frequency of recurrence of the scheduled task.

1
RecurrenceTypestring

The recurring interval of the scheduled task.

Daily
MaxValueinteger

The maximum number of instances that must be contained in the scaling group. If you set Scaling Method to Configure Number of Instances in Scaling Group, you can specify this parameter.

10
ScheduledTaskNamestring

The name of the scheduled task.

scheduled****
RecurrenceEndTimestring

The end time of the recurrence of the scheduled task.

2014-08-20T16:55Z
DesiredCapacityinteger

The expected number of instances in the scaling group. If you set Scaling Method to Configure Number of Instances in Scaling Group, you can specify this parameter.

10
ScheduledTaskIdstring

The ID of the scheduled task.

edRtShc57WGXdt8TlPbr****
MinValueinteger

The minimum number of instances that must be contained in the scaling group. If you set Scaling Method to Configure Number of Instances in Scaling Group, you can specify this parameter.

0
ScalingGroupIdstring

The ID of the scaling group to which the scheduled task belongs.

asg-bp1bo5tca4m56nap****
LaunchExpirationTimeinteger

The time window during which the scheduled task can be retried. Unit: seconds. Valid values: 0 to 21600.

600
Descriptionstring

The description of the scheduled task.

Test scheduled task.
ScheduledActionstring

The scaling rule of the scheduled task. A value is returned for this parameter only after you specify ScheduledActions.

ari:acs:ess:cn-hangzhou:1406926474****:scalingrule/asr-bp1id5rhu8edp7kd****
LaunchTimestring

The point in time at which the scheduled task is triggered.

2014-08-18T10:52Z

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "PageNumber": 1,
  "PageSize": 50,
  "TotalCount": 1,
  "ScheduledTasks": [
    {
      "TaskEnabled": true,
      "RecurrenceValue": "1",
      "RecurrenceType": "Daily",
      "MaxValue": 10,
      "ScheduledTaskName": "scheduled****",
      "RecurrenceEndTime": "2014-08-20T16:55Z",
      "DesiredCapacity": 10,
      "ScheduledTaskId": "edRtShc57WGXdt8TlPbr****",
      "MinValue": 0,
      "ScalingGroupId": "asg-bp1bo5tca4m56nap****",
      "LaunchExpirationTime": 600,
      "Description": "Test scheduled task.",
      "ScheduledAction": "ari:acs:ess:cn-hangzhou:1406926474****:scalingrule/asr-bp1id5rhu8edp7kd****",
      "LaunchTime": "2014-08-18T10:52Z"
    }
  ]
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-07-04The request parameters of the API has changedView Change Details