Methods

Class/Module Index [+]

Quicksearch

Fog::DNS::Zerigo::Records

Public Instance Methods

all(options = {}) click to toggle source

List all domains @param [Hash] options Options to pass to the underlying API call @option options [String] :fqdn search for the given fqdn

# File lib/fog/zerigo/models/dns/records.rb, line 17
def all(options = {})
  requires :zone
  if options[:fqdn]
    hosts = service.find_hosts(options[:fqdn], zone.id).body['hosts']
    load(hosts)
  else
    parent = zone.collection.get(zone.identity)
    if parent
      merge_attributes(parent.records.attributes)
      load(parent.records.map {|record| record.attributes})
    else
      nil
    end
  end
end
get(record_id) click to toggle source
# File lib/fog/zerigo/models/dns/records.rb, line 33
def get(record_id)
  data = service.get_host(record_id).body
  new(data)
rescue Fog::Service::NotFound
  nil
end
new(attributes = {}) click to toggle source
# File lib/fog/zerigo/models/dns/records.rb, line 40
def new(attributes = {})
  requires :zone
  super({ :zone => zone }.merge!(attributes))
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.