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

Inherits:
Resource show all
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::UNIQUE_IDENTIFIERS

Instance Attribute Summary

Attributes inherited from Resource

#api_version, #client, #data, #logger

Instance Method Summary collapse

Methods inherited from Resource

#==, #[], #[]=, build_query, #create!, #each, #eql?, #exists?, find_by, from_file, get_all, #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.


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

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


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

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

#configurationObject

Asynchronously applies or re-applies the SAS logical interconnect configuration to all managed interconnects

Returns:

  • returns the updated object


101
102
103
104
105
106
# File 'lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect.rb', line 101

def configuration
  ensure_client && ensure_uri
  response = @client.rest_put(@data['uri'] + '/configuration', {}, @api_version)
  body = client.response_handler(response)
  set_all(body)
end

#createObject

Method is not available

Raises:


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

def create(*)
  unavailable_method
end

#deleteObject

Method is not available

Raises:


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

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:


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

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


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

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:


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

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