Class: Fog::OpenStack::DNS::V2::Zones

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

Instance Attribute Summary

Attributes inherited from Collection

#response

Instance Method Summary collapse

Methods inherited from Collection

#load_response, #summary

Instance Method Details

#all(options = {}) ⇒ Object



11
12
13
# File 'lib/fog/openstack/dns/v2/models/zones.rb', line 11

def all(options = {})
  load_response(service.list_zones(options), 'zones')
end

#destroy(id, options = {}) ⇒ Object



22
23
24
25
# File 'lib/fog/openstack/dns/v2/models/zones.rb', line 22

def destroy(id, options = {})
  zone = find_by_id(id, options)
  zone.destroy
end

#find_by_id(id, options = {}) ⇒ Object Also known as: get



15
16
17
18
# File 'lib/fog/openstack/dns/v2/models/zones.rb', line 15

def find_by_id(id, options = {})
  zone_hash = service.get_zone(id, options).body
  new(zone_hash.merge(:service => service))
end