Skip to content

get_health_check_last_failure_reason async

get_health_check_last_failure_reason(
    health_check_id: HealthCheckId,
    *,
    config_overrides: Optional[AsyncRoute53ClientConfig] = None,
) -> GetHealthCheckLastFailureReasonResponse

Gets the reason that a specified health check failed most recently.

Parameters:

  • health_check_id (HealthCheckId) –

    The ID for the health check for which you want the last failure reason. When you created the health check, CreateHealthCheck returned the ID in the response, in the HealthCheckId element.

    If you want to get the last failure reason for a calculated health check, you must use the Amazon Route 53 console or the CloudWatch console. You can't use GetHealthCheckLastFailureReason for a calculated health check.

Raises:

Source code in docs_src/capo_route_53/_services/async_route53.py
async def get_health_check_last_failure_reason(
    self,
    health_check_id: "capo_route_53.types.health_check_id.HealthCheckId",
    *,
    config_overrides: Optional[AsyncRoute53ClientConfig] = None,
) -> "capo_route_53.types.get_health_check_last_failure_reason_response.GetHealthCheckLastFailureReasonResponse":
    """<p>Gets the reason that a specified health check failed most recently.</p>

    Args:
        health_check_id: <p>The ID for the health check for which you want the last failure reason. When you created the health check, <code>CreateHealthCheck</code> returned the ID in the response, in the <code>HealthCheckId</code> element.</p> <note> <p>If you want to get the last failure reason for a calculated health check, you must use the Amazon Route 53 console or the CloudWatch console. You can't use <code>GetHealthCheckLastFailureReason</code> for a calculated health check.</p> </note>

    Raises:
        capo_route_53.errors.invalid_input.InvalidInput: <p>The input is not valid.</p>
        capo_route_53.errors.no_such_health_check.NoSuchHealthCheck: <p>No health check exists with the specified ID.</p>
        capo_route_53.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_route_53.types.get_health_check_last_failure_reason_request.GetHealthCheckLastFailureReasonRequest]",
    ) -> AsyncOperationResponse[
        "capo_route_53.types.get_health_check_last_failure_reason_response.GetHealthCheckLastFailureReasonResponse"
    ]:
        import capo_route_53._operations.aws_dns_v20130401.get_health_check_last_failure_reason

        (
            output,
            http_response,
        ) = await capo_route_53._operations.aws_dns_v20130401.get_health_check_last_failure_reason.async_get_health_check_last_failure_reason(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetHealthCheckLastFailureReason")
    )
    input_: capo_route_53.types.get_health_check_last_failure_reason_request.GetHealthCheckLastFailureReasonRequest = {
        "health_check_id": health_check_id
    }

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