Skip to content

list_documents async

list_documents(
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    document_filter_list: Optional[DocumentFilterList] = None,
    filters: Optional[DocumentKeyValuesFilterList] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListDocumentsResult

Returns all Systems Manager (SSM) documents in the current Amazon Web Services account and Amazon Web Services Region. You can limit the results of this request by using a filter.

Parameters:

  • document_filter_list (Optional[DocumentFilterList], default: None ) –

    This data type is deprecated. Instead, use Filters.

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

    One or more DocumentKeyValuesFilter objects. Use a filter to return a more specific list of results. For keys, you can specify one or more key-value pair tags that have been applied to a document. Other valid keys include Owner, Name, PlatformTypes, DocumentType, and TargetType. For example, to return documents you own use Key=Owner,Values=Self. To specify a custom key-value pair, use the format Key=tag:tagName,Values=valueName.

    This API operation only supports filtering documents by using a single tag key and one or more tag values. For example: Key=tag:tagName,Values=valueName1,valueName2

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

  • 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:

Source code in docs_src/capo_ssm/_services/async_ssm.py
async def list_documents(
    self,
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    document_filter_list: Optional[
        "capo_ssm.types.document_filter_list.DocumentFilterList"
    ] = None,
    filters: Optional[
        "capo_ssm.types.document_key_values_filter_list.DocumentKeyValuesFilterList"
    ] = None,
    max_results: Optional["capo_ssm.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_ssm.types.next_token.NextToken"] = None,
) -> "capo_ssm.types.list_documents_result.ListDocumentsResult":
    """<p>Returns all Systems Manager (SSM) documents in the current Amazon Web Services account and Amazon Web Services Region. You can limit the results of this request by using a filter.</p>

    Args:
        document_filter_list: <p>This data type is deprecated. Instead, use <code>Filters</code>.</p>
        filters: <p>One or more <code>DocumentKeyValuesFilter</code> objects. Use a filter to return a more specific list of results. For keys, you can specify one or more key-value pair tags that have been applied to a document. Other valid keys include <code>Owner</code>, <code>Name</code>, <code>PlatformTypes</code>, <code>DocumentType</code>, and <code>TargetType</code>. For example, to return documents you own use <code>Key=Owner,Values=Self</code>. To specify a custom key-value pair, use the format <code>Key=tag:tagName,Values=valueName</code>.</p> <note> <p>This API operation only supports filtering documents by using a single tag key and one or more tag values. For example: <code>Key=tag:tagName,Values=valueName1,valueName2</code> </p> </note>
        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>
        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_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.list_documents_request.ListDocumentsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm.types.list_documents_result.ListDocumentsResult"
    ]:
        import capo_ssm._operations.amazon_ssm.list_documents

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListDocuments")
    )
    input_: capo_ssm.types.list_documents_request.ListDocumentsRequest = {}
    if document_filter_list is not None:
        input_["document_filter_list"] = document_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