Skip to content

describe_auto_scaling_instances async

describe_auto_scaling_instances(
    *,
    config_overrides: Optional[AsyncAutoScalingClientConfig] = None,
    instance_ids: Optional[InstanceIds] = None,
    include_managed_resources: Optional[IncludeManagedResources] = None,
    max_records: Optional[MaxRecords] = None,
    next_token: Optional[XmlString] = None,
) -> AutoScalingInstancesType

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

Parameters:

  • instance_ids (Optional[InstanceIds], default: None ) –

    The IDs of the instances. If you omit this property, all Auto Scaling instances are described. If you specify an ID that does not exist, it is ignored with no error.

    Array Members: Maximum number of 50 items.

  • include_managed_resources (Optional[IncludeManagedResources], default: None ) –

    Specifies whether to include managed Auto Scaling instances in the response. When set to true (default), the response includes managed Auto Scaling instances.

  • 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 50.

    A response can contain fewer items than the value specified by MaxRecords, even when more items are available. To retrieve the additional items, use the NextToken value in a subsequent call rather than relying on the number of items in the response.

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

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

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 one or more Auto Scaling instances This example describes the specified Auto Scaling instance.

>>> await client.describe_auto_scaling_instances(instance_ids=['i-05b4f7d5be44822a6'])
Source code in docs_src/capo_auto_scaling/_services/async_auto_scaling.py
async def describe_auto_scaling_instances(
    self,
    *,
    config_overrides: Optional[AsyncAutoScalingClientConfig] = None,
    instance_ids: Optional[
        "capo_auto_scaling.types.instance_ids.InstanceIds"
    ] = None,
    include_managed_resources: Optional[
        "capo_auto_scaling.types.include_managed_resources.IncludeManagedResources"
    ] = None,
    max_records: Optional["capo_auto_scaling.types.max_records.MaxRecords"] = None,
    next_token: Optional["capo_auto_scaling.types.xml_string.XmlString"] = None,
) -> "capo_auto_scaling.types.auto_scaling_instances_type.AutoScalingInstancesType":
    """<p>Gets information about the Auto Scaling instances in the account and Region.</p>

    Args:
        instance_ids: <p>The IDs of the instances. If you omit this property, all Auto Scaling instances are described. If you specify an ID that does not exist, it is ignored with no error.</p> <p>Array Members: Maximum number of 50 items.</p>
        include_managed_resources: <p> Specifies whether to include managed Auto Scaling instances in the response. When set to <code>true</code> (default), the response includes managed Auto Scaling instances. </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>50</code>.</p> <p>A response can contain fewer items than the value specified by <code>MaxRecords</code>, even when more items are available. To retrieve the additional items, use the <code>NextToken</code> value in a subsequent call rather than relying on the number of items in the response.</p>
        next_token: <p>The token for the next set of items to return. (You received this token from a previous call.)</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 one or more Auto Scaling instances
        This example describes the specified Auto Scaling instance.

        >>> await client.describe_auto_scaling_instances(instance_ids=['i-05b4f7d5be44822a6'])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_auto_scaling.types.describe_auto_scaling_instances_type.DescribeAutoScalingInstancesType]",
    ) -> AsyncOperationResponse[
        "capo_auto_scaling.types.auto_scaling_instances_type.AutoScalingInstancesType"
    ]:
        import capo_auto_scaling._operations.auto_scaling_2011_01_01.describe_auto_scaling_instances

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeAutoScalingInstances")
    )
    input_: capo_auto_scaling.types.describe_auto_scaling_instances_type.DescribeAutoScalingInstancesType = {}
    if instance_ids is not None:
        input_["instance_ids"] = instance_ids
    if include_managed_resources is not None:
        input_["include_managed_resources"] = include_managed_resources
    if max_records is not None:
        input_["max_records"] = max_records
    if next_token is not None:
        input_["next_token"] = next_token

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