Skip to content

list_certificate_authority_associations async

list_certificate_authority_associations(
    certificate_authority_arn: Arn,
    *,
    config_overrides: Optional[AsyncACMPCAClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListCertificateAuthorityAssociationsResponse

Lists the resource associations for a service-affiliated private certificate authority (CA). Each entry pairs the private CA with an associated Amazon Web Services resource. The results can be paginated.

Parameters:

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

    Use this parameter when paginating results to specify the maximum number of associations to return in the response on each page. If additional associations exist beyond the number you specify, the NextToken element is sent in the response. Use this NextToken value in a subsequent request to retrieve additional associations.

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

    Use this parameter when paginating results in a subsequent request after you receive a response with truncated results. Set it to the value of the NextToken parameter from the response you just received.

  • certificate_authority_arn (Arn) –

    The Amazon Resource Name (ARN) of the service-affiliated private CA whose associations you want to list.

Raises:

Source code in docs_src/capo_acm_pca/_services/async_acmpca.py
async def list_certificate_authority_associations(
    self,
    certificate_authority_arn: "capo_acm_pca.types.arn.Arn",
    *,
    config_overrides: Optional[AsyncACMPCAClientConfig] = None,
    max_results: Optional["capo_acm_pca.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_acm_pca.types.next_token.NextToken"] = None,
) -> "capo_acm_pca.types.list_certificate_authority_associations_response.ListCertificateAuthorityAssociationsResponse":
    """<p>Lists the resource associations for a service-affiliated private certificate authority (CA). Each entry pairs the private CA with an associated Amazon Web Services resource. The results can be paginated.</p>

    Args:
        max_results: <p>Use this parameter when paginating results to specify the maximum number of associations to return in the response on each page. If additional associations exist beyond the number you specify, the <code>NextToken</code> element is sent in the response. Use this <code>NextToken</code> value in a subsequent request to retrieve additional associations.</p>
        next_token: <p>Use this parameter when paginating results in a subsequent request after you receive a response with truncated results. Set it to the value of the <code>NextToken</code> parameter from the response you just received.</p>
        certificate_authority_arn: <p>The Amazon Resource Name (ARN) of the service-affiliated private CA whose associations you want to list.</p>

    Raises:
        capo_acm_pca.errors.invalid_arn_exception.InvalidArnException: <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
        capo_acm_pca.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The token specified in the <code>NextToken</code> argument is not valid. Use the token returned from your previous call to <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a>.</p>
        capo_acm_pca.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
        capo_acm_pca.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_acm_pca.types.list_certificate_authority_associations_request.ListCertificateAuthorityAssociationsRequest]",
    ) -> AsyncOperationResponse[
        "capo_acm_pca.types.list_certificate_authority_associations_response.ListCertificateAuthorityAssociationsResponse"
    ]:
        if req.options.protocol == "awsJson1_1":
            import capo_acm_pca._operations.acm_private_ca.aws_json1_1.list_certificate_authority_associations

            (
                output,
                http_response,
            ) = await capo_acm_pca._operations.acm_private_ca.aws_json1_1.list_certificate_authority_associations.async_list_certificate_authority_associations(
                req.options, req.input
            )
        elif req.options.protocol == "rpcv2Cbor":
            import capo_acm_pca._operations.acm_private_ca.rpcv2_cbor.list_certificate_authority_associations

            (
                output,
                http_response,
            ) = await capo_acm_pca._operations.acm_private_ca.rpcv2_cbor.list_certificate_authority_associations.async_list_certificate_authority_associations(
                req.options, req.input
            )
        else:
            raise ValueError(f"unknown protocol {req.options.protocol!r}")
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListCertificateAuthorityAssociations")
    )
    input_: capo_acm_pca.types.list_certificate_authority_associations_request.ListCertificateAuthorityAssociationsRequest = {
        "certificate_authority_arn": certificate_authority_arn
    }
    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