Sha256: 78386518d0e1336941f02ac26a13268e617511c1c513f919aa0226543c76e85e

Contents?: true

Size: 970 Bytes

Versions: 1

Compression:

Stored size: 970 Bytes

Contents

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, :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_fog = Fog::DNS::AzureRM::RecordSet.new(service: service)
          record_set_fog.merge_attributes(Fog::DNS::AzureRM::RecordSet.parse(record_set))
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.1 lib/fog/azurerm/models/dns/record_sets.rb