Search in sources :

Example 1 with ListHostedZonesResponse

use of software.amazon.awssdk.services.route53.model.ListHostedZonesResponse 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

HostedZone (software.amazon.awssdk.services.route53.model.HostedZone)1 ListHostedZonesResponse (software.amazon.awssdk.services.route53.model.ListHostedZonesResponse)1 Route53Exception (software.amazon.awssdk.services.route53.model.Route53Exception)1