Skip to content

describe_auto_scaling_groups async

describe_auto_scaling_groups(
    *,
    config_overrides: Optional[AsyncAutoScalingClientConfig] = None,
    auto_scaling_group_names: Optional[AutoScalingGroupNames] = None,
    include_instances: Optional[IncludeInstances] = None,
    next_token: Optional[XmlString] = None,
    max_records: Optional[MaxRecords] = None,
    filters: Optional[Filters] = None,
) -> AutoScalingGroupsType

Gets information about the Auto Scaling groups in the account and Region.

If you specify Auto Scaling group names, the output includes information for only the specified Auto Scaling groups. If you specify filters, the output includes information for only those Auto Scaling groups that meet the filter criteria. If you do not specify group names or filters, the output includes information for all Auto Scaling groups.

This operation also returns information about instances in Auto Scaling groups. To retrieve information about the instances in a warm pool, you must call the DescribeWarmPool API.

Parameters:

  • auto_scaling_group_names (Optional[AutoScalingGroupNames], default: None ) –

    The names of the Auto Scaling groups. By default, you can only specify up to 50 names. You can optionally increase this limit using the MaxRecords property.

    If you omit this property, all Auto Scaling groups are described.

  • include_instances (Optional[IncludeInstances], default: None ) –

    Specifies whether to include information about Amazon EC2 instances in the response. When set to true (default), the response includes instance details.

  • next_token (Optional[XmlString], default: None ) –

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

  • max_records (Optional[MaxRecords], default: None ) –

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

  • filters (Optional[Filters], default: None ) –

    One or more filters to limit the results based on specific tags.

Raises:

  • InvalidNextToken –

    The NextToken value is not valid.

  • ResourceContentionFault –

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

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To describe an Auto Scaling group This example describes the specified Auto Scaling group.

>>> await client.describe_auto_scaling_groups(auto_scaling_group_names=['my-auto-scaling-group'])
Source code in docs_src/capo_auto_scaling/_services/async_auto_scaling.py
async def describe_auto_scaling_groups(
    self,
    *,
    config_overrides: Optional[AsyncAutoScalingClientConfig] = None,
    auto_scaling_group_names: Optional[
        "capo_auto_scaling.types.auto_scaling_group_names.AutoScalingGroupNames"
    ] = None,
    include_instances: Optional[
        "capo_auto_scaling.types.include_instances.IncludeInstances"
    ] = None,
    next_token: Optional["capo_auto_scaling.types.xml_string.XmlString"] = None,
    max_records: Optional["capo_auto_scaling.types.max_records.MaxRecords"] = None,
    filters: Optional["capo_auto_scaling.types.filters.Filters"] = None,
) -> "capo_auto_scaling.types.auto_scaling_groups_type.AutoScalingGroupsType":
    """<p>Gets information about the Auto Scaling groups in the account and Region.</p> <p>If you specify Auto Scaling group names, the output includes information for only the specified Auto Scaling groups. If you specify filters, the output includes information for only those Auto Scaling groups that meet the filter criteria. If you do not specify group names or filters, the output includes information for all Auto Scaling groups. </p> <p>This operation also returns information about instances in Auto Scaling groups. To retrieve information about the instances in a warm pool, you must call the <a href="https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeWarmPool.html">DescribeWarmPool</a> API. </p>

    Args:
        auto_scaling_group_names: <p>The names of the Auto Scaling groups. By default, you can only specify up to 50 names. You can optionally increase this limit using the <code>MaxRecords</code> property.</p> <p>If you omit this property, all Auto Scaling groups are described.</p>
        include_instances: <p> Specifies whether to include information about Amazon EC2 instances in the response. When set to <code>true</code> (default), the response includes instance details. </p>
        next_token: <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
        max_records: <p>The maximum number of items to return with this call. The default value is <code>50</code> and the maximum value is <code>100</code>.</p>
        filters: <p>One or more filters to limit the results based on specific tags. </p>

    Raises:
        capo_auto_scaling.errors.invalid_next_token.InvalidNextToken: <p>The <code>NextToken</code> value is not valid.</p>
        capo_auto_scaling.errors.resource_contention_fault.ResourceContentionFault: <p>You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).</p>
        capo_auto_scaling.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe an Auto Scaling group
        This example describes the specified Auto Scaling group.

        >>> await client.describe_auto_scaling_groups(auto_scaling_group_names=['my-auto-scaling-group'])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_auto_scaling.types.auto_scaling_group_names_type.AutoScalingGroupNamesType]",
    ) -> AsyncOperationResponse[
        "capo_auto_scaling.types.auto_scaling_groups_type.AutoScalingGroupsType"
    ]:
        import capo_auto_scaling._operations.auto_scaling_2011_01_01.describe_auto_scaling_groups

        (
            output,
            http_response,
        ) = await capo_auto_scaling._operations.auto_scaling_2011_01_01.describe_auto_scaling_groups.async_describe_auto_scaling_groups(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeAutoScalingGroups")
    )
    input_: capo_auto_scaling.types.auto_scaling_group_names_type.AutoScalingGroupNamesType = {}
    if auto_scaling_group_names is not None:
        input_["auto_scaling_group_names"] = auto_scaling_group_names
    if include_instances is not None:
        input_["include_instances"] = include_instances
    if next_token is not None:
        input_["next_token"] = next_token
    if max_records is not None:
        input_["max_records"] = max_records
    if filters is not None:
        input_["filters"] = filters

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output