Class: NSXDriver::LogicalSwitch
- Inherits:
-
NSXComponent
- Object
- NSXComponent
- NSXDriver::LogicalSwitch
- Defined in:
- lib/logical_switch.rb
Overview
Class Logical Switch
Direct Known Subclasses
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#display_name ⇒ Object
readonly
Returns the value of attribute display_name.
-
#ls_id ⇒ Object
readonly
ATTRIBUTES.
-
#replication_mode ⇒ Object
readonly
Returns the value of attribute replication_mode.
-
#tz_id ⇒ Object
readonly
Returns the value of attribute tz_id.
Class Method Summary collapse
-
.nsx_nics(template_xml, only_new_attached = true) ⇒ Object
Return nsx nics of type NSX-V and NSX-T If only_new_attached = true –> Only returns new attached nsx nics.
Instance Method Summary collapse
-
#delete_logical_switch ⇒ Object
Delete a logical switch.
- #ls? ⇒ Boolean
-
#ls_name ⇒ Object
Get logical switch’s name.
-
#ls_tz ⇒ Object
Get the Transport Zone of the logical switch.
-
#ls_vni ⇒ Object
Get logical switch’s vni.
-
#new_logical_switch(ls_data) ⇒ Object
Create a new logical switch.
-
#update_logical_switch ⇒ Object
Update a logical switch.
Methods inherited from NSXComponent
Constructor Details
This class inherits a constructor from NSXDriver::NSXComponent
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
26 27 28 |
# File 'lib/logical_switch.rb', line 26 def description @description end |
#display_name ⇒ Object (readonly)
Returns the value of attribute display_name.
25 26 27 |
# File 'lib/logical_switch.rb', line 25 def display_name @display_name end |
#ls_id ⇒ Object (readonly)
ATTRIBUTES
22 23 24 |
# File 'lib/logical_switch.rb', line 22 def ls_id @ls_id end |
#replication_mode ⇒ Object (readonly)
Returns the value of attribute replication_mode.
24 25 26 |
# File 'lib/logical_switch.rb', line 24 def replication_mode @replication_mode end |
#tz_id ⇒ Object (readonly)
Returns the value of attribute tz_id.
23 24 25 |
# File 'lib/logical_switch.rb', line 23 def tz_id @tz_id end |
Class Method Details
.nsx_nics(template_xml, only_new_attached = true) ⇒ Object
Return nsx nics of type NSX-V and NSX-T If only_new_attached = true –> Only returns new attached nsx nics
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/logical_switch.rb', line 50 def self.nsx_nics(template_xml, only_new_attached = true) if only_new_attached == true nics = template_xml.xpath('//TEMPLATE/NIC[ATTACH="YES"]') else nics = template_xml.xpath('//TEMPLATE/NIC') end nics_array = [] nics.each do |nic| network_id = nic.xpath('NETWORK_ID').text # Check Networks exists one_vnet = VCenterDriver::VIHelper .one_item(OpenNebula::VirtualNetwork, network_id) rc = one_vnet.info if OpenNebula.is_error?(rc) err_msg = rc. raise err_msg end pg_type = one_vnet['TEMPLATE/VCENTER_PORTGROUP_TYPE'] nics_array << nic if [NSXConstants::NSXV_LS_TYPE, NSXConstants::NSXT_LS_TYPE] .include?(pg_type) end nics_array end |
Instance Method Details
#delete_logical_switch ⇒ Object
Delete a logical switch
43 |
# File 'lib/logical_switch.rb', line 43 def delete_logical_switch; end |
#ls? ⇒ Boolean
28 |
# File 'lib/logical_switch.rb', line 28 def ls?; end |
#ls_name ⇒ Object
Get logical switch’s name
31 |
# File 'lib/logical_switch.rb', line 31 def ls_name; end |
#ls_tz ⇒ Object
Get the Transport Zone of the logical switch
37 |
# File 'lib/logical_switch.rb', line 37 def ls_tz; end |
#ls_vni ⇒ Object
Get logical switch’s vni
34 |
# File 'lib/logical_switch.rb', line 34 def ls_vni; end |
#new_logical_switch(ls_data) ⇒ Object
Create a new logical switch
40 |
# File 'lib/logical_switch.rb', line 40 def new_logical_switch(ls_data); end |
#update_logical_switch ⇒ Object
Update a logical switch
46 |
# File 'lib/logical_switch.rb', line 46 def update_logical_switch; end |