DescribeInstanceRefreshes

Updated at:

Queries instance refresh tasks for a scaling group. You can call this operation to view basic information and progress of instance refresh tasks.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ess:DescribeInstanceRefreshes

get

*ScalingGroup

acs:ess:{#regionId}:{#accountId}:scalinggroup/{#ScalingGroupId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the scaling group.

cn-hangzhou

NextToken

string

No

The pagination token. Set this parameter to the NextToken value returned in the previous call. You do not need to set this parameter for the first request.

caeba0bbb2be03f84eb48b699f0a****

MaxResults

integer

No

The maximum number of entries per page in a paging query. Valid values: 1 to 50. Default value: 10.

10

ScalingGroupId

string

No

The ID of the scaling group.

Note

You must specify at least one of ScalingGroupId and InstanceRefreshTaskIds. If neither parameter is specified, an error is returned. .

asg-bp1ffogfdauy0jw0****

InstanceRefreshTaskIds

array

No

The IDs of the instance refresh tasks to query.

string

No

The IDs of the instance refresh tasks to query.

ir-adfa12312*****

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

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

NextToken

string

The pagination token for the next query. If NextToken is empty, no more results exist.

caeba0bbb2be03f84eb48b699f****

MaxResults

integer

The maximum number of entries per page.

50

TotalCount

integer

The total number of instance refresh tasks.

100

InstanceRefreshTasks

array<object>

The list of instance refresh tasks.

array<object>

The instance refresh task.

ScalingGroupId

string

The ID of the scaling group.

asg-bp16pbfcr8j9*****

InstanceRefreshTaskId

string

The ID of the instance refresh task.

ir-1adfa123****

RegionId

string

The region ID of the scaling group.

cn-hangzhou

EndTime

string

The end time of the instance refresh task.

2024-08-22T02:09:00Z

StartTime

string

The start time of the instance refresh task.

2024-08-22T01:09:00Z

Status

string

The current status of the instance refresh task. Valid values:

  • Pending: The instance refresh task is created and waiting to be scheduled.

  • InProgress: The instance refresh task is in progress.

  • Paused: The instance refresh task is paused.

  • CheckpointPause: The instance refresh task is paused because the task progress reached a checkpoint (Checkpoint.Percentage).

  • Failed: The instance refresh task failed.

  • Successful: The instance refresh task succeeded.

  • Cancelling: The instance refresh task is being canceled.

  • Cancelled: The instance refresh task is canceled.

  • RollbackInProgress: The instance refresh task is being rolled back.

  • RollbackSuccessful: The instance refresh task is rolled back.

  • RollbackFailed: The rollback of the instance refresh task failed.

InProgress

Detail

string

The failure reason when the instance refresh task fails.

The task exceeded its maximum run time of one week. So the task failed.

MinHealthyPercentage

integer

The minimum percentage of instances that must remain in service in the scaling group during the instance refresh.

80

MaxHealthyPercentage

integer

The maximum percentage by which the number of instances in the scaling group can exceed the scaling group capacity during the instance refresh.

120

DesiredConfiguration

object

The desired configuration for the instance refresh.

ImageId

string

The ID of the image file that provides the image resource for Auto Scaling to create instances.

m-uf6g5noisr****

ScalingConfigurationId

string

The ID of the scaling configuration.

asc-wz91ibkhfor****

LaunchTemplateId

string

The ID of the launch template, used to specify that the scaling group retrieves its launch configuration information from the launch template.

lt-2ze5x4mp*****

LaunchTemplateVersion

string

The version of the launch template. Possible values:

  • A fixed template version number.

  • Default: always uses the default template version.

  • Latest: always uses the latest template version.

Latest

LaunchTemplateOverrides

array<object>

Instance type information for the launch template extension.

object

Instance type information for the launch template extension.

InstanceType

string

The specified instance type, which overwrites the instance type in the launch template.

ecs.sn1ne.large

Containers

array<object>

List of containers included in the instance.

array<object>

List of containers included in the instance.

Name

string

Custom container name.

name

Image

string

The container image.

registry-vpc.cn-hangzhou.aliyuncs.com/eci_open/nginx:latest

Commands

array

The container start command.

string

The container start command.

sleep

Args

array

The parameters corresponding to the container start command.

string

The parameters corresponding to the container start command.

100

EnvironmentVars

array<object>

Information about environment variables.

object

Information about environment variables.

Key

string

The name of the environment variable.

PATH

Value

string

Value of the environment variable.

/usr/local/bin

FieldRefFieldPath

string

This parameter is not available for use.

fieldPath

FinishedUpdateCapacity

integer

The capacity that has been refreshed.

10

TotalNeedUpdateCapacity

integer

The total capacity that needs to be refreshed.

20

SkipMatching

boolean

Indicates whether instances that already match the desired configuration are skipped.

Note

The system determines whether an instance matches based on the ID of the desired scaling configuration, not by comparing individual configuration items.

Valid values:

  • true: Skipped. When the instance refresh task starts, the system checks the configuration of each instance. Instances that were already created with the desired configuration are not refreshed.

  • false: Not skipped. After the instance refresh task starts, all instances in the scaling group are refreshed.

true

CheckpointPauseTime

integer

The duration for which the task pauses when a checkpoint is reached. Unit: minutes.

30

Checkpoints

array<object>

The checkpoints for the refresh task. A checkpoint specifies that the task automatically pauses for CheckpointPauseTime minutes when the proportion of new instances reaches the specified value during the instance refresh.

object

The checkpoints for the refresh task. A checkpoint specifies that the task automatically pauses for CheckpointPauseTime minutes when the proportion of new instances reaches the specified value during the instance refresh.

Percentage

integer

The percentage of new instances in the scaling group relative to the total number of instances. The task automatically pauses when this percentage is reached.

60

Strategy

string

Examples

Success response

JSON format

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "NextToken": "caeba0bbb2be03f84eb48b699f****",
  "MaxResults": 50,
  "TotalCount": 100,
  "InstanceRefreshTasks": [
    {
      "ScalingGroupId": "asg-bp16pbfcr8j9*****",
      "InstanceRefreshTaskId": "ir-1adfa123****",
      "RegionId": "cn-hangzhou",
      "EndTime": "2024-08-22T02:09:00Z",
      "StartTime": "2024-08-22T01:09:00Z",
      "Status": "InProgress",
      "Detail": "The task exceeded its maximum run time of one week. So the task failed.",
      "MinHealthyPercentage": 80,
      "MaxHealthyPercentage": 120,
      "DesiredConfiguration": {
        "ImageId": "m-uf6g5noisr****",
        "ScalingConfigurationId": "asc-wz91ibkhfor****",
        "LaunchTemplateId": "lt-2ze5x4mp*****",
        "LaunchTemplateVersion": "Latest",
        "LaunchTemplateOverrides": [
          {
            "InstanceType": "ecs.sn1ne.large"
          }
        ],
        "Containers": [
          {
            "Name": "name",
            "Image": "registry-vpc.cn-hangzhou.aliyuncs.com/eci_open/nginx:latest",
            "Commands": [
              "sleep"
            ],
            "Args": [
              "100"
            ],
            "EnvironmentVars": [
              {
                "Key": "PATH",
                "Value": "/usr/local/bin",
                "FieldRefFieldPath": "fieldPath"
              }
            ]
          }
        ]
      },
      "FinishedUpdateCapacity": 10,
      "TotalNeedUpdateCapacity": 20,
      "SkipMatching": true,
      "CheckpointPauseTime": 30,
      "Checkpoints": [
        {
          "Percentage": 60
        }
      ]
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.