Skip to content

Commit

Permalink
Fixed readme and added List import.
Browse files Browse the repository at this point in the history
  • Loading branch information
mderka committed Mar 16, 2016
1 parent ece193c commit 244e30f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ DnsRecord toCreate = DnsRecord.builder("www.someexampledomain.com.", DnsRecord.T
.ttl(24, TimeUnit.HOURS)
.addRecord(ip)
.build();
ChangeRequest changeRequest = ChangeRequest.builder().add(toCreate).build();
ChangeRequest.Builder changeBuilder = ChangeRequest.builder().add(toCreate);
// Verify that the record does not exist yet.
// If it does exist, we will overwrite it with our prepared record.
Expand All @@ -282,6 +282,7 @@ while (recordIterator.hasNext()) {
}
}
ChangeRequest changeRequest = changeBuilder.build();
zone.applyChangeRequest(changeRequest);
```
Expand Down
15 changes: 10 additions & 5 deletions gcloud-java-dns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,11 @@ DNS records in `gcloud-java-dns` are managed inside containers called "zones". `
which encapsulates metadata that describe a zone in Google Cloud DNS. `Zone`, a subclass of `ZoneInfo`, adds service-related
functionality over `ZoneInfo`.

*Important: Zone must be unique to the project. If you choose a zone name that already
*Important: Zone names must be unique to the project. If you choose a zone name that already
exists within your project, you'll get a helpful error message telling you to choose another name. In the code below,
replace "my-unique-zone" with a unique zone name. See more about naming rules [here](https://cloud.google.com/dns/api/v1/managedZones#name).*

In this code snippet, we create a new zone in which we intend to
manage DNS record for domain `someexampledomain.com.`
In this code snippet, we create a new zone to manage DNS records for domain `someexampledomain.com.`

*Important: The service may require that you verify ownership of the domain for which you are creating a zone.
Hence, we recommend that you do so beforehand. You can verify ownership of
Expand Down Expand Up @@ -133,7 +132,13 @@ You now have an empty zone hosted in Google Cloud DNS which is ready to be popul
records for domain name `someexampledomain.com.` Upon creating the zone, the cloud service
assigned a set of DNS servers to host records for this zone and
created the required SOA and NS records for the domain. The following snippet prints the list of servers
assigned to the zone created above.
assigned to the zone created above. First, import

```java
import java.util.List;
```

and then add

```java
// Print assigned name servers
Expand Down Expand Up @@ -324,7 +329,7 @@ we create a type A record for a zone, or update an existing type A record to a n
demonstrate how to delete a zone in [DeleteZone.java](../gcloud-java-examples/src/main/java/com/google/gcloud/examples/dns/snippets/DeleteZone.java).
Finally, in [ManipulateZonesAndRecords.java](../gcloud-java-examples/src/main/java/com/google/gcloud/examples/dns/snippets/ManipulateZonesAndRecords.java)
we assemble all the code snippets together and create zone, create or update a DNS record, list zones, list DNS records, list changes, and
delete a zone. The applications assume that they are running on Compute Engine or from your own desktop. To run the example on App
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
Engine, simply move the code from the main method to your application's servlet class and change the
print statements to display on your webpage.

Expand Down

0 comments on commit 244e30f

Please sign in to comment.