Sha256: aa8b485bb4dd43a891dc43f0e50b34f457f6ffa34fc64d8273868df2227fe828

Contents?: true

Size: 1.04 KB

Versions: 4

Compression:

Stored size: 1.04 KB

Contents

require 'fog/core/collection'
require 'fog/azurerm/models/dns/record_set'

module Fog
  module DNS
    class AzureRM
      # This class is giving implementation of
      # all/get for RecordSets.
      class RecordSets < Fog::Collection
        attribute :resource_group
        attribute :zone_name
        attribute :type

        model Fog::DNS::AzureRM::RecordSet

        def all
          requires :resource_group
          requires :zone_name
          record_sets = []
          service.list_record_sets(resource_group, zone_name).each do |r|
            record_sets << Fog::DNS::AzureRM::RecordSet.parse(r)
          end
          load(record_sets)
        end

        def get(resource_group, name, zone_name, record_type)
          record_set = service.get_record_set(resource_group, name, zone_name, record_type)
          record_set_obj = Fog::DNS::AzureRM::RecordSet.new(service: service)
          record_set_obj.merge_attributes(Fog::DNS::AzureRM::RecordSet.parse(record_set))
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.9 lib/fog/azurerm/models/dns/record_sets.rb
fog-azure-rm-0.0.8 lib/fog/azurerm/models/dns/record_sets.rb
fog-azure-rm-0.0.6 lib/fog/azurerm/models/dns/record_sets.rb
fog-azure-rm-0.0.5 lib/fog/azurerm/models/dns/record_sets.rb