Module: OneviewSDK::API300::Synergy::SASLogicalJBODHelper

Overview

Contains helper methods to include operation with SAS Logical JBOD

Constant Summary collapse

LOGICAL_JBOD_URI =
'/rest/sas-logical-jbods'.freeze
ATTACHMENT_URI =
'/rest/sas-logical-jbod-attachments'.freeze

Instance Method Summary collapse

Instance Method Details

#get_sas_logical_jbod(client, name) ⇒ Hash

Retrieves a SAS Logical JBOD by name

Parameters:

  • client (OneviewSDK::Client)

    The client object for the OneView appliance

  • name (String)

    SAS Logical JBOD name

Returns:

  • (Hash)

    Hash with the SAS Logical JBOD if found or nil



33
34
35
36
# File 'lib/oneview-sdk/resource/api300/synergy/server_profile.rb', line 33

def get_sas_logical_jbod(client, name)
  results = get_sas_logical_jbods(client)
  results.find { |item| item['name'] == name }
end

#get_sas_logical_jbod_attachment(client, name) ⇒ Hash

Retrieves a SAS Logical JBOD Attachment by name

Parameters:

  • client (OneviewSDK::Client)

    The client object for the OneView appliance

  • name (String)

    SAS Logical JBOD Attachment name

Returns:

  • (Hash)

    Hash with the SAS Logical JBOD Attachment if found or nil



59
60
61
62
# File 'lib/oneview-sdk/resource/api300/synergy/server_profile.rb', line 59

def get_sas_logical_jbod_attachment(client, name)
  results = get_sas_logical_jbod_attachments(client)
  results.find { |attachment| attachment['name'] == name }
end

#get_sas_logical_jbod_attachments(client) ⇒ Array

Retrieves all SAS Logical JBOD Attachments

Parameters:

Returns:

  • (Array)

    Array of SAS Logical JBOD Attachment



51
52
53
# File 'lib/oneview-sdk/resource/api300/synergy/server_profile.rb', line 51

def get_sas_logical_jbod_attachments(client)
  OneviewSDK::Resource.find_with_pagination(client, ATTACHMENT_URI)
end

#get_sas_logical_jbod_drives(client, name) ⇒ Array

Retrieves drives by SAS Logical JBOD name

Parameters:

  • client (OneviewSDK::Client)

    The client object for the OneView appliance

  • name (String)

    SAS Logical JBOD name

Returns:

  • (Array)

    Array of drives allocated for SAS logical JBOD



42
43
44
45
46
# File 'lib/oneview-sdk/resource/api300/synergy/server_profile.rb', line 42

def get_sas_logical_jbod_drives(client, name)
  item = get_sas_logical_jbod(client, name)
  response = client.rest_get(item['uri'] + '/drives')
  client.response_handler(response)
end

#get_sas_logical_jbods(client) ⇒ Array

Retrieves all SAS Logical JBOD

Parameters:

Returns:

  • (Array)

    Array of SAS Logical JBOD



25
26
27
# File 'lib/oneview-sdk/resource/api300/synergy/server_profile.rb', line 25

def get_sas_logical_jbods(client)
  OneviewSDK::Resource.find_with_pagination(client, LOGICAL_JBOD_URI)
end