Sha256: 839534738ea20f25b06c9d6733a4ce3b786e136d0ab66454c7f8507d4b630ff7
Contents?: true
Size: 1.17 KB
Versions: 1
Compression:
Stored size: 1.17 KB
Contents
require 'fog/dynect/models/dns/record' module Fog module Dynect class DNS class Records < Fog::Collection attribute :zone model Fog::Dynect::DNS::Record def all(options = {}) requires :zone data = [] service.get_all_records(zone.domain, options).body['data'].each do |records| (type, list) = records list.each do |record| data << { :identity => record['record_id'], :fqdn => record['fqdn'], :type => record['record_type'], :rdata => record['rdata'], :ttl => record['ttl'] } end end load(data) end def get(record_id) requires :zone # there isn't a way to look up by just id # must have type and domain for 'get_record' request # so we pick it from the list returned by 'all' list = all list.detect {|e| e.id == record_id} end def new(attributes = {}) requires :zone super({:zone => zone}.merge!(attributes)) end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fog-dynect-0.5.0 | lib/fog/dynect/models/dns/records.rb |