Package com.google.cloud.dns
Class Zone
- java.lang.Object
-
- com.google.cloud.dns.ZoneInfo
-
- com.google.cloud.dns.Zone
-
- All Implemented Interfaces:
Serializable
public class Zone extends ZoneInfo
A Google Cloud DNS Zone object.A zone is the container for all of your record sets that share the same DNS name prefix, for example, example.com. Zones are automatically assigned a set of name servers when they are created to handle responding to DNS queries for that zone. A zone has quotas for the number of record sets that it can include.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Zone.Builder
Builder forZone
.-
Nested classes/interfaces inherited from class com.google.cloud.dns.ZoneInfo
ZoneInfo.DnsSecConfig, ZoneInfo.KeySpec
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChangeRequest
applyChangeRequest(ChangeRequestInfo changeRequest, Dns.ChangeRequestOption... options)
SubmitsChangeRequestInfo
to the service for it to applied to this zone.boolean
delete()
Deletes the zone.boolean
equals(Object obj)
ChangeRequest
getChangeRequest(String changeRequestId, Dns.ChangeRequestOption... options)
Retrieves an updated information about a change request previously submitted to be applied to this zone.Dns
getDns()
Returns theDns
service object associated with this zone.int
hashCode()
com.google.api.gax.paging.Page<ChangeRequest>
listChangeRequests(Dns.ChangeRequestListOption... options)
Retrieves all change requests for this zone.com.google.api.gax.paging.Page<RecordSet>
listRecordSets(Dns.RecordSetListOption... options)
Lists allRecordSet
s associated with this zone.Zone
reload(Dns.ZoneOption... options)
Retrieves the latest information about the zone.Zone.Builder
toBuilder()
Returns a builder forZoneInfo
prepopulated with the metadata of this zone.-
Methods inherited from class com.google.cloud.dns.ZoneInfo
getCreationTimeMillis, getDescription, getDnsName, getDnsSecConfig, getGeneratedId, getLabels, getName, getNameServers, getNameServerSet, newBuilder, of, toString
-
-
-
-
Method Detail
-
toBuilder
public Zone.Builder toBuilder()
Description copied from class:ZoneInfo
Returns a builder forZoneInfo
prepopulated with the metadata of this zone.
-
reload
public Zone reload(Dns.ZoneOption... options)
Retrieves the latest information about the zone. The method retrieves the zone by name.- Parameters:
options
- optional restriction on what fields should be fetched- Returns:
- zone object containing updated information or
null
if not not found - Throws:
DnsException
- upon failure
-
delete
public boolean delete()
Deletes the zone. The method deletes the zone by name.- Returns:
true
is zone was found and deleted andfalse
otherwise- Throws:
DnsException
- upon failure
-
listRecordSets
public com.google.api.gax.paging.Page<RecordSet> listRecordSets(Dns.RecordSetListOption... options)
Lists allRecordSet
s associated with this zone. The method searches for zone by name.- Parameters:
options
- optional restriction on listing and fields ofRecordSet
s returned- Returns:
- a page of record sets
- Throws:
DnsException
- upon failure or if the zone is not found
-
applyChangeRequest
public ChangeRequest applyChangeRequest(ChangeRequestInfo changeRequest, Dns.ChangeRequestOption... options)
SubmitsChangeRequestInfo
to the service for it to applied to this zone. The method searches for zone by name.- Parameters:
options
- optional restriction on what fields ofChangeRequest
should be returned- Returns:
- ChangeRequest with server-assigned ID
- Throws:
DnsException
- upon failure or if the zone is not found
-
getChangeRequest
public ChangeRequest getChangeRequest(String changeRequestId, Dns.ChangeRequestOption... options)
Retrieves an updated information about a change request previously submitted to be applied to this zone. Returns aChangeRequest
ornull
if the change request was not found. ThrowsDnsException
if the zone is not found.- Parameters:
options
- optional restriction on what fields ofChangeRequest
should be returned- Returns:
- updated ChangeRequest
- Throws:
DnsException
- upon failure or if the zone is not foundNullPointerException
- ifchangeRequestId
is null
-
listChangeRequests
public com.google.api.gax.paging.Page<ChangeRequest> listChangeRequests(Dns.ChangeRequestListOption... options)
Retrieves all change requests for this zone. The method searches for zone by name. Returns a page ofChangeRequest
s.- Parameters:
options
- optional restriction on listing and fields to be returned- Returns:
- a page of change requests
- Throws:
DnsException
- upon failure or if the zone is not found
-
-