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

Inherits:
OpenStack::Model show all
Defined in:
lib/fog/network/openstack/models/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/network/openstack/models/network.rb', line 24

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

#destroyObject


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

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

#subnetsObject


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

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

#updateObject


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

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