class NSXDriver::LogicalSwitch

Class Logical Switch

Attributes

description[R]
display_name[R]
ls_id[R]

ATTRIBUTES

replication_mode[R]
tz_id[R]

Public Class Methods

nsx_nics(template_xml, only_new_attached = true) click to toggle source

Return nsx nics of type NSX-V and NSX-T If only_new_attached = true –> Only returns new attached nsx nics

# 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.message
            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

Public Instance Methods

delete_logical_switch() click to toggle source

Delete a logical switch

# File lib/logical_switch.rb, line 43
def delete_logical_switch; end
ls?() click to toggle source
# File lib/logical_switch.rb, line 28
def ls?; end
ls_name() click to toggle source

Get logical switch's name

# File lib/logical_switch.rb, line 31
def ls_name; end
ls_tz() click to toggle source

Get the Transport Zone of the logical switch

# File lib/logical_switch.rb, line 37
def ls_tz; end
ls_vni() click to toggle source

Get logical switch's vni

# File lib/logical_switch.rb, line 34
def ls_vni; end
new_logical_switch(ls_data) click to toggle source

Create a new logical switch

# File lib/logical_switch.rb, line 40
def new_logical_switch(ls_data); end
update_logical_switch() click to toggle source

Update a logical switch

# File lib/logical_switch.rb, line 46
def update_logical_switch; end