Sha256: 2bc234cf39912d7e0a20483b4b5b8af2b13909b2bf65a9fda7c441ffc3ca960d

Contents?: true

Size: 679 Bytes

Versions: 1

Compression:

Stored size: 679 Bytes

Contents

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

module Fog
  module DNS
    class AzureRM
      class Zones < Fog::Collection
        model Fog::DNS::AzureRM::Zone

        def all
          zones = []
          service.list_zones.each do |z|
            hash = {}
            z.each do |k, v|
              hash[k] = v
            end
            zones << hash
          end
          load(zones)
        end

        def get(identity, resource_group)
          all.find { |f| f.name == identity && f.resource_group == resource_group }
        rescue Fog::Errors::NotFound
          nil
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.0 lib/fog/azurerm/models/dns/zones.rb