Class: Fog::Compute::XenServer::Network
- Defined in:
- lib/fog/xenserver/models/compute/network.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
-
#destroy ⇒ Boolean
Destroys a network.
-
#pifs ⇒ Object
Return the list of network related PIFs.
- #refresh ⇒ Object
-
#save ⇒ Boolean
Creates a new network.
-
#vifs ⇒ Object
Return the list of network related VIFs.
Methods inherited from Model
#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Fog::Core::DeprecatedConnectionAccessors
#connection, #connection=, #prepare_service_value
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Model
Instance Method Details
#destroy ⇒ Boolean
83 84 85 86 87 |
# File 'lib/fog/xenserver/models/compute/network.rb', line 83 def destroy requires :reference service.destroy_network reference true end |
#pifs ⇒ Object
Return the list of network related PIFs
36 37 38 39 40 41 42 |
# File 'lib/fog/xenserver/models/compute/network.rb', line 36 def pifs p = [] __pifs.each do |pif| p << service.pifs.get(pif) end p end |
#refresh ⇒ Object
27 28 29 30 31 |
# File 'lib/fog/xenserver/models/compute/network.rb', line 27 def refresh data = service.get_record( reference, 'network' ) merge_attributes( data ) true end |
#save ⇒ Boolean
65 66 67 68 69 70 71 |
# File 'lib/fog/xenserver/models/compute/network.rb', line 65 def save requires :name ref = service.create_network name, attributes data = service.get_record ref, 'network' merge_attributes data true end |
#vifs ⇒ Object
Return the list of network related VIFs
47 48 49 50 51 52 53 |
# File 'lib/fog/xenserver/models/compute/network.rb', line 47 def vifs v = [] __vifs.each do |vif| v << service.vifs.get(vif) end v end |