Sha256: a52192f6614703f3bf2106c92f2e600f374fae6e0f5018b3098fb9b8d139a283

Contents?: true

Size: 757 Bytes

Versions: 38

Compression:

Stored size: 757 Bytes

Contents

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

module Fog
  module DNS
    class Rackspace
      class Zones < Fog::Collection

        model Fog::DNS::Rackspace::Zone

        def all
          clear
          data = connection.list_domains.body['domains']
          load(data)
        end

        def get(zone_id)
          if zone_id.nil? or zone_id.to_s.empty?
            return nil
          end

          data = connection.list_domain_details(zone_id).body
          new(data)
        rescue Fog::Rackspace::Errors::NotFound
          nil
        #Accessing a valid (but other customer's) id returns a 503 error
        rescue Fog::Rackspace::Errors::ServiceUnavailable
          nil
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 13 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/rackspace/models/dns/zones.rb
fog-nirvanix-1.8.1 lib/fog/rackspace/models/dns/zones.rb
fog-parser-fix-1.6.1 lib/fog/rackspace/models/dns/zones.rb
fog-test-again-1.6.0 lib/fog/rackspace/models/dns/zones.rb
fog-parser-fix-1.6.0 lib/fog/rackspace/models/dns/zones.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/rackspace/models/dns/zones.rb
fog-sgonyea-1.8.1 lib/fog/rackspace/models/dns/zones.rb
fog-1.8.0 lib/fog/rackspace/models/dns/zones.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/rackspace/models/dns/zones.rb
fog-1.7.0 lib/fog/rackspace/models/dns/zones.rb
fog-1.6.0 lib/fog/rackspace/models/dns/zones.rb
fog-1.5.0 lib/fog/rackspace/models/dns/zones.rb
fog-1.4.0 lib/fog/rackspace/models/dns/zones.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/dns/zones.rb
michiels-fog-1.3.1 lib/fog/rackspace/models/dns/zones.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/rackspace/models/dns/zones.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/dns/zones.rb
fog-1.3.1 lib/fog/rackspace/models/dns/zones.rb
fog-1.3.0 lib/fog/rackspace/models/dns/zones.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/dns/zones.rb