Sha256: 8e08a54deabff8c13f65351c588e8bcdea463e700aff1d2b6c4950569610dd93

Contents?: true

Size: 902 Bytes

Versions: 19

Compression:

Stored size: 902 Bytes

Contents

#
# Author:: Celso Fernandes (<fernandes@zertico.com>)
# © Copyright IBM Corporation 2014.
#
# LICENSE: MIT (http://opensource.org/licenses/MIT)
#

require 'fog/softlayer/models/dns/record'

module Fog
  module DNS
    class Softlayer
      class Records < Fog::Collection
        attribute :domain

        model Fog::DNS::Softlayer::Record

        def all
          requires :domain
          clear
          data = service.get_records(domain.id).body
          load(data)
        end
        
        def get(identifier)
          return nil if identifier.nil? || identifier == ""
          response = service.get_record(identifier)
          data = response.body
          new.merge_attributes(data)
        rescue Excon::Errors::NotFound
          nil
        end

        def new(attributes = {})
          super({ :domain => domain }.merge!(attributes))
        end
      end
    end
  end
end

Version data entries

19 entries across 17 versions & 3 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-softlayer-1.1.4/lib/fog/softlayer/models/dns/records.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-softlayer-1.1.4/lib/fog/softlayer/models/dns/records.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-softlayer-1.1.4/lib/fog/softlayer/models/dns/records.rb
fog-softlayer-1.1.4 lib/fog/softlayer/models/dns/records.rb
fog-softlayer-1.1.3 lib/fog/softlayer/models/dns/records.rb
fog-softlayer-1.1.2 lib/fog/softlayer/models/dns/records.rb
fog-softlayer-1.1.1 lib/fog/softlayer/models/dns/records.rb
fog-softlayer-1.1.0 lib/fog/softlayer/models/dns/records.rb
fog-softlayer-1.0.3 lib/fog/softlayer/models/dns/records.rb
fog-softlayer-1.0.2 lib/fog/softlayer/models/dns/records.rb
fog-softlayer-1.0.1 lib/fog/softlayer/models/dns/records.rb
fog-softlayer-1.0.0 lib/fog/softlayer/models/dns/records.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-softlayer-0.4.7/lib/fog/softlayer/models/dns/records.rb
fog-softlayer-0.4.7 lib/fog/softlayer/models/dns/records.rb
fog-softlayer-0.4.6 lib/fog/softlayer/models/dns/records.rb
fog-softlayer-0.4.5 lib/fog/softlayer/models/dns/records.rb
fog-softlayer-0.4.4 lib/fog/softlayer/models/dns/records.rb
fog-softlayer-0.4.3 lib/fog/softlayer/models/dns/records.rb
fog-softlayer-0.4.2 lib/fog/softlayer/models/dns/records.rb