use of software.amazon.awssdk.services.route53.model.Route53Exception 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);
}
}
use of software.amazon.awssdk.services.route53.model.Route53Exception in project aws-doc-sdk-examples by awsdocs.
the class CreateHostedZone method createZone.
// snippet-start:[route53.java2.create_hosted_zone.main]
public static String createZone(Route53Client route53Client, String domainName) {
try {
// You must use a unique CallerReference string every time you submit a CreateHostedZone request
String callerReference = java.util.UUID.randomUUID().toString();
CreateHostedZoneRequest zoneRequest = CreateHostedZoneRequest.builder().callerReference(callerReference).name(domainName).build();
// Create the Hosted Zone
CreateHostedZoneResponse zoneResponse = route53Client.createHostedZone(zoneRequest);
return zoneResponse.hostedZone().id();
} catch (Route53Exception e) {
System.err.println(e.getMessage());
System.exit(1);
}
return "";
}
use of software.amazon.awssdk.services.route53.model.Route53Exception in project aws-doc-sdk-examples by awsdocs.
the class DeleteHealthCheck method delHealthCheck.
// snippet-start:[route53.java2.delete_health_check.main]
public static void delHealthCheck(Route53Client route53Client, String id) {
try {
DeleteHealthCheckRequest delRequest = DeleteHealthCheckRequest.builder().healthCheckId(id).build();
// Delete the Health Check
route53Client.deleteHealthCheck(delRequest);
System.out.println("The hosted zone was deleted");
} catch (Route53Exception e) {
System.err.println(e.getMessage());
System.exit(1);
}
}
use of software.amazon.awssdk.services.route53.model.Route53Exception in project aws-doc-sdk-examples by awsdocs.
the class ListHostedZones method listZones.
// snippet-start:[route.java2.list_zones.main]
public static void listZones(Route53Client route53Client) {
try {
ListHostedZonesResponse zonesResponse = route53Client.listHostedZones();
List<HostedZone> checklist = zonesResponse.hostedZones();
for (HostedZone check : checklist) {
System.out.println("The name is : " + check.name());
}
} catch (Route53Exception e) {
System.err.println(e.getMessage());
System.exit(1);
}
}
Aggregations