Class: Fog::Compute::Packet::VirtualNetwork
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::Packet::VirtualNetwork
- Defined in:
- lib/fog/compute/packet/models/virtual_network.rb
Overview
Plan
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #assign_port(port_id) ⇒ Object
- #bond(bulk_enable) ⇒ Object
- #destroy ⇒ Object
- #disbond(bulk_disable) ⇒ Object
-
#initialize(attributes = {}) ⇒ VirtualNetwork
constructor
A new instance of VirtualNetwork.
- #save ⇒ Object
- #unassign_port(port_id) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ VirtualNetwork
Returns a new instance of VirtualNetwork.
23 24 25 |
# File 'lib/fog/compute/packet/models/virtual_network.rb', line 23 def initialize(attributes = {}) super end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
21 22 23 |
# File 'lib/fog/compute/packet/models/virtual_network.rb', line 21 def @options end |
Instance Method Details
#assign_port(port_id) ⇒ Object
54 55 56 57 58 59 |
# File 'lib/fog/compute/packet/models/virtual_network.rb', line 54 def assign_port(port_id) requires :id response = service.assign_port(port_id, id) true if response.status == 200 end |
#bond(bulk_enable) ⇒ Object
42 43 44 45 46 |
# File 'lib/fog/compute/packet/models/virtual_network.rb', line 42 def bond(bulk_enable) requires :id response = service.bond_ports(id, bulk_enable) true if response.status == 200 end |
#destroy ⇒ Object
68 69 70 71 72 |
# File 'lib/fog/compute/packet/models/virtual_network.rb', line 68 def destroy requires :id response = service.delete_virtual_network(id) true if response.status == 204 end |
#disbond(bulk_disable) ⇒ Object
48 49 50 51 52 |
# File 'lib/fog/compute/packet/models/virtual_network.rb', line 48 def disbond(bulk_disable) requires :id response = service.disbond_ports(id, bulk_disable) true if response.status == 200 end |
#save ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/fog/compute/packet/models/virtual_network.rb', line 27 def save requires :project_id, :description, :facility, :vxlan, :vlan = {} [:project_id] = project_id [:description] = description [:facility] = facility [:vxlan] = vxlan [:vxlan] = vlan [:name] = name if name response = service.create_virtual_network() merge_attributes(response.body) end |
#unassign_port(port_id) ⇒ Object
61 62 63 64 65 66 |
# File 'lib/fog/compute/packet/models/virtual_network.rb', line 61 def unassign_port(port_id) requires :id response = service.unassign_port(port_id, id) true if response.status == 200 end |