Sha256: ef6f510053819f273be4929363d65a388dbcf1cf79cbe03e1336cc3671785497

Contents?: true

Size: 1.43 KB

Versions: 38

Compression:

Stored size: 1.43 KB

Contents

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

module Fog
  module DNS
    class Bluebox

      class Zone < Fog::Model

        identity :id

        attribute :domain,        :aliases => 'name'
        attribute :serial
        attribute :ttl
        attribute :retry
        attribute :expires
        attribute :record_count,  :aliases => 'record-count'
        attribute :refresh
        attribute :minimum

        def initialize(attributes = {})
          self.ttl ||= 3600
          super(attributes)
        end

        def destroy
          raise Fog::Errors::Error.new('Not implemented')
        end

        def records
          @records ||= begin
            Fog::DNS::Bluebox::Records.new(
              :zone       => self,
              :connection => connection
            )
          end
        end

        def nameservers
          [
            'ns1.blueblxgrid.com',
            'ns2.blueblxgrid.com',
            'ns3.blueblxgrid.com'
          ]
        end

        def destroy
          requires :identity
          connection.delete_zone(identity)
          true
        end

        def save
          requires :domain, :ttl
          options = attributes.dup
          options[:name] = options.delete(:domain)
          data = identity.nil? ? connection.create_zone(options) : connection.update_zone(identity, options)
          merge_attributes(data.body)
          true
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 13 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/bluebox/models/dns/zone.rb
fog-nirvanix-1.8.1 lib/fog/bluebox/models/dns/zone.rb
fog-parser-fix-1.6.1 lib/fog/bluebox/models/dns/zone.rb
fog-test-again-1.6.0 lib/fog/bluebox/models/dns/zone.rb
fog-parser-fix-1.6.0 lib/fog/bluebox/models/dns/zone.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/bluebox/models/dns/zone.rb
fog-sgonyea-1.8.1 lib/fog/bluebox/models/dns/zone.rb
fog-1.8.0 lib/fog/bluebox/models/dns/zone.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/bluebox/models/dns/zone.rb
fog-1.7.0 lib/fog/bluebox/models/dns/zone.rb
fog-1.6.0 lib/fog/bluebox/models/dns/zone.rb
fog-1.5.0 lib/fog/bluebox/models/dns/zone.rb
fog-1.4.0 lib/fog/bluebox/models/dns/zone.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/bluebox/models/dns/zone.rb
michiels-fog-1.3.1 lib/fog/bluebox/models/dns/zone.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/bluebox/models/dns/zone.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/bluebox/models/dns/zone.rb
fog-1.3.1 lib/fog/bluebox/models/dns/zone.rb
fog-1.3.0 lib/fog/bluebox/models/dns/zone.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/bluebox/models/dns/zone.rb