Class: Fog::Compute::XenServer::VIF
- Defined in:
- lib/fog/xenserver/models/compute/vif.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
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 ⇒ Object
27 28 29 |
# File 'lib/fog/xenserver/models/compute/vif.rb', line 27 def destroy service.destroy_vif reference end |
#network ⇒ Object
31 32 33 |
# File 'lib/fog/xenserver/models/compute/vif.rb', line 31 def network service.networks.get __network end |
#save ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/fog/xenserver/models/compute/vif.rb', line 39 def save requires :server raise ArgumentError.new('network is required for this operation') \ unless attributes[:__network] ref = service.create_vif attributes[:server], attributes[:__network] merge_attributes service.vifs.get(ref).attributes end |
#server ⇒ Object
35 36 37 |
# File 'lib/fog/xenserver/models/compute/vif.rb', line 35 def server service.servers.get __vm end |