DescribeScalingActivities - Amazon EC2 Auto Scaling

DescribeScalingActivities

Gets information about the scaling activities in the account and Region.

When scaling events occur, you see a record of the scaling activity in the scaling activities. For more information, see Verify a scaling activity for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.

If the scaling event succeeds, the value of the StatusCode element in the response is Successful. If an attempt to launch instances failed, the StatusCode value is Failed or Cancelled and the StatusMessage element in the response indicates the cause of the failure. For help interpreting the StatusMessage, see Troubleshooting Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

ActivityIds.member.N

The activity IDs of the desired scaling activities. If you omit this property, all activities for the past six weeks are described. If unknown activities are requested, they are ignored with no error. If you specify an Auto Scaling group, the results are limited to that group.

Array Members: Maximum number of 50 IDs.

Type: Array of strings

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Required: No

AutoScalingGroupName

The name of the Auto Scaling group.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 255.

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Required: No

IncludeDeletedGroups

Indicates whether to include scaling activity from deleted Auto Scaling groups.

Type: Boolean

Required: No

MaxRecords

The maximum number of items to return with this call. The default value is 100 and the maximum value is 100.

Type: Integer

Required: No

NextToken

The token for the next set of items to return. (You received this token from a previous call.)

Type: String

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Required: No

Response Elements

The following elements are returned by the service.

Activities.member.N

The scaling activities. Activities are sorted by start time. Activities still in progress are described first.

Type: Array of Activity objects

NextToken

A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the NextToken value when requesting the next set of items. This value is null when there are no more items to return.

Type: String

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidNextToken

The NextToken value is not valid.

HTTP Status Code: 400

ResourceContention

You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).

HTTP Status Code: 500

Examples

Example

This example illustrates one usage of DescribeScalingActivities.

Sample Request

https://autoscaling.amazonaws.com/?Action=DescribeScalingActivities &AutoScalingGroupName=my-asg &Version=2011-01-01 &AUTHPARAMS

Sample Response

<DescribeScalingActivitiesResponse xmlns="https://ec2.amazonaws.com/doc/2011-01-01/"> <DescribeScalingActivitiesResult> <Activities> <member> <StatusCode>Failed</StatusCode> <Progress>0</Progress> <ActivityId>12345678-1234-1234-1234-123456789012</ActivityId> <StartTime>2019-04-12T17:32:07.882Z</StartTime> <AutoScalingGroupName>my-asg</AutoScalingGroupName> <AutoScalingGroupARN>arn:aws:autoscaling:us-east-1:123456789012:autoScalingGroup:12345678-1234-1234-1234-123456789012:autoScalingGroupName/my-asg</AutoScalingGroupARN> <Cause>At 2019-04-12T17:31:30Z a user request created an AutoScalingGroup changing the desired capacity from 0 to 1. At 2019-04-12T17:32:07Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 1.</Cause> <Details>{}</Details> <Description>Launching a new EC2 instance. Status Reason: The image id 'ami-xxxxxxxx' does not exist. Launching EC2 instance failed.</Description> <EndTime>2019-04-12T17:32:08Z</EndTime> <StatusMessage>The image id 'ami-xxxxxxxx' does not exist. Launching EC2 instance failed.</StatusMessage> </member> </Activities> </DescribeScalingActivitiesResult> <ResponseMetadata> <RequestId>7c6e177f-f082-11e1-ac58-3714bEXAMPLE</RequestId> </ResponseMetadata> </DescribeScalingActivitiesResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: