All Products
Search
Document Center

Auto Scaling:DescribeScheduledTasks

Last Updated:Aug 07, 2024

Queries a scheduled task. A scheduled task is a preset task that can activate a specific scaling rule at a specific time point, allowing for automatic adjustment of computing resources. After you create a scheduled task, you can call the DescribeScheduledTasks operation to query the task details, such as the trigger time point and scaling group ID. You can also call this operation to query the total number of scheduled tasks you have.

Usage notes

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

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action

String

Yes

DescribeScheduledTasks

The operation that you want to perform. Set the value to DescribeScheduledTasks.

RegionId

String

Yes

cn-qingdao

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

PageNumber

Integer

No

1

The page number. Pages start from page 1.

Default value: 1.

PageSize

Integer

No

50

The number of entries per page. Valid values: 1 to 50.

Default value: 10.

ScalingGroupId

String

No

asg-bp1bo5tca4m56nap****

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

ScheduledAction.N

String

No

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

Scaling rule N of the scheduled task. Valid values of N: 0 to 20.

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

ScheduledTaskId.N

String

No

edRtShc57WGXdt8TlPbr****

The ID of scheduled task N that you want to query. Valid values of N: 1 to 20.

ScheduledTaskName.N

String

No

scheduled****

The name of scheduled task N that you want to query. Valid values of N: 1 to 20.

TaskName

String

No

scheduled****

The name of scheduled task N. Fuzzy search based on keywords is supported.

RecurrenceType

String

No

Weekly

The interval at which scheduled task N is repeatedly executed. Valid values:

  • Daily: Scheduled task N is executed once every specified number of days.

  • Weekly: Scheduled task N is executed on each specified day of a week.

  • Monthly: Scheduled task N is executed on each specified day of a month.

  • Cron: Scheduled task N is executed based on the specified cron expression.

RecurrenceValue

String

No

1,2,3

The number of times scheduled task N is repeatedly executed.

You can specify this parameter only if you set RecurrenceType to Weekly. Separate multiple 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.

TaskEnabled

Boolean

No

true

Specifies whether scheduled task N is enabled.

  • true

  • false

Response parameters

Parameter

Type

Example

Description

RequestId

String

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

The request ID.

PageNumber

Integer

1

The page number.

PageSize

Integer

50

The number of entries per page.

TotalCount

Integer

1

The total number of scheduled tasks.

ScheduledTasks

Array of ScheduledTask

The collection of scheduled tasks.

ScheduledTask

TaskEnabled

Boolean

true

Indicates whether the scheduled task is enabled. Valid values:

  • true

  • false

Default value: true.

RecurrenceValue

String

1

The number of recurrences of the scheduled task.

RecurrenceType

String

Daily

The interval at which the scheduled task recurs.

MaxValue

Integer

10

The maximum number of instances that can be contained in the scaling group. This parameter is available if you set Scaling Method to Configure Number of Instances in Scaling Group.

ScheduledTaskName

String

scheduled****

The name of the scheduled task.

RecurrenceEndTime

String

2014-08-20T16:55Z

The end time of the recurrence of the scheduled task.

DesiredCapacity

Integer

10

The expected number of instances in the scaling group. This parameter is available if you set Scaling Method to Configure Number of Instances in Scaling Group.

ScheduledTaskId

String

edRtShc57WGXdt8TlPbr****

The ID of the scheduled task.

MinValue

Integer

0

The minimum number of instances that must be contained in the scaling group. This parameter is available if you set Scaling Method to Configure Number of Instances in Scaling Group.

ScalingGroupId

String

asg-bp1bo5tca4m56nap****

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

LaunchExpirationTime

Integer

600

The time window during which the scheduled task invokes a retry upon encountering failures. Unit: seconds. Valid values: 0 to 21600.

Description

String

Test scheduled task.

The description of the scheduled task.

ScheduledAction

String

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

The scaling rule that is executed when the scheduled task is triggered. This parameter is returned only if a scaling rule is specified for the scheduled task.

LaunchTime

String

2014-08-18T10:52Z

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

Examples

Sample requests

http(s)://ess.aliyuncs.com/?Action=DescribeScheduledTasks
&RegionId=cn-qingdao
&PageNumber=1
&PageSize=50
&ScalingGroupId=asg-bp1bo5tca4m56nap****
&ScheduledAction=["ari:acs:ess:cn-hangzhou:1406926474****:scalingrule/asr-bp1id5rhu8edp7kd****"]
&ScheduledTaskId=["edRtShc57WGXdt8TlPbr****"]
&ScheduledTaskName=["scheduled****"]
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

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

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "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, see Service error codes.