Sha256: ee2736eb78d665085c6d383ba52d1dcea52727b252ef999718f58c0987875e74

Contents?: true

Size: 1.21 KB

Versions: 59

Compression:

Stored size: 1.21 KB

Contents

require 'fog/core/model'
require 'fog/dreamhost/models/dns/records'

module Fog
  module DNS
    class Dreamhost 

      #
      # Dreamhost API has no concept of 'Zone', but we
      # can emulate it.
      #
      # http://wiki.dreamhost.com/API/Dns_commands
      #
      class Zone < Fog::Model

        identity :id
        attribute :domain,     :aliases => 'name'

        # 
        # There's no destroy API call
        #
        def destroy
          raise NotImplementedError.new
        end

        #
        # Return a list of records for this zone
        #
        # Since Dreamhost does not support zones, this is
        # emulated. Iterates over all the records and discards
        # the ones where Record.zone != domain (the current zone domain)
        #
        def records
          service.records.all :zone => domain
        end

        #
        # Return the Dreamhost nameserver list
        #
        def nameservers
          [
           "ns1.dreamhost.com",
           "ns2.dreamhost.com",
           "ns3.dreamhost.com",
          ]
        end

        # 
        # There's no zone create API call
        #
        def save
          raise NotImplementedError.new
        end

      end

    end
  end
end

Version data entries

59 entries across 59 versions & 6 rubygems

Version Path
fog-maestrodev-1.20.0.20140305101839 lib/fog/dreamhost/models/dns/zone.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/dreamhost/models/dns/zone.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/dreamhost/models/dns/zone.rb
fog-1.20.0 lib/fog/dreamhost/models/dns/zone.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/dreamhost/models/dns/zone.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/dreamhost/models/dns/zone.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/dreamhost/models/dns/zone.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/dreamhost/models/dns/zone.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/dreamhost/models/dns/zone.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/dreamhost/models/dns/zone.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/dreamhost/models/dns/zone.rb
fog-1.19.0 lib/fog/dreamhost/models/dns/zone.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/dreamhost/models/dns/zone.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/dreamhost/models/dns/zone.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/dreamhost/models/dns/zone.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/dreamhost/models/dns/zone.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/dreamhost/models/dns/zone.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/dreamhost/models/dns/zone.rb
fog-maestrodev-1.18.0.20131209090811 lib/fog/dreamhost/models/dns/zone.rb
fog-maestrodev-1.18.0.20131206115947 lib/fog/dreamhost/models/dns/zone.rb