Class 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.

    See Also:
    Google Cloud DNS managed zone documentation, Serialized Form
    • Method Detail

      • toBuilder

        public Zone.Builder toBuilder()
        Description copied from class: ZoneInfo
        Returns a builder for ZoneInfo prepopulated with the metadata of this zone.
        Overrides:
        toBuilder in class ZoneInfo
      • 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 and false otherwise
        Throws:
        DnsException - upon failure
      • listRecordSets

        public com.google.api.gax.paging.Page<RecordSet> listRecordSets​(Dns.RecordSetListOption... options)
        Lists all RecordSets associated with this zone. The method searches for zone by name.
        Parameters:
        options - optional restriction on listing and fields of RecordSets returned
        Returns:
        a page of record sets
        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 a ChangeRequest or null if the change request was not found. Throws DnsException if the zone is not found.
        Parameters:
        options - optional restriction on what fields of ChangeRequest should be returned
        Returns:
        updated ChangeRequest
        Throws:
        DnsException - upon failure or if the zone is not found
        NullPointerException - if changeRequestId 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 of ChangeRequests.
        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
      • getDns

        public Dns getDns()
        Returns the Dns service object associated with this zone.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class ZoneInfo