Class: Fog::OpenStack::DNS::V2::Zone

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

Instance Attribute Summary

Attributes inherited from Model

#project

Instance Method Summary collapse

Methods inherited from Model

#create, #initialize

Constructor Details

This class inherits a constructor from Fog::OpenStack::Model

Instance Method Details

#destroy(options = {}) ⇒ Object



41
42
43
44
45
# File 'lib/fog/openstack/dns/v2/models/zone.rb', line 41

def destroy(options = {})
  requires :id
  service.delete_zone(id, options)
  true
end

#saveObject

Raises:

  • (Fog::Errors::Error)


28
29
30
31
32
33
# File 'lib/fog/openstack/dns/v2/models/zone.rb', line 28

def save
  raise Fog::Errors::Error, 'Resaving an existing object may create a duplicate' if persisted?
  requires :name, :email
  merge_attributes(service.create_zone(name, email, attributes).body)
  true
end

#update(options = nil) ⇒ Object



35
36
37
38
39
# File 'lib/fog/openstack/dns/v2/models/zone.rb', line 35

def update(options = nil)
  requires :id
  merge_attributes(service.update_zone(id, options || attributes).body)
  self
end