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.
-
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.
-
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.
>>> client.describe_auto_scaling_instances(instance_ids=['i-05b4f7d5be44822a6'])
Source code in docs_src/capo_auto_scaling/_services/auto_scaling.py
| def describe_auto_scaling_instances(
self,
*,
config_overrides: Optional[AutoScalingClientConfig] = None,
instance_ids: Optional[
"capo_auto_scaling.types.instance_ids.InstanceIds"
] = 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>
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>
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.
>>> client.describe_auto_scaling_instances(instance_ids=['i-05b4f7d5be44822a6'])
"""
def _handler(
req: "OperationRequest[capo_auto_scaling.types.describe_auto_scaling_instances_type.DescribeAutoScalingInstancesType]",
) -> OperationResponse[
"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 = (
capo_auto_scaling._operations.auto_scaling_2011_01_01.describe_auto_scaling_instances.describe_auto_scaling_instances(
req.options, req.input
)
)
return OperationResponse(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 max_records is not None:
input_["max_records"] = max_records
if next_token is not None:
input_["next_token"] = next_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|