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 classZone.BuilderBuilder 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 ChangeRequestapplyChangeRequest(ChangeRequestInfo changeRequest, Dns.ChangeRequestOption... options)SubmitsChangeRequestInfoto the service for it to applied to this zone.booleandelete()Deletes the zone.booleanequals(Object obj)ChangeRequestgetChangeRequest(String changeRequestId, Dns.ChangeRequestOption... options)Retrieves an updated information about a change request previously submitted to be applied to this zone.DnsgetDns()Returns theDnsservice object associated with this zone.inthashCode()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 allRecordSets associated with this zone.Zonereload(Dns.ZoneOption... options)Retrieves the latest information about the zone.Zone.BuildertoBuilder()Returns a builder forZoneInfoprepopulated 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:ZoneInfoReturns a builder forZoneInfoprepopulated 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
nullif not not found - Throws:
DnsException- upon failure
-
delete
public boolean delete()
Deletes the zone. The method deletes the zone by name.- Returns:
trueis zone was found and deleted andfalseotherwise- Throws:
DnsException- upon failure
-
listRecordSets
public com.google.api.gax.paging.Page<RecordSet> listRecordSets(Dns.RecordSetListOption... options)
Lists allRecordSets associated with this zone. The method searches for zone by name.- Parameters:
options- optional restriction on listing and fields ofRecordSets 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)
SubmitsChangeRequestInfoto the service for it to applied to this zone. The method searches for zone by name.- Parameters:
options- optional restriction on what fields ofChangeRequestshould 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 aChangeRequestornullif the change request was not found. ThrowsDnsExceptionif the zone is not found.- Parameters:
options- optional restriction on what fields ofChangeRequestshould be returned- Returns:
- updated ChangeRequest
- Throws:
DnsException- upon failure or if the zone is not foundNullPointerException- ifchangeRequestIdis 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 ofChangeRequests.- 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
-
-