Sha256: 30dbdbd8934fba989ccee2277386dd75d473cbda54db0ea753ae08e23d4c3edc

Contents?: true

Size: 893 Bytes

Versions: 47

Compression:

Stored size: 893 Bytes

Contents

module Fog
  module DNS
    class AzureRM
      # Real class for DNS Request
      class Real
        def get_records_from_record_set(resource_group, name, zone_name, record_type)
          msg = "Getting all records from RecordSet #{name} of type '#{record_type}' in zone #{zone_name}"
          Fog::Logger.debug msg
          begin
            record_set = @dns_client.record_sets.get(resource_group, zone_name, name, record_type)
          rescue MsRestAzure::AzureOperationError => e
            raise_azure_exception(e, msg)
          end

          case record_type
          when 'A'
            record_set.arecords
          when 'CNAME'
            record_set.cname_record
          end
        end
      end

      # Mock class for DNS Request
      class Mock
        def get_records_from_record_set(*)
          %w(1.2.3.4 1.2.3.5 1.2.3.6)
        end
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 4 rubygems

Version Path
fog-azure-rm-0.6.0 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
fog-azure-rm-0.5.3 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
fog-azure-rm-0.5.2 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
far-gem-0.5.6 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
fog-azure-rm-0.5.1 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
far-gem-0.5.5 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
fog-azure-rm-0.5.0 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
far-gem-0.5.4 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
far-gem-0.5.3 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
fog-azure-rm-0.4.9 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
far-gem-0.5.2 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
fog-azure-rm-0.4.8 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
fog-azure-rm-0.4.7 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
fog-azure-rm-0.4.6 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
fog-azure-rm-0.4.5 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
fog-azure-rm-temp-0.0.5 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
fog-azure-rm-0.4.4 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
fog-azure-rm-0.4.3 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
far-gem-0.5.1 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb
fog-azure-rm-0.4.2 lib/fog/azurerm/requests/dns/get_records_from_record_set.rb