Sha256: b16cdf3b66cc379e42f8f7fdddabed49d1b10cca5320fa665732f9cbeaa8695f

Contents?: true

Size: 851 Bytes

Versions: 14

Compression:

Stored size: 851 Bytes

Contents

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

        ##
        # Enumerates Managed Zones that have been created but not yet deleted
        #
        # @return [Array<Fog::DNS::Google::Zone>] List of Managed Zone resources
        def all
          data = service.list_managed_zones.body["managedZones"] || []
          load(data)
        end

        ##
        # Fetches the representation of an existing Managed Zone
        #
        # @param [String] name_or_id Managed Zone name or identity
        # @return [Fog::DNS::Google::Zone] Managed Zone resource
        def get(name_or_id)
          if zone = service.get_managed_zone(name_or_id).body
            new(zone)
          end
        rescue Fog::Errors::NotFound
          nil
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fog-google-0.6.0 lib/fog/dns/google/models/zones.rb
fog-google-0.5.5 lib/fog/dns/google/models/zones.rb
fog-google-0.5.4 lib/fog/dns/google/models/zones.rb
fog-google-0.5.3 lib/fog/dns/google/models/zones.rb
fog-google-0.5.2 lib/fog/dns/google/models/zones.rb
fog-google-0.5.1 lib/fog/dns/google/models/zones.rb
fog-google-0.5.0 lib/fog/dns/google/models/zones.rb
fog-google-0.4.2 lib/fog/dns/google/models/zones.rb
fog-google-0.4.1 lib/fog/dns/google/models/zones.rb
fog-google-0.4.0 lib/fog/dns/google/models/zones.rb
fog-google-0.3.2 lib/fog/dns/google/models/zones.rb
fog-google-0.3.1 lib/fog/dns/google/models/zones.rb
fog-google-0.3.0 lib/fog/dns/google/models/zones.rb
fog-google-0.2.0 lib/fog/dns/google/models/zones.rb