Skip to content

list_association_versions async

list_association_versions(
    association_id: AssociationId,
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListAssociationVersionsResult

Retrieves all versions of an association for a specific association ID.

Parameters:

  • association_id (AssociationId) –

    The association ID for which you want to view all versions.

  • 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 ) –

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

Raises:

Source code in docs_src/capo_ssm/_services/async_ssm.py
async def list_association_versions(
    self,
    association_id: "capo_ssm.types.association_id.AssociationId",
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = 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_association_versions_result.ListAssociationVersionsResult"
):
    """<p>Retrieves all versions of an association for a specific association ID.</p>

    Args:
        association_id: <p>The association ID for which you want to view all versions.</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>
        next_token: <p>A token to start the list. Use this token to get the next set of results. </p>

    Raises:
        capo_ssm.errors.association_does_not_exist.AssociationDoesNotExist: <p>The specified association doesn't exist.</p>
        capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</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_association_versions_request.ListAssociationVersionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm.types.list_association_versions_result.ListAssociationVersionsResult"
    ]:
        import capo_ssm._operations.amazon_ssm.list_association_versions

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

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

        return capo_ssm.types.list_association_versions_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListAssociationVersions", redact_output=_redact_output),
    )
    input_: capo_ssm.types.list_association_versions_request.ListAssociationVersionsRequest = {
        "association_id": association_id
    }
    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