Search in sources :

Example 6 with Route53Exception

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

Example 7 with Route53Exception

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 "";
}
Also used : CreateHostedZoneResponse(software.amazon.awssdk.services.route53.model.CreateHostedZoneResponse) Route53Exception(software.amazon.awssdk.services.route53.model.Route53Exception) CreateHostedZoneRequest(software.amazon.awssdk.services.route53.model.CreateHostedZoneRequest)

Example 8 with Route53Exception

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);
    }
}
Also used : Route53Exception(software.amazon.awssdk.services.route53.model.Route53Exception) DeleteHealthCheckRequest(software.amazon.awssdk.services.route53.model.DeleteHealthCheckRequest)

Example 9 with Route53Exception

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);
    }
}
Also used : HostedZone(software.amazon.awssdk.services.route53.model.HostedZone) Route53Exception(software.amazon.awssdk.services.route53.model.Route53Exception) ListHostedZonesResponse(software.amazon.awssdk.services.route53.model.ListHostedZonesResponse)

Aggregations

Route53Exception (software.amazon.awssdk.services.route53.model.Route53Exception)9 CreateHealthCheckRequest (software.amazon.awssdk.services.route53.model.CreateHealthCheckRequest)1 CreateHealthCheckResponse (software.amazon.awssdk.services.route53.model.CreateHealthCheckResponse)1 CreateHostedZoneRequest (software.amazon.awssdk.services.route53.model.CreateHostedZoneRequest)1 CreateHostedZoneResponse (software.amazon.awssdk.services.route53.model.CreateHostedZoneResponse)1 DeleteHealthCheckRequest (software.amazon.awssdk.services.route53.model.DeleteHealthCheckRequest)1 DeleteHostedZoneRequest (software.amazon.awssdk.services.route53.model.DeleteHostedZoneRequest)1 GetHealthCheckStatusRequest (software.amazon.awssdk.services.route53.model.GetHealthCheckStatusRequest)1 GetHealthCheckStatusResponse (software.amazon.awssdk.services.route53.model.GetHealthCheckStatusResponse)1 HealthCheck (software.amazon.awssdk.services.route53.model.HealthCheck)1 HealthCheckConfig (software.amazon.awssdk.services.route53.model.HealthCheckConfig)1 HealthCheckObservation (software.amazon.awssdk.services.route53.model.HealthCheckObservation)1 HostedZone (software.amazon.awssdk.services.route53.model.HostedZone)1 ListHealthChecksResponse (software.amazon.awssdk.services.route53.model.ListHealthChecksResponse)1 ListHostedZonesResponse (software.amazon.awssdk.services.route53.model.ListHostedZonesResponse)1 ListResourceRecordSetsRequest (software.amazon.awssdk.services.route53.model.ListResourceRecordSetsRequest)1 ListResourceRecordSetsResponse (software.amazon.awssdk.services.route53.model.ListResourceRecordSetsResponse)1 ResourceRecordSet (software.amazon.awssdk.services.route53.model.ResourceRecordSet)1 UpdateHealthCheckRequest (software.amazon.awssdk.services.route53.model.UpdateHealthCheckRequest)1 UpdateHealthCheckResponse (software.amazon.awssdk.services.route53.model.UpdateHealthCheckResponse)1