class OneviewSDK::API1200::C7000::EthernetNetwork

Ethernet network resource implementation for API1200 C7000

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/api1200/c7000/ethernet_network.rb, line 23
def self.bulk_create(client, options)
  range = options[:vlanIdRange].split('-').map(&:to_i)
  options[:type] = 'bulk-ethernet-networkV2'
  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