Sha256: 21e3a8c3be75a25516dd39fe463f3404d6011d255729cab7e4c62c16896ec1bc

Contents?: true

Size: 661 Bytes

Versions: 2

Compression:

Stored size: 661 Bytes

Contents

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

module Fog
  module DNS
    class AWS
      class Zones < Fog::Collection
        attribute :marker,    :aliases => 'Marker'
        attribute :max_items, :aliases => 'MaxItems'

        model Fog::DNS::AWS::Zone

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

        def get(zone_id)
          data = service.get_hosted_zone(zone_id).body
          new(data)
        rescue Fog::DNS::AWS::NotFound
          nil
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-aws-0.7.3 lib/fog/aws/models/dns/zones.rb
fog-aws-0.7.2 lib/fog/aws/models/dns/zones.rb