See: Description
Interface | Description |
---|---|
Dns |
An interface for the Google Cloud DNS service.
|
DnsFactory |
An interface for Dns factories.
|
Class | Description |
---|---|
ChangeRequest |
An immutable class representing an atomic update to a collection of
RecordSet s within a
Zone . |
ChangeRequest.Builder |
A builder for
ChangeRequest s. |
ChangeRequestInfo |
A class representing an atomic update to a collection of
RecordSet s within a Zone . |
ChangeRequestInfo.Builder |
A builder for
ChangeRequestInfo . |
ChangeRequestInfo.Status |
This enumerates the possible states of a change request.
|
Dns.ChangeRequestListOption |
Class for specifying change request listing options.
|
Dns.ChangeRequestOption |
Class for specifying change request field options.
|
Dns.ProjectOption |
Class for specifying project options.
|
Dns.RecordSetListOption |
Class for specifying record set listing options.
|
Dns.ZoneListOption |
Class for specifying zone listing options.
|
Dns.ZoneOption |
Class for specifying zone field options.
|
DnsBatch |
A batch of operations to be submitted to Google Cloud DNS using a single RPC request.
|
DnsBatchResult<T> |
This class holds a single result of a batch call to the Cloud DNS.
|
DnsOptions | |
DnsOptions.Builder | |
DnsOptions.DefaultDnsFactory | |
DnsOptions.DefaultDnsRpcFactory | |
ProjectInfo |
The class provides the Google Cloud DNS information associated with this project.
|
ProjectInfo.Quota |
This class represents quotas assigned to the
ProjectInfo . |
RecordSet |
A class that represents a Google Cloud DNS record set.
|
RecordSet.Builder |
A builder for
RecordSet . |
RecordSet.Type |
Enum for the DNS record types supported by Cloud DNS.
|
Zone |
A Google Cloud DNS Zone object.
|
Zone.Builder |
Builder for
Zone . |
ZoneInfo |
A
Zone represents a DNS zone hosted by the Google Cloud DNS service. |
ZoneInfo.Builder |
Builder for
ZoneInfo . |
Enum | Description |
---|---|
Dns.ChangeRequestField |
The fields of a change request.
|
Dns.ProjectField |
The fields of a project.
|
Dns.RecordSetField |
The fields of a record set.
|
Dns.SortingOrder |
The sorting order for listing.
|
Dns.ZoneField |
The fields of a zone.
|
Exception | Description |
---|---|
DnsException |
DNS service exception.
|
Here are two simple usage examples from within Compute/App Engine.
The first snippet shows how to create a zone resource. The complete source code can be found
on
CreateAndListZones.java. Note that you need to replace the domainName
with a domain
name that you own and the ownership of which you verified with Google.
Dns dns = DnsOptions.getDefaultInstance().getService();
String zoneName = "my-unique-zone";
String domainName = "someexampledomain.com.";
String description = "This is a google-cloud-dns sample zone.";
ZoneInfo zoneInfo = ZoneInfo.of(zoneName, domainName, description);
Zone createdZone = dns.create(zoneInfo);
The second example shows how to create records inside a zone. The complete code can be found on CreateAndListDnsRecords.java.
Dns dns = DnsOptions.getDefaultInstance().getService();
String zoneName = "my-unique-zone";
Zone zone = dns.getZone(zoneName);
String ip = "12.13.14.15";
RecordSet toCreate = RecordSet.newBuilder("www.someexampledomain.com.", RecordSet.Type.A)
.setTtl(24, TimeUnit.HOURS)
.addRecord(ip)
.build();
ChangeRequestInfo changeRequest = ChangeRequestInfo.newBuilder().add(toCreate).build();
zone.applyChangeRequest(changeRequest);
When using google-cloud from outside of App/Compute Engine, you have to specify a project ID and provide credentials.
Copyright © 2019 Google LLC. All rights reserved.