Skip to content

get_certificates async

get_certificates(
    *,
    config_overrides: Optional[AsyncLightsailClientConfig] = None,
    certificate_statuses: Optional[CertificateStatusList] = None,
    include_certificate_details: Optional[IncludeCertificateDetails] = None,
    certificate_name: Optional[CertificateName] = None,
    page_token: Optional[string] = None,
) -> GetCertificatesResult

Returns information about one or more Amazon Lightsail SSL/TLS certificates.

To get a summary of a certificate, omit includeCertificateDetails from your request. The response will include only the certificate Amazon Resource Name (ARN), certificate name, domain name, and tags.

Parameters:

  • certificate_statuses (Optional[CertificateStatusList], default: None ) –

    The status of the certificates for which to return information.

    For example, specify ISSUED to return only certificates with an ISSUED status.

    When omitted, the response includes all of your certificates in the Amazon Web Services Region where the request is made, regardless of their current status.

  • include_certificate_details (Optional[IncludeCertificateDetails], default: None ) –

    Indicates whether to include detailed information about the certificates in the response.

    When omitted, the response includes only the certificate names, Amazon Resource Names (ARNs), domain names, and tags.

  • certificate_name (Optional[CertificateName], default: None ) –

    The name for the certificate for which to return information.

    When omitted, the response includes all of your certificates in the Amazon Web Services Region where the request is made.

  • page_token (Optional[string], default: None ) –

    The token to advance to the next page of results from your request.

    To get a page token, perform an initial GetCertificates request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Raises:

  • AccessDeniedException –

    Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

  • InvalidInputException –

    Lightsail throws this exception when user input does not conform to the validation rules of an input field.

    Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

  • NotFoundException –

    Lightsail throws this exception when it cannot find a resource.

  • RegionSetupInProgressException –

    Lightsail throws this exception when an operation is performed on resources in an opt-in Region that is currently being set up.

  • ServiceException –

    A general service exception.

  • UnauthenticatedException –

    Lightsail throws this exception when the user has not been authenticated.

  • UnknownServiceError –

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

Source code in docs_src/capo_lightsail/_services/async_lightsail.py
async def get_certificates(
    self,
    *,
    config_overrides: Optional[AsyncLightsailClientConfig] = None,
    certificate_statuses: Optional[
        "capo_lightsail.types.certificate_status_list.CertificateStatusList"
    ] = None,
    include_certificate_details: Optional[
        "capo_lightsail.types.include_certificate_details.IncludeCertificateDetails"
    ] = None,
    certificate_name: Optional[
        "capo_lightsail.types.certificate_name.CertificateName"
    ] = None,
    page_token: Optional["capo_lightsail.types.string.string"] = None,
) -> "capo_lightsail.types.get_certificates_result.GetCertificatesResult":
    """<p>Returns information about one or more Amazon Lightsail SSL/TLS certificates.</p> <note> <p>To get a summary of a certificate, omit <code>includeCertificateDetails</code> from your request. The response will include only the certificate Amazon Resource Name (ARN), certificate name, domain name, and tags.</p> </note>

    Args:
        certificate_statuses: <p>The status of the certificates for which to return information.</p> <p>For example, specify <code>ISSUED</code> to return only certificates with an <code>ISSUED</code> status.</p> <p>When omitted, the response includes all of your certificates in the Amazon Web Services Region where the request is made, regardless of their current status.</p>
        include_certificate_details: <p>Indicates whether to include detailed information about the certificates in the response.</p> <p>When omitted, the response includes only the certificate names, Amazon Resource Names (ARNs), domain names, and tags.</p>
        certificate_name: <p>The name for the certificate for which to return information.</p> <p>When omitted, the response includes all of your certificates in the Amazon Web Services Region where the request is made.</p>
        page_token: <p>The token to advance to the next page of results from your request.</p> <p>To get a page token, perform an initial <code>GetCertificates</code> request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.</p>

    Raises:
        capo_lightsail.errors.access_denied_exception.AccessDeniedException: <p>Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.</p>
        capo_lightsail.errors.invalid_input_exception.InvalidInputException: <p>Lightsail throws this exception when user input does not conform to the validation rules of an input field.</p> <note> <p>Domain and distribution APIs are only available in the N. Virginia (<code>us-east-1</code>) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to <code>us-east-1</code> to create, view, or edit these resources.</p> </note>
        capo_lightsail.errors.not_found_exception.NotFoundException: <p>Lightsail throws this exception when it cannot find a resource.</p>
        capo_lightsail.errors.region_setup_in_progress_exception.RegionSetupInProgressException: <p>Lightsail throws this exception when an operation is performed on resources in an opt-in Region that is currently being set up.</p>
        capo_lightsail.errors.service_exception.ServiceException: <p>A general service exception.</p>
        capo_lightsail.errors.unauthenticated_exception.UnauthenticatedException: <p>Lightsail throws this exception when the user has not been authenticated.</p>
        capo_lightsail.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lightsail.types.get_certificates_request.GetCertificatesRequest]",
    ) -> AsyncOperationResponse[
        "capo_lightsail.types.get_certificates_result.GetCertificatesResult"
    ]:
        import capo_lightsail._operations.lightsail_20161128.get_certificates

        (
            output,
            http_response,
        ) = await capo_lightsail._operations.lightsail_20161128.get_certificates.async_get_certificates(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetCertificates")
    )
    input_: capo_lightsail.types.get_certificates_request.GetCertificatesRequest = {}
    if certificate_statuses is not None:
        input_["certificate_statuses"] = certificate_statuses
    if include_certificate_details is not None:
        input_["include_certificate_details"] = include_certificate_details
    if certificate_name is not None:
        input_["certificate_name"] = certificate_name
    if page_token is not None:
        input_["page_token"] = page_token

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