Search in sources :

Example 1 with UpdateHealthCheckRequest

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

the class UpdateHealthCheck method updateSpecificHealthCheck.

// snippet-start:[route53.java2.update_health_check.main]
public static void updateSpecificHealthCheck(Route53Client route53Client, String id) {
    try {
        UpdateHealthCheckRequest checkRequest = UpdateHealthCheckRequest.builder().healthCheckId(id).disabled(true).build();
        // Update the Health Check
        UpdateHealthCheckResponse healthResponse = route53Client.updateHealthCheck(checkRequest);
        System.out.println("The health check with id " + healthResponse.healthCheck().id() + " was updated!");
    } catch (Route53Exception e) {
        System.err.println(e.getMessage());
        System.exit(1);
    }
}
Also used : UpdateHealthCheckResponse(software.amazon.awssdk.services.route53.model.UpdateHealthCheckResponse) Route53Exception(software.amazon.awssdk.services.route53.model.Route53Exception) UpdateHealthCheckRequest(software.amazon.awssdk.services.route53.model.UpdateHealthCheckRequest)

Aggregations

Route53Exception (software.amazon.awssdk.services.route53.model.Route53Exception)1 UpdateHealthCheckRequest (software.amazon.awssdk.services.route53.model.UpdateHealthCheckRequest)1 UpdateHealthCheckResponse (software.amazon.awssdk.services.route53.model.UpdateHealthCheckResponse)1