Sha256: 6ddbfd1ed7dd81400c5fd3ede72b57b6f5d20ca78d7eb287be6a970a8e4b680d

Contents?: true

Size: 906 Bytes

Versions: 41

Compression:

Stored size: 906 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.managed_zones.to_h || []
          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).to_h
            new(zone)
          end
        rescue ::Google::Apis::ClientError => e
          raise e unless e.status_code == 404
          nil
        end
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
fog-google-1.24.1 lib/fog/dns/google/models/zones.rb
fog-google-1.24.0 lib/fog/dns/google/models/zones.rb
fog-google-1.23.0 lib/fog/dns/google/models/zones.rb
fog-google-1.22.0 lib/fog/dns/google/models/zones.rb
fog-google-1.21.1 lib/fog/dns/google/models/zones.rb
fog-google-1.21.0 lib/fog/dns/google/models/zones.rb
fog-google-1.20.0 lib/fog/dns/google/models/zones.rb
fog-google-1.19.0 lib/fog/dns/google/models/zones.rb
fog-google-1.18.0 lib/fog/dns/google/models/zones.rb
fog-google-1.17.0 lib/fog/dns/google/models/zones.rb
fog-google-1.16.1 lib/fog/dns/google/models/zones.rb
fog-google-1.16.0 lib/fog/dns/google/models/zones.rb
fog-google-1.15.0 lib/fog/dns/google/models/zones.rb
fog-google-1.14.0 lib/fog/dns/google/models/zones.rb
gitlab-fog-google-1.14.0 lib/fog/dns/google/models/zones.rb
fog-google-1.13.0 lib/fog/dns/google/models/zones.rb
gitlab-fog-google-1.13.0 lib/fog/dns/google/models/zones.rb
fog-google-1.12.1 lib/fog/dns/google/models/zones.rb
fog-google-1.12.0 lib/fog/dns/google/models/zones.rb
fog-google-1.11.0 lib/fog/dns/google/models/zones.rb