class OneviewSDK::API200::NetworkSet

Network set resource implementation

Constants

BASE_URI

Public Class Methods

get_without_ethernet(client) click to toggle source

Lists network sets excluding ethernet networks @param [OneviewSDK::Client] client The client object for the OneView appliance @return [Array] List of network sets

# File lib/oneview-sdk/resource/api200/network_set.rb, line 55
def self.get_without_ethernet(client)
  response = client.rest_get(BASE_URI + '/withoutEthernet')
  client.response_handler(response)
end
new(client, params = {}, api_ver = nil) click to toggle source

Create a resource object, associate it with a client, and set its properties. @param [OneviewSDK::Client] client The client object for the OneView appliance @param [Hash] params The options for this resource (key-value pairs) @param [Integer] api_ver The api version to use when interracting with this resource.

Calls superclass method OneviewSDK::Resource::new
# File lib/oneview-sdk/resource/api200/network_set.rb, line 24
def initialize(client, params = {}, api_ver = nil)
  super
  # Default values:
  @data['connectionTemplateUri'] ||= nil
  @data['nativeNetworkUri'] ||= nil
  @data['networkUris'] ||= []
  @data['type'] ||= 'network-set'
end

Public Instance Methods

add_ethernet_network(ethernet_network) click to toggle source

Adds an ethernet network to the network set @param [OneviewSDK::EthernetNetwork] ethernet_network Ethernet Network

# File lib/oneview-sdk/resource/api200/network_set.rb, line 42
def add_ethernet_network(ethernet_network)
  @data['networkUris'] << ethernet_network['uri'] unless @data['networkUris'].include?(ethernet_network['uri'])
end
get_without_ethernet() click to toggle source

Lists network set excluding ethernet networks @return [OneviewSDK::NetworkSet] Network set

# File lib/oneview-sdk/resource/api200/network_set.rb, line 62
def get_without_ethernet
  response = @client.rest_get(@data['uri'] + '/withoutEthernet')
  @client.response_handler(response)
end
remove_ethernet_network(ethernet_network) click to toggle source

Removes an ethernet network from the network set @param [OneviewSDK::EthernetNetwork] ethernet_network Ethernet Network

# File lib/oneview-sdk/resource/api200/network_set.rb, line 48
def remove_ethernet_network(ethernet_network)
  @data['networkUris'].delete(ethernet_network['uri']) if @data['networkUris'].include?(ethernet_network['uri'])
end
set_native_network(ethernet_network) click to toggle source

Sets the native network for the network set @param [OneviewSDK::EthernetNetwork] ethernet_network Ethernet Network

# File lib/oneview-sdk/resource/api200/network_set.rb, line 35
def set_native_network(ethernet_network)
  @data['nativeNetworkUri'] = ethernet_network['uri']
  @data['networkUris'] << ethernet_network['uri'] unless @data['networkUris'].include?(ethernet_network['uri'])
end