Skip to content

list_compliance_items async

list_compliance_items(
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    filters: Optional[ComplianceStringFilterList] = None,
    resource_ids: Optional[ComplianceResourceIdList] = None,
    resource_types: Optional[ComplianceResourceTypeList] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListComplianceItemsResult

For a specified resource ID, this API operation returns a list of compliance statuses for different resource types. Currently, you can only specify one resource ID per call. List results depend on the criteria specified in the filter.

Parameters:

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

    One or more compliance filters. Use a filter to return a more specific list of results.

  • resource_ids (Optional[ComplianceResourceIdList], default: None ) –

    The ID for the resources from which to get compliance information. Currently, you can only specify one resource ID.

  • resource_types (Optional[ComplianceResourceTypeList], default: None ) –

    The type of resource from which to get compliance information. Currently, the only supported resource type is ManagedInstance.

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

    A token to start the list. Use this token to get the next set of results.

  • max_results (Optional[MaxResults], 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.

Raises:

  • InternalServerError –

    An error occurred on the server side.

  • InvalidFilter –

    The filter name isn't valid. Verify that you entered the correct name and try again.

  • InvalidNextToken –

    The specified token isn't valid.

  • InvalidResourceId –

    The resource ID isn't valid. Verify that you entered the correct ID and try again.

  • InvalidResourceType –

    The resource type isn't valid. For example, if you are attempting to tag an EC2 instance, the instance must be a registered managed node.

  • 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 list_compliance_items(
    self,
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    filters: Optional[
        "capo_ssm.types.compliance_string_filter_list.ComplianceStringFilterList"
    ] = None,
    resource_ids: Optional[
        "capo_ssm.types.compliance_resource_id_list.ComplianceResourceIdList"
    ] = None,
    resource_types: Optional[
        "capo_ssm.types.compliance_resource_type_list.ComplianceResourceTypeList"
    ] = None,
    next_token: Optional["capo_ssm.types.next_token.NextToken"] = None,
    max_results: Optional["capo_ssm.types.max_results.MaxResults"] = None,
) -> "capo_ssm.types.list_compliance_items_result.ListComplianceItemsResult":
    """<p>For a specified resource ID, this API operation returns a list of compliance statuses for different resource types. Currently, you can only specify one resource ID per call. List results depend on the criteria specified in the filter.</p>

    Args:
        filters: <p>One or more compliance filters. Use a filter to return a more specific list of results.</p>
        resource_ids: <p>The ID for the resources from which to get compliance information. Currently, you can only specify one resource ID.</p>
        resource_types: <p>The type of resource from which to get compliance information. Currently, the only supported resource type is <code>ManagedInstance</code>.</p>
        next_token: <p>A token to start the list. Use this token to get the next set of results. </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.</p>

    Raises:
        capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_ssm.errors.invalid_filter.InvalidFilter: <p>The filter name isn't valid. Verify that you entered the correct name and try again.</p>
        capo_ssm.errors.invalid_next_token.InvalidNextToken: <p>The specified token isn't valid.</p>
        capo_ssm.errors.invalid_resource_id.InvalidResourceId: <p>The resource ID isn't valid. Verify that you entered the correct ID and try again.</p>
        capo_ssm.errors.invalid_resource_type.InvalidResourceType: <p>The resource type isn't valid. For example, if you are attempting to tag an EC2 instance, the instance must be a registered managed node.</p>
        capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ssm.types.list_compliance_items_request.ListComplianceItemsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm.types.list_compliance_items_result.ListComplianceItemsResult"
    ]:
        import capo_ssm._operations.amazon_ssm.list_compliance_items

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListComplianceItems")
    )
    input_: capo_ssm.types.list_compliance_items_request.ListComplianceItemsRequest = {}
    if filters is not None:
        input_["filters"] = filters
    if resource_ids is not None:
        input_["resource_ids"] = resource_ids
    if resource_types is not None:
        input_["resource_types"] = resource_types
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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