Class: OneviewSDK::API300::Synergy::SASLogicalInterconnect

Inherits:
Resource show all
Includes:
ResourceHelper::ConfigurationOperation
Defined in:
lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect.rb

Overview

SAS logical interconnect resource implementation

Constant Summary collapse

BASE_URI =
'/rest/sas-logical-interconnects'.freeze

Constants inherited from Resource

Resource::DEFAULT_REQUEST_HEADER, Resource::UNIQUE_IDENTIFIERS

Instance Attribute Summary

Attributes inherited from Resource

#api_version, #client, #data, #logger

Instance Method Summary collapse

Methods included from ResourceHelper::ConfigurationOperation

#configuration

Methods inherited from Resource

#==, #[], #[]=, build_query, #create!, #deep_merge!, #each, #eql?, #exists?, find_by, find_with_pagination, from_file, get_all, get_all_with_query, #like?, #refresh, #retrieve!, schema, #schema, #set, #set_all, #to_file, #update

Constructor Details

#initialize(client, params = {}, api_ver = nil) ⇒ SASLogicalInterconnect

Create a resource object, associate it with a client, and set its properties.

Parameters:

  • client (OneviewSDK::Client)

    The client object for the OneView appliance

  • params (Hash) (defaults to: {})

    The options for this resource (key-value pairs)

  • api_ver (Integer) (defaults to: nil)

    The api version to use when interracting with this resource.



27
28
29
# File 'lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect.rb', line 27

def initialize(client, params = {}, api_ver = nil)
  super
end

Instance Method Details

#complianceObject

Returns SAS logical interconnects to a consistent state. The current SAS logical interconnect state is compared to the associated SAS logical interconnect group.

Returns:

  • returns the updated object



46
47
48
49
50
51
52
53
54
55
# File 'lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect.rb', line 46

def compliance
  ensure_client && ensure_uri
  update_options = {
    'If-Match' =>  @data['eTag'],
    'body' => { 'type' => 'sas-logical-interconnect' }
  }
  response = @client.rest_put(@data['uri'] + '/compliance', update_options, @api_version)
  body = @client.response_handler(response)
  set_all(body)
end

#createObject

Method is not available

Raises:



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

def create(*)
  unavailable_method
end

#deleteObject

Method is not available

Raises:



39
40
41
# File 'lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect.rb', line 39

def delete(*)
  unavailable_method
end

#firmware_update(command, firmware_driver, firmware_options) ⇒ Object

Update firmware

Parameters:

  • command (String)
  • firmware_driver (OneviewSDK::FirmwareDriver)
  • firmware_options (Hash)

Raises:



70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect.rb', line 70

def firmware_update(command, firmware_driver, firmware_options)
  ensure_client && ensure_uri
  firmware_options['command'] = command
  firmware_options['sppUri'] =  firmware_driver['uri']
  firmware_options['sppName'] = firmware_driver['name']
  update_json = {
    'If-Match' => '*',
    'body' => firmware_options
  }
  response = @client.rest_put(@data['uri'] + '/firmware', update_json)
  @client.response_handler(response)
end

#get_firmwareHash

Gets the installed firmware for a SAS logical interconnect.

Returns:

  • (Hash)

    Contains all firmware information



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

def get_firmware
  ensure_client && ensure_uri
  response = @client.rest_get(@data['uri'] + '/firmware')
  @client.response_handler(response)
end

#replace_drive_enclosure(old_serial_number, new_serial_number) ⇒ Object

Initiates the replacement operation after a drive enclosure has been physically replaced.

Parameters:

  • old_serial_number (String)
  • new_serial_number (String)

Raises:



87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect.rb', line 87

def replace_drive_enclosure(old_serial_number, new_serial_number)
  ensure_client && ensure_uri
  drive_enclosure_options = {
    'oldSerialNumber' => old_serial_number,
    'newSerialNumber' => new_serial_number
  }
  update_json = {
    'If-Match' => '*',
    'body' => drive_enclosure_options
  }
  response = @client.rest_post(@data['uri'] + '/replaceDriveEnclosure', update_json)
  @client.response_handler(response)
end