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);
}
}
Aggregations