You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The second snippet shows how to create records inside a zone. The complete code can be found on [CreateOrUpdateDnsRecords.java](./gcloud-java-examples/src/main/java/com/google/gcloud/examples/dns/snippets/CreateOrUpdateDnsRecords.java).
252
+
The second snippet shows how to create records inside a zone. The complete code can be found on [CreateOrUpdateRecordSets.java](./gcloud-java-examples/src/main/java/com/google/gcloud/examples/dns/snippets/CreateOrUpdateRecordSets.java).
253
253
254
254
```java
255
255
import com.google.gcloud.dns.ChangeRequest;
256
256
import com.google.gcloud.dns.Dns;
257
257
import com.google.gcloud.dns.DnsOptions;
258
-
import com.google.gcloud.dns.DnsRecord;
258
+
import com.google.gcloud.dns.RecordSet;
259
259
import com.google.gcloud.dns.Zone;
260
260
261
261
import java.util.Iterator;
@@ -265,17 +265,17 @@ Dns dns = DnsOptions.defaultInstance().service();
Copy file name to clipboardExpand all lines: gcloud-java-dns/README.md
+35-35Lines changed: 35 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,15 +92,15 @@ Dns dns = DnsOptions.defaultInstance().service();
92
92
For other authentication options, see the [Authentication](https://github.com/GoogleCloudPlatform/gcloud-java#authentication) page.
93
93
94
94
#### Managing Zones
95
-
DNS records in `gcloud-java-dns` are managed inside containers called "zones". `ZoneInfo` is a class
95
+
Record sets in `gcloud-java-dns` are managed inside containers called "zones". `ZoneInfo` is a class
96
96
which encapsulates metadata that describe a zone in Google Cloud DNS. `Zone`, a subclass of `ZoneInfo`, adds service-related
97
97
functionality over `ZoneInfo`.
98
98
99
99
*Important: Zone names must be unique to the project. If you choose a zone name that already
100
100
exists within your project, you'll get a helpful error message telling you to choose another name. In the code below,
101
101
replace "my-unique-zone" with a unique zone name. See more about naming rules [here](https://cloud.google.com/dns/api/v1/managedZones#name).*
102
102
103
-
In this code snippet, we create a new zone to manage DNS records for domain `someexampledomain.com.`
103
+
In this code snippet, we create a new zone to manage record sets for domain `someexampledomain.com.`
104
104
105
105
*Important: The service may require that you verify ownership of the domain for which you are creating a zone.
106
106
Hence, we recommend that you do so beforehand. You can verify ownership of
@@ -128,8 +128,8 @@ Zone zone = dns.create(zoneInfo);
128
128
System.out.printf("Zone was created and assigned ID %s.%n", zone.id());
129
129
```
130
130
131
-
You now have an empty zone hosted in Google Cloud DNS which is ready to be populated with DNS
132
-
records for domain name `someexampledomain.com.` Upon creating the zone, the cloud service
131
+
You now have an empty zone hosted in Google Cloud DNS which is ready to be populated with
132
+
record sets for domain name `someexampledomain.com.` Upon creating the zone, the cloud service
133
133
assigned a set of DNS servers to host records for this zone and
134
134
created the required SOA and NS records for the domain. The following snippet prints the list of servers
135
135
assigned to the zone created above. First, import
@@ -152,25 +152,25 @@ You can now instruct your domain registrar to [update your domain name servers]
152
152
As soon as this happens and the change propagates through cached values in DNS resolvers,
153
153
all the DNS queries will be directed to and answered by the Google Cloud DNS service.
154
154
155
-
#### Creating DNS Records
156
-
Now that we have a zone, we can add some DNS records. The DNS records held within zones are
155
+
#### Creating Record Sets
156
+
Now that we have a zone, we can add some record sets. The record sets held within zones are
157
157
modified by "change requests". In this example, we create and apply a change request to
158
-
our zone that creates a DNS record of type A and points URL www.someexampledomain.com to
158
+
our zone that creates a record set of type A and points URL www.someexampledomain.com to
159
159
IP address 12.13.14.15. Start by adding
160
160
161
161
```java
162
162
importcom.google.gcloud.dns.ChangeRequest;
163
-
importcom.google.gcloud.dns.DnsRecord;
163
+
importcom.google.gcloud.dns.RecordSet;
164
164
165
165
importjava.util.concurrent.TimeUnit;
166
166
```
167
167
168
168
and proceed with:
169
169
170
170
```java
171
-
// Prepare a www.someexampledomain.com. type A record with ttl of 24 hours
171
+
// Prepare a www.someexampledomain.com. type A record set with ttl of 24 hours
The `addRecord` method of `DnsRecord.Builder` accepts records in the form of
186
-
strings. The format of the strings depends on the type of the DNS record to be added.
187
-
More information on the supported DNS record types and record formats can be found [here](https://cloud.google.com/dns/what-is-cloud-dns#supported_record_types).
185
+
The `addRecord` method of `RecordSet.Builder` accepts records in the form of
186
+
strings. The format of the strings depends on the type of the record sets to be added.
187
+
More information on the supported record set types and record formats can be found [here](https://cloud.google.com/dns/what-is-cloud-dns#supported_record_types).
188
188
189
-
If you already have a DNS record, Cloud DNS will return an error upon an attempt to create a duplicate of it.
190
-
You can modify the code above to create a DNS record or update it if it already exists by making the
189
+
If you already have a record set, Cloud DNS will return an error upon an attempt to create a duplicate of it.
190
+
You can modify the code above to create a record set or update it if it already exists by making the
we create a zone. In [CreateOrUpdateDnsRecords.java](../gcloud-java-examples/src/main/java/com/google/gcloud/examples/dns/snippets/CreateOrUpdateDnsRecords.java)
328
-
we create a type A record for a zone, or update an existing type A record to a new IP address. We
327
+
we create a zone. In [CreateOrUpdateRecordSets.java](../gcloud-java-examples/src/main/java/com/google/gcloud/examples/dns/snippets/CreateOrUpdateRecordSets.java)
328
+
we create a type A record set for a zone, or update an existing type A record set to a new IP address. We
329
329
demonstrate how to delete a zone in [DeleteZone.java](../gcloud-java-examples/src/main/java/com/google/gcloud/examples/dns/snippets/DeleteZone.java).
330
-
Finally, in [ManipulateZonesAndRecords.java](../gcloud-java-examples/src/main/java/com/google/gcloud/examples/dns/snippets/ManipulateZonesAndRecords.java)
331
-
we assemble all the code snippets together and create zone, create or update a DNS record, list zones, list DNS records, list changes, and
330
+
Finally, in [ManipulateZonesAndRecordSets.java](../gcloud-java-examples/src/main/java/com/google/gcloud/examples/dns/snippets/ManipulateZonesAndRecordSets.java)
331
+
we assemble all the code snippets together and create zone, create or update a record set, list zones, list record sets, list changes, and
332
332
delete a zone. The applications assume that they are running on Compute Engine or from your own desktop. To run any of these examples on App
333
333
Engine, simply move the code from the main method to your application's servlet class and change the
0 commit comments