Class: OneviewSDK::API300::Synergy::LogicalInterconnect

Inherits:
C7000::LogicalInterconnect show all
Defined in:
lib/oneview-sdk/resource/api300/synergy/logical_interconnect.rb

Overview

Logical interconnect resource implementation for API300 Synergy

Constant Summary

Constants inherited from OneviewSDK::API200::LogicalInterconnect

OneviewSDK::API200::LogicalInterconnect::BASE_URI, OneviewSDK::API200::LogicalInterconnect::LOCATION_URI

Constants inherited from Resource

Resource::BASE_URI, Resource::UNIQUE_IDENTIFIERS

Instance Attribute Summary

Attributes inherited from Resource

#api_version, #client, #data, #logger

Instance Method Summary collapse

Methods inherited from C7000::LogicalInterconnect

#initialize, #update_settings

Methods inherited from OneviewSDK::API200::LogicalInterconnect

#add_snmp_trap_destination, #compliance, #configuration, #create, #delete, #firmware_update, #generate_trap_options, #get_firmware, #get_unassigned_uplink_ports_for_port_monitor, #initialize, #update_ethernet_settings, #update_internal_networks, #update_port_monitor, #update_qos_configuration, #update_settings, #update_snmp_configuration, #update_telemetry_configuration

Methods inherited from Resource

#==, #[], #[]=, build_query, #create, #create!, #delete, #each, #eql?, #exists?, find_by, from_file, get_all, #initialize, #like?, #refresh, #retrieve!, #schema, schema, #set, #set_all, #to_file, #update

Constructor Details

This class inherits a constructor from OneviewSDK::API300::C7000::LogicalInterconnect

Instance Method Details

#list_vlan_networksOneviewSDK::Resource

Lists internal networks on the logical interconnect

Returns:


22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/oneview-sdk/resource/api300/synergy/logical_interconnect.rb', line 22

def list_vlan_networks
  ensure_client && ensure_uri
  results = OneviewSDK::Resource.find_by(@client, {}, @data['uri'] + '/internalVlans')
  internal_networks = []
  results.each do |vlan|
    net = if vlan['generalNetworkUri'].include? 'ethernet-network'
            OneviewSDK::API300::Synergy::EthernetNetwork.new(@client, uri: vlan['generalNetworkUri'])
          elsif vlan['generalNetworkUri'].include? 'fc-network'
            OneviewSDK::API300::Synergy::FCNetwork.new(@client, uri: vlan['generalNetworkUri'])
          else
            OneviewSDK::API300::Synergy::FCoENetwork.new(@client, uri: vlan['generalNetworkUri'])
          end
    net.retrieve!
    internal_networks.push(net)
  end
  internal_networks
end