Class: Fog::DNS::Rackspace::Zones

Inherits:
Collection
  • Object
show all
Defined in:
lib/rackspace-fog/rackspace/models/dns/zones.rb

Instance Attribute Summary

Attributes inherited from Collection

#connection

Instance Method Summary collapse

Methods inherited from Collection

#clear, #create, #destroy, #initialize, #inspect, #load, model, #model, #new, #reload, #table, #to_json

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Collection

Instance Method Details

#allObject



11
12
13
14
15
# File 'lib/rackspace-fog/rackspace/models/dns/zones.rb', line 11

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

#get(zone_id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/rackspace-fog/rackspace/models/dns/zones.rb', line 17

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