Method: OneviewSDK::API200::ServerProfile.get_available_networks

Defined in:
lib/oneview-sdk/resource/api200/server_profile.rb

.get_available_networks(client, query) ⇒ Hash

Gets all the available ethernet and fc networks, and network sets

Parameters:

  • client (OneviewSDK::Client)

    The client object for the OneView appliance

  • query (Hash<String,Object>)

    Query parameters

Options Hash (query):

  • 'enclosure_group' (OneviewSDK::EnclosureGroup)

    Enclosure Group associated with the resource

  • 'function_type' (String)

    The FunctionType (Ethernet or FibreChannel) to filter the list of networks returned

  • 'server_hardware' (OneviewSDK::ServerHardware)

    The server hardware associated with the resource

  • 'server_hardware_type' (OneviewSDK::ServerHardwareType)

    The server hardware type associated with the resource

  • 'view' (String)

    Name of a predefined view to return a specific subset of the attributes of the resource or collection

Returns:

  • (Hash)

    A hash containing the lists of Ethernet and FC Networks, and Network Sets Options:

    * [String] 'ethernetNetworks' The list of Ethernet Networks
    * [String] 'fcNetworks' The list of FC Networks
    * [String] 'networkSets' The list of Networks Sets
    


312
313
314
315
316
317
# File 'lib/oneview-sdk/resource/api200/server_profile.rb', line 312

def self.get_available_networks(client, query)
  query_uri = build_query(query) if query
  response = client.rest_get("#{BASE_URI}/available-networks#{query_uri}")
  body = client.response_handler(response)
  body.select { |k, _v| %w[ethernetNetworks networkSets fcNetworks].include?(k) }
end