Sha256: d1f02304458a65cc927205a76bdcb5d577f4a7203178ae564da3217d19ceed76

Contents?: true

Size: 1.11 KB

Versions: 39

Compression:

Stored size: 1.11 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
          service.delete_record(@zone.identity, identity)
          true
        end

        def zone
          @zone
        end

        def save
          requires :zone, :type, :name, :value
          data = unless identity
            service.create_record(zone.identity, type, name, value)
          else
            service.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

39 entries across 37 versions & 5 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/bluebox/models/dns/record.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/bluebox/models/dns/record.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/bluebox/models/dns/record.rb
fog-1.42.1 lib/fog/bluebox/models/dns/record.rb
fog-2.0.0 lib/fog/bluebox/models/dns/record.rb
fog-1.42.0 lib/fog/bluebox/models/dns/record.rb
fog-1.41.0 lib/fog/bluebox/models/dns/record.rb
fog-1.40.0 lib/fog/bluebox/models/dns/record.rb
fog-1.39.0 lib/fog/bluebox/models/dns/record.rb
fog-1.38.0 lib/fog/bluebox/models/dns/record.rb
fog-1.37.0 lib/fog/bluebox/models/dns/record.rb
fog-1.36.0 lib/fog/bluebox/models/dns/record.rb
fog-1.35.0 lib/fog/bluebox/models/dns/record.rb
fog-2.0.0.pre.0 lib/fog/bluebox/models/dns/record.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/bluebox/models/dns/record.rb
fog-1.34.0 lib/fog/bluebox/models/dns/record.rb
fog-1.33.0 lib/fog/bluebox/models/dns/record.rb
fog-1.32.0 lib/fog/bluebox/models/dns/record.rb
fog-1.31.0 lib/fog/bluebox/models/dns/record.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/bluebox/models/dns/record.rb