Method: OneviewSDK::API200::ServerProfile.get_available_servers

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

.get_available_servers(client, query = nil) ⇒ Hash

Gets the available servers based on the query parameters

Parameters:

  • client (OneviewSDK::Client)

    The client object for the OneView appliance

  • query (Hash<String,Object>) (defaults to: nil)

    Query parameters

Options Hash (query):

  • 'enclosure_group' (OneviewSDK::EnclosureGroup)

    Enclosure Group associated with the resource

  • 'server_profile' (OneviewSDK::ServerProfile)

    The server profile associated with the resource

  • 'server_hardware_type' (OneviewSDK::ServerHardwareType)

    The server hardware type associated with the resource

Returns:

  • (Hash)

    Hash containing all the available server information



326
327
328
329
330
331
332
333
334
# File 'lib/oneview-sdk/resource/api200/server_profile.rb', line 326

def self.get_available_servers(client, query = nil)
  if query
    query_uri = build_query(query)
    # profileUri attribute is not following the standards in OneView
    query_uri.sub!('serverProfileUri', 'profileUri')
  end
  response = client.rest_get("#{BASE_URI}/available-servers#{query_uri}")
  client.response_handler(response)
end