Class: Fog::DNS::OpenStack::V2::Recordset

Inherits:
OpenStack::Model show all
Defined in:
lib/fog/dns/openstack/v2/models/recordset.rb

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#create, #initialize

Constructor Details

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

Instance Method Details

#destroy(options = {}) ⇒ Object



46
47
48
49
50
# File 'lib/fog/dns/openstack/v2/models/recordset.rb', line 46

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

#reload(options = {}) ⇒ Object

overwritten because zone_id is needed for get



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

def reload(options = {})
  requires :zone_id, :id
  merge_attributes(collection.get(zone_id, id, options).attributes)
  self
end

#saveObject

Raises:

  • (Fog::Errors::Error)


26
27
28
29
30
31
# File 'lib/fog/dns/openstack/v2/models/recordset.rb', line 26

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

#update(options = nil) ⇒ Object



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

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