Class: Fog::SharedFileSystem::OpenStack::Network

Inherits:
OpenStack::Model show all
Defined in:
lib/fog/shared_file_system/openstack/models/network.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

#destroyObject



34
35
36
37
38
# File 'lib/fog/shared_file_system/openstack/models/network.rb', line 34

def destroy
  requires :id
  service.delete_share_network(id)
  true
end

#saveObject

Raises:

  • (Fog::Errors::Error)


22
23
24
25
26
# File 'lib/fog/shared_file_system/openstack/models/network.rb', line 22

def save
  raise Fog::Errors::Error, 'Resaving an existing object may create a duplicate' if persisted?
  merge_attributes(service.create_share_network(attributes).body['share_network'])
  true
end

#update(options = nil) ⇒ Object



28
29
30
31
32
# File 'lib/fog/shared_file_system/openstack/models/network.rb', line 28

def update(options = nil)
  requires :id
  merge_attributes(service.update_share_network(id, options || attributes).body['share_network'])
  self
end