// String name = findHost(recordset.fqdn, domainName);
DnsZoneSpec zoneSpec = new DnsZoneSpec();
zoneSpec.name = domainName;
DnsZone zone = findOrCreateDomain(project, zoneSpec);
DnsRecordsetData.Builder data = DnsRecordsetData.newBuilder();
data.setProjectId(project.getId());
for (DnsRecordSpec record : recordsetSpec.records) {
// Sanity check
InetAddress address = InetAddresses.forString(record.address);
String ip = InetAddresses.toAddrString(address);
DnsRecordData.Builder recordBuilder = data.addRecordBuilder();
recordBuilder.setTarget(ip);
}
data.setType(recordsetSpec.type);
data.setFqdn(recordsetSpec.fqdn);
data.setZoneId(zone.getId());
data.setSystemKey(systemKey);
recordsets.add(data.build());
}