Class: NSXDriver::LogicalSwitch

Inherits:
NSXComponent show all
Defined in:
lib/logical_switch.rb

Overview

Class Logical Switch

Direct Known Subclasses

OpaqueNetwork, VirtualWire

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from NSXComponent

#initialize

Constructor Details

This class inherits a constructor from NSXDriver::NSXComponent

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



26
27
28
# File 'lib/logical_switch.rb', line 26

def description
  @description
end

#display_nameObject (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_idObject (readonly)

ATTRIBUTES



22
23
24
# File 'lib/logical_switch.rb', line 22

def ls_id
  @ls_id
end

#replication_modeObject (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_idObject (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.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

Instance Method Details

#delete_logical_switchObject

Delete a logical switch



43
# File 'lib/logical_switch.rb', line 43

def delete_logical_switch; end

#ls?Boolean

Returns:

  • (Boolean)


28
# File 'lib/logical_switch.rb', line 28

def ls?; end

#ls_nameObject

Get logical switch’s name



31
# File 'lib/logical_switch.rb', line 31

def ls_name; end

#ls_tzObject

Get the Transport Zone of the logical switch



37
# File 'lib/logical_switch.rb', line 37

def ls_tz; end

#ls_vniObject

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_switchObject

Update a logical switch



46
# File 'lib/logical_switch.rb', line 46

def update_logical_switch; end