Class HttpDnsRpc

  • All Implemented Interfaces:
    DnsRpc, com.google.cloud.ServiceRpc

    public class HttpDnsRpc
    extends Object
    implements DnsRpc
    A default implementation of the DnsRpc interface.
    • Constructor Detail

      • HttpDnsRpc

        public HttpDnsRpc​(DnsOptions options)
        Constructs an instance of this rpc client with provided DnsOptions.
    • Method Detail

      • create

        public com.google.api.services.dns.model.ManagedZone create​(com.google.api.services.dns.model.ManagedZone zone,
                                                                    Map<DnsRpc.Option,​?> options)
                                                             throws DnsException
        Description copied from interface: DnsRpc
        Creates a new zone.
        Specified by:
        create in interface DnsRpc
        Parameters:
        zone - a zone to be created
        options - a map of options for the service call
        Returns:
        Updated ManagedZone object
        Throws:
        DnsException - upon failure
      • getZone

        public com.google.api.services.dns.model.ManagedZone getZone​(String zoneName,
                                                                     Map<DnsRpc.Option,​?> options)
                                                              throws DnsException
        Description copied from interface: DnsRpc
        Retrieves and returns an existing zone.
        Specified by:
        getZone in interface DnsRpc
        Parameters:
        zoneName - name of the zone to be returned
        options - a map of options for the service call
        Returns:
        a zone or null if not found
        Throws:
        DnsException - upon failure
      • deleteZone

        public boolean deleteZone​(String zoneName)
                           throws DnsException
        Description copied from interface: DnsRpc
        Deletes the zone identified by the name.
        Specified by:
        deleteZone in interface DnsRpc
        Returns:
        true if the zone was deleted and false otherwise
        Throws:
        DnsException - upon failure
      • listRecordSets

        public DnsRpc.ListResult<com.google.api.services.dns.model.ResourceRecordSet> listRecordSets​(String zoneName,
                                                                                                     Map<DnsRpc.Option,​?> options)
                                                                                              throws DnsException
        Description copied from interface: DnsRpc
        Lists record sets for a given zone.
        Specified by:
        listRecordSets in interface DnsRpc
        Parameters:
        zoneName - name of the zone to be listed
        options - a map of options for the service call
        Throws:
        DnsException - upon failure or if zone was not found
      • getProject

        public com.google.api.services.dns.model.Project getProject​(Map<DnsRpc.Option,​?> options)
                                                             throws DnsException
        Description copied from interface: DnsRpc
        Returns information about the current project.
        Specified by:
        getProject in interface DnsRpc
        Parameters:
        options - a map of options for the service call
        Returns:
        up-to-date project information
        Throws:
        DnsException - upon failure or if the project is not found
      • applyChangeRequest

        public com.google.api.services.dns.model.Change applyChangeRequest​(String zoneName,
                                                                           com.google.api.services.dns.model.Change changeRequest,
                                                                           Map<DnsRpc.Option,​?> options)
                                                                    throws DnsException
        Description copied from interface: DnsRpc
        Applies change request to a zone.
        Specified by:
        applyChangeRequest in interface DnsRpc
        Parameters:
        zoneName - the name of a zone to which the Change should be applied
        changeRequest - change to be applied
        options - a map of options for the service call
        Returns:
        updated change object with server-assigned ID
        Throws:
        DnsException - upon failure or if zone was not found
      • getChangeRequest

        public com.google.api.services.dns.model.Change getChangeRequest​(String zoneName,
                                                                         String changeRequestId,
                                                                         Map<DnsRpc.Option,​?> options)
                                                                  throws DnsException
        Description copied from interface: DnsRpc
        Returns an existing change request.
        Specified by:
        getChangeRequest in interface DnsRpc
        Parameters:
        zoneName - the name of a zone to which the Change was be applied
        changeRequestId - the unique id assigned to the change by the server
        options - a map of options for the service call
        Returns:
        up-to-date change object or null if change was not found
        Throws:
        DnsException - upon failure or if zone was not found
      • listChangeRequests

        public DnsRpc.ListResult<com.google.api.services.dns.model.Change> listChangeRequests​(String zoneName,
                                                                                              Map<DnsRpc.Option,​?> options)
                                                                                       throws DnsException
        Description copied from interface: DnsRpc
        List existing change requests for a zone.
        Specified by:
        listChangeRequests in interface DnsRpc
        Parameters:
        zoneName - the name of a zone to which the Changes were be applied
        options - a map of options for the service call
        Throws:
        DnsException - upon failure or if zone was not found
      • createBatch

        public RpcBatch createBatch()
        Description copied from interface: DnsRpc
        Creates an empty batch.
        Specified by:
        createBatch in interface DnsRpc