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

Inherits:
OpenStack::Model show all
Defined in:
lib/fog/openstack/models/network/network.rb

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#initialize, #save

Constructor Details

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

Instance Method Details

#createObject



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

def create
  merge_attributes(service.create_network(self.attributes).body['network'])
  self
end

#destroyObject



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

def destroy
  requires :id
  service.delete_network(self.id)
  true
end

#subnetsObject



20
21
22
# File 'lib/fog/openstack/models/network/network.rb', line 20

def subnets
  service.subnets.select {|s| s.network_id == self.id }
end

#updateObject



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

def update
  requires :id
  merge_attributes(service.update_network(self.id, self.attributes).body['network'])
  self
end