Search in sources :

Example 1 with GetHealthCheckStatusResponse

use of software.amazon.awssdk.services.route53.model.GetHealthCheckStatusResponse in project aws-doc-sdk-examples by awsdocs.

the class GetHealthCheckStatus method getHealthStatus.

// snippet-start:[route53.java2.get_health_check_status.main]
public static void getHealthStatus(Route53Client route53Client, String healthCheckId) {
    try {
        GetHealthCheckStatusRequest statusRequest = GetHealthCheckStatusRequest.builder().healthCheckId(healthCheckId).build();
        GetHealthCheckStatusResponse statusResponse = route53Client.getHealthCheckStatus(statusRequest);
        List<HealthCheckObservation> observations = statusResponse.healthCheckObservations();
        for (HealthCheckObservation observation : observations) {
            System.out.println("(The health check observation status: " + observation.statusReport().status());
        }
    } catch (Route53Exception e) {
        System.err.println(e.getMessage());
        System.exit(1);
    }
}
Also used : GetHealthCheckStatusRequest(software.amazon.awssdk.services.route53.model.GetHealthCheckStatusRequest) GetHealthCheckStatusResponse(software.amazon.awssdk.services.route53.model.GetHealthCheckStatusResponse) Route53Exception(software.amazon.awssdk.services.route53.model.Route53Exception) HealthCheckObservation(software.amazon.awssdk.services.route53.model.HealthCheckObservation)

Aggregations

GetHealthCheckStatusRequest (software.amazon.awssdk.services.route53.model.GetHealthCheckStatusRequest)1 GetHealthCheckStatusResponse (software.amazon.awssdk.services.route53.model.GetHealthCheckStatusResponse)1 HealthCheckObservation (software.amazon.awssdk.services.route53.model.HealthCheckObservation)1 Route53Exception (software.amazon.awssdk.services.route53.model.Route53Exception)1