Skip to content

describe_instance_information async

describe_instance_information(
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    instance_information_filter_list: Optional[InstanceInformationFilterList] = None,
    filters: Optional[InstanceInformationStringFilterList] = None,
    max_results: Optional[MaxResultsEC2Compatible] = None,
    next_token: Optional[NextToken] = None,
) -> DescribeInstanceInformationResult

Provides information about one or more of your managed nodes, including the operating system platform, SSM Agent version, association status, and IP address. This operation does not return information for nodes that are either Stopped or Terminated.

If you specify one or more node IDs, the operation returns information for those managed nodes. If you don't specify node IDs, it returns information for all your managed nodes. If you specify a node ID that isn't valid or a node that you don't own, you receive an error.

The IamRole field returned for this API operation is the role assigned to an Amazon EC2 instance configured with a Systems Manager Quick Setup host management configuration or the role assigned to an on-premises managed node.

Parameters:

  • instance_information_filter_list (Optional[InstanceInformationFilterList], default: None ) –

    This is a legacy method. We recommend that you don't use this method. Instead, use the Filters data type. Filters enables you to return node information by filtering based on tags applied to managed nodes.

    Attempting to use InstanceInformationFilterList and Filters leads to an exception error.

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

    One or more filters. Use a filter to return a more specific list of managed nodes. You can filter based on tags applied to your managed nodes. Tag filters can't be combined with other filter types. Use this Filters data type instead of InstanceInformationFilterList, which is deprecated.

  • max_results (Optional[MaxResultsEC2Compatible], default: None ) –

    The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results. The default value is 10 items.

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

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

Raises:

  • InternalServerError –

    An error occurred on the server side.

  • InvalidFilterKey –

    The specified key isn't valid.

  • InvalidInstanceId –

    The following problems can cause this exception:

    • You don't have permission to access the managed node.

    • Amazon Web Services Systems Manager Agent (SSM Agent) isn't running. Verify that SSM Agent is running.

    • SSM Agent isn't registered with the SSM endpoint. Try reinstalling SSM Agent.

    • The managed node isn't in a valid state. Valid states are: Running, Pending, Stopped, and Stopping. Invalid states are: Shutting-down and Terminated.

  • InvalidInstanceInformationFilterValue –

    The specified filter value isn't valid.

  • InvalidNextToken –

    The specified token isn't valid.

  • UnknownServiceError –

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

Source code in docs_src/capo_ssm/_services/async_ssm.py
async def describe_instance_information(
    self,
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    instance_information_filter_list: Optional[
        "capo_ssm.types.instance_information_filter_list.InstanceInformationFilterList"
    ] = None,
    filters: Optional[
        "capo_ssm.types.instance_information_string_filter_list.InstanceInformationStringFilterList"
    ] = None,
    max_results: Optional[
        "capo_ssm.types.max_results_ec2_compatible.MaxResultsEC2Compatible"
    ] = None,
    next_token: Optional["capo_ssm.types.next_token.NextToken"] = None,
) -> "capo_ssm.types.describe_instance_information_result.DescribeInstanceInformationResult":
    """<p>Provides information about one or more of your managed nodes, including the operating system platform, SSM Agent version, association status, and IP address. This operation does not return information for nodes that are either Stopped or Terminated.</p> <p>If you specify one or more node IDs, the operation returns information for those managed nodes. If you don't specify node IDs, it returns information for all your managed nodes. If you specify a node ID that isn't valid or a node that you don't own, you receive an error.</p> <note> <p>The <code>IamRole</code> field returned for this API operation is the role assigned to an Amazon EC2 instance configured with a Systems Manager Quick Setup host management configuration or the role assigned to an on-premises managed node.</p> </note>

    Args:
        instance_information_filter_list: <p>This is a legacy method. We recommend that you don't use this method. Instead, use the <code>Filters</code> data type. <code>Filters</code> enables you to return node information by filtering based on tags applied to managed nodes.</p> <note> <p>Attempting to use <code>InstanceInformationFilterList</code> and <code>Filters</code> leads to an exception error. </p> </note>
        filters: <p>One or more filters. Use a filter to return a more specific list of managed nodes. You can filter based on tags applied to your managed nodes. Tag filters can't be combined with other filter types. Use this <code>Filters</code> data type instead of <code>InstanceInformationFilterList</code>, which is deprecated.</p>
        max_results: <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results. The default value is 10 items. </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_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_ssm.errors.invalid_filter_key.InvalidFilterKey: <p>The specified key isn't valid.</p>
        capo_ssm.errors.invalid_instance_id.InvalidInstanceId: <p>The following problems can cause this exception:</p> <ul> <li> <p>You don't have permission to access the managed node.</p> </li> <li> <p>Amazon Web Services Systems Manager Agent (SSM Agent) isn't running. Verify that SSM Agent is running.</p> </li> <li> <p>SSM Agent isn't registered with the SSM endpoint. Try reinstalling SSM Agent.</p> </li> <li> <p>The managed node isn't in a valid state. Valid states are: <code>Running</code>, <code>Pending</code>, <code>Stopped</code>, and <code>Stopping</code>. Invalid states are: <code>Shutting-down</code> and <code>Terminated</code>.</p> </li> </ul>
        capo_ssm.errors.invalid_instance_information_filter_value.InvalidInstanceInformationFilterValue: <p>The specified filter value isn't valid.</p>
        capo_ssm.errors.invalid_next_token.InvalidNextToken: <p>The specified token isn't valid.</p>
        capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ssm.types.describe_instance_information_request.DescribeInstanceInformationRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm.types.describe_instance_information_result.DescribeInstanceInformationResult"
    ]:
        import capo_ssm._operations.amazon_ssm.describe_instance_information

        (
            output,
            http_response,
        ) = await capo_ssm._operations.amazon_ssm.describe_instance_information.async_describe_instance_information(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_ssm.types.describe_instance_information_result.DescribeInstanceInformationResult",
    ) -> dict[str, Any]:
        import capo_ssm.types.describe_instance_information_result

        return capo_ssm.types.describe_instance_information_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "DescribeInstanceInformation", redact_output=_redact_output
        ),
    )
    input_: capo_ssm.types.describe_instance_information_request.DescribeInstanceInformationRequest = {}
    if instance_information_filter_list is not None:
        input_["instance_information_filter_list"] = (
            instance_information_filter_list
        )
    if filters is not None:
        input_["filters"] = filters
    if max_results is not None:
        input_["max_results"] = max_results
    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