Sha256: bbae1bba2710e33a07dd679ecec1f59fff6387e9c74413c3cc47568372acdba8

Contents?: true

Size: 1.12 KB

Versions: 45

Compression:

Stored size: 1.12 KB

Contents

require 'fog/core/model'

module Fog
  module DNS
    class Bluebox

      class Record < Fog::Model
        extend Fog::Deprecation
        deprecate :ip, :value
        deprecate :ip=, :value=

        identity :id

        attribute :name
        attribute :domain_id,   :aliases => 'domain-id'
        attribute :domain
        attribute :type
        attribute :value,       :aliases => 'content'

        def initialize(attributes={})
          super
        end

        def destroy
          requires :identity
          connection.delete_record(@zone.identity, identity)
          true
        end

        def zone
          @zone
        end

        def save
          requires :zone, :type, :name, :value
          data = unless identity
            connection.create_record(zone.identity, type, name, value)
          else
            connection.update_record(zone.identity, identity, {:type => type, :name => name, :content => value})
          end
          merge_attributes(data.body)
          true
        end

        private

        def zone=(new_zone)
          @zone = new_zone
        end

      end

    end
  end
end

Version data entries

45 entries across 45 versions & 14 rubygems

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