Search in sources :

Example 1 with ListResourceRecordSetsResponse

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

the class ListResourceRecordSets method listResourceRecord.

// snippet-start:[route.java2.list_records.main]
public static void listResourceRecord(Route53Client route53Client, String hostedZoneId) {
    try {
        ListResourceRecordSetsRequest request = ListResourceRecordSetsRequest.builder().hostedZoneId(hostedZoneId).maxItems("12").build();
        ListResourceRecordSetsResponse listResourceRecordSets = route53Client.listResourceRecordSets(request);
        List<ResourceRecordSet> records = listResourceRecordSets.resourceRecordSets();
        for (ResourceRecordSet record : records) {
            System.out.println("The Record name is: " + record.name());
        }
    } catch (Route53Exception e) {
        System.err.println(e.getMessage());
        System.exit(1);
    }
}
Also used : ResourceRecordSet(software.amazon.awssdk.services.route53.model.ResourceRecordSet) Route53Exception(software.amazon.awssdk.services.route53.model.Route53Exception) ListResourceRecordSetsRequest(software.amazon.awssdk.services.route53.model.ListResourceRecordSetsRequest) ListResourceRecordSetsResponse(software.amazon.awssdk.services.route53.model.ListResourceRecordSetsResponse)

Aggregations

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 Route53Exception (software.amazon.awssdk.services.route53.model.Route53Exception)1