Sha256: 28322a8d58fb7f7e28e4a022e5562e26339207684d7a8dae8f3daae8a6f8ec7a

Contents?: true

Size: 704 Bytes

Versions: 3

Compression:

Stored size: 704 Bytes

Contents

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

module Fog
  module AWS
    class DNS

      class Zones < Fog::Collection

        attribute :marker,    :aliases => 'Marker'
        attribute :max_items, :aliases => 'MaxItems'

        model Fog::AWS::DNS::Zone

        def all(options = {})
          options['marker']   ||= marker
          options['maxitems'] ||= max_items
          data = connection.list_hosted_zones(options).body['HostedZones']
          load(data)
        end

        def get(zone_id)
          data = connection.get_hosted_zone(zone_id).body
          new(data)
        rescue Excon::Errors::Forbidden
          nil
        end

      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fog-0.8.2 lib/fog/dns/models/aws/zones.rb
fog-0.8.1 lib/fog/dns/models/aws/zones.rb
fog-0.8.0 lib/fog/dns/models/aws/zones.rb