class OneviewSDK::API600::Synergy::EthernetNetwork

Ethernet network resource implementation for API600 Synergy

Public Class Methods

bulk_create(client, options) click to toggle source

Bulk create the ethernet networks @param [OneviewSDK::Client] client The client object for the OneView appliance @param [Hash] options information necessary to create networks @return [Array] list of ethernet networks created

# File lib/oneview-sdk/resource/api600/synergy/ethernet_network.rb, line 35
def self.bulk_create(client, options)
  range = options[:vlanIdRange].split('-').map(&:to_i)
  options[:type] = 'bulk-ethernet-networkV1'
  response = client.rest_post(BASE_URI + '/bulk', { 'body' => options }, client.api_version)
  client.response_handler(response)
  network_names = []
  range[0].upto(range[1]) { |i| network_names << "#{options[:namePrefix]}_#{i}" }
  OneviewSDK::EthernetNetwork.get_all(client).select { |network| network_names.include?(network['name']) }
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.

# File lib/oneview-sdk/resource/api600/synergy/ethernet_network.rb, line 23
def initialize(client, params = {}, api_ver = nil)
  @data ||= {}
  # Default values:
  @data['ethernetNetworkType'] ||= 'Tagged'
  @data['type'] ||= 'ethernet-networkV4'
  super
end