describeScalingActivities method

Future<ActivitiesType> describeScalingActivities({
  1. List<String>? activityIds,
  2. String? autoScalingGroupName,
  3. List<Filter>? filters,
  4. bool? includeDeletedGroups,
  5. int? maxRecords,
  6. String? nextToken,
})

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.

May throw InvalidNextToken. May throw ResourceContentionFault.

Parameter activityIds : The activity IDs of the desired scaling activities. If unknown activity IDs are requested, they are ignored with no error. Only activities started within the last six weeks can be returned regardless of the activity IDs specified. If other filters are specified with the request, only results matching all filter criteria can be returned.

Array Members: Maximum number of 50 IDs.

Parameter autoScalingGroupName : The name of the Auto Scaling group.

Parameter filters : One or more filters to limit the results based on specific criteria. The following filters are supported:

  • StartTimeLowerBound - The earliest scaling activities to return based on the activity start time. Scaling activities with a start time earlier than this value are not included in the results. Only activities started within the last six weeks can be returned regardless of the value specified.
  • StartTimeUpperBound - The latest scaling activities to return based on the activity start time. Scaling activities with a start time later than this value are not included in the results. Only activities started within the last six weeks can be returned regardless of the value specified.
  • Status - The StatusCode value of the scaling activity. This filter can only be used in combination with the AutoScalingGroupName parameter. For valid StatusCode values, see Activity in the Amazon EC2 Auto Scaling API Reference.
StartTimeLowerBound and StartTimeUpperBound accept ISO 8601 formatted timestamps. Timestamps without a timezone offset are assumed to be UTC.
  • 2000-01-18T08:15:00Z
  • 2000-01-18T16:15:00+08:00

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

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

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

Implementation

Future<ActivitiesType> describeScalingActivities({
  List<String>? activityIds,
  String? autoScalingGroupName,
  List<Filter>? filters,
  bool? includeDeletedGroups,
  int? maxRecords,
  String? nextToken,
}) async {
  final $request = <String, String>{
    if (activityIds != null)
      if (activityIds.isEmpty)
        'ActivityIds': ''
      else
        for (var i1 = 0; i1 < activityIds.length; i1++)
          'ActivityIds.member.${i1 + 1}': activityIds[i1],
    if (autoScalingGroupName != null)
      'AutoScalingGroupName': autoScalingGroupName,
    if (filters != null)
      if (filters.isEmpty)
        'Filters': ''
      else
        for (var i1 = 0; i1 < filters.length; i1++)
          for (var e3 in filters[i1].toQueryMap().entries)
            'Filters.member.${i1 + 1}.${e3.key}': e3.value,
    if (includeDeletedGroups != null)
      'IncludeDeletedGroups': includeDeletedGroups.toString(),
    if (maxRecords != null) 'MaxRecords': maxRecords.toString(),
    if (nextToken != null) 'NextToken': nextToken,
  };
  final $result = await _protocol.send(
    $request,
    action: 'DescribeScalingActivities',
    version: '2011-01-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'DescribeScalingActivitiesResult',
  );
  return ActivitiesType.fromXml($result);
}