Class: Fog::OpenStack::Network::Network
- Inherits:
-
Model
- Object
- Model
- Model
- Fog::OpenStack::Network::Network
show all
- Defined in:
- lib/fog/openstack/network/models/network.rb
Instance Attribute Summary
Attributes inherited from Model
#project
Instance Method Summary
collapse
Methods inherited from Model
#initialize, #save
Instance Method Details
#create ⇒ Object
23
24
25
26
|
# File 'lib/fog/openstack/network/models/network.rb', line 23
def create
merge_attributes(service.create_network(attributes).body['network'])
self
end
|
#destroy ⇒ Object
34
35
36
37
38
|
# File 'lib/fog/openstack/network/models/network.rb', line 34
def destroy
requires :id
service.delete_network(id)
true
end
|
#subnets ⇒ Object
19
20
21
|
# File 'lib/fog/openstack/network/models/network.rb', line 19
def subnets
service.subnets.select { |s| s.network_id == id }
end
|
#update ⇒ Object
28
29
30
31
32
|
# File 'lib/fog/openstack/network/models/network.rb', line 28
def update
requires :id
merge_attributes(service.update_network(id, attributes).body['network'])
self
end
|