Class: OneviewSDK::API300::C7000::LogicalInterconnect

Inherits:
OneviewSDK::API200::LogicalInterconnect show all
Defined in:
lib/oneview-sdk/resource/api300/c7000/logical_interconnect.rb

Overview

Logical interconnect resource implementation for API300 C7000

Direct Known Subclasses

Synergy::LogicalInterconnect

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 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, #update_ethernet_settings, #update_internal_networks, #update_port_monitor, #update_qos_configuration, #update_snmp_configuration, #update_telemetry_configuration

Methods inherited from Resource

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

Constructor Details

#initialize(client, params = {}, api_ver = nil) ⇒ LogicalInterconnect

Create a resource object, associate it with a client, and set its properties.

Parameters:

  • client (OneviewSDK::Client)

    The client object for the OneView appliance

  • params (Hash) (defaults to: {})

    The options for this resource (key-value pairs)

  • api_ver (Integer) (defaults to: nil)

    The api version to use when interracting with this resource.


24
25
26
27
28
29
# File 'lib/oneview-sdk/resource/api300/c7000/logical_interconnect.rb', line 24

def initialize(client, params = {}, api_ver = nil)
  @data ||= {}
  # Default values:
  @data['type'] ||= 'logical-interconnectV300'
  super
end

Instance Method Details

#list_vlan_networksOneviewSDK::Resource

Lists internal networks on the logical interconnect

Returns:


33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/oneview-sdk/resource/api300/c7000/logical_interconnect.rb', line 33

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::C7000::EthernetNetwork.new(@client, uri: vlan['generalNetworkUri'])
          elsif vlan['generalNetworkUri'].include? 'fc-network'
            OneviewSDK::API300::C7000::FCNetwork.new(@client, uri: vlan['generalNetworkUri'])
          else
            OneviewSDK::API300::C7000::FCoENetwork.new(@client, uri: vlan['generalNetworkUri'])
          end
    net.retrieve!
    internal_networks.push(net)
  end
  internal_networks
end

#update_settings(options = {}) ⇒ Object

Updates settings of the logical interconnect

Parameters:

  • options (defaults to: {})

    Options to update the Logical Interconnect

Returns:

  • Updated instance of the Logical Interconnect


54
55
56
57
58
59
# File 'lib/oneview-sdk/resource/api300/c7000/logical_interconnect.rb', line 54

def update_settings(options = {})
  options['type'] ||= 'InterconnectSettingsV201'
  options['ethernetSettings'] ||= {}
  options['ethernetSettings']['type'] ||= 'EthernetInterconnectSettingsV201'
  super(options)
end