Class: OneviewSDK::API300::Synergy::DriveEnclosure

Inherits:
Resource show all
Defined in:
lib/oneview-sdk/resource/api300/synergy/drive_enclosure.rb

Overview

Drive enclosure resource implementation for API300 Synergy

Constant Summary collapse

BASE_URI =
'/rest/drive-enclosures'.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

Constructor Details

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

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/drive_enclosure.rb', line 25

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

Instance Method Details

#createObject

Method is unavailable

Raises:



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

def create(*)
  unavailable_method
end

#deleteObject

Method is unavailable

Raises:



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

def delete(*)
  unavailable_method
end

#get_port_mapObject

Retrieve the drive enclosure I/O adapter port to SAS interconnect port connectivity



48
49
50
51
# File 'lib/oneview-sdk/resource/api300/synergy/drive_enclosure.rb', line 48

def get_port_map
  response = @client.rest_get(@data['uri'] + '/port-map')
  response.body
end

#patch(operation, path, value) ⇒ Object

Update specific attributes of a given drive enclosure

Parameters:

  • operation (String)

    Operation to be performed

  • path (String)

    Path

  • value (String)

    Value



64
65
66
67
# File 'lib/oneview-sdk/resource/api300/synergy/drive_enclosure.rb', line 64

def patch(operation, path, value)
  response = @client.rest_patch(@data['uri'], 'body' => [{ op: operation, path: path, value: value }])
  @client.response_handler(response)
end

#set_refresh_state(state) ⇒ Object

Refresh a drive enclosure

Parameters:

  • state (String)

    Indicates if the resource is currently refreshing



55
56
57
58
# File 'lib/oneview-sdk/resource/api300/synergy/drive_enclosure.rb', line 55

def set_refresh_state(state)
  response = @client.rest_put(@data['uri'] + '/refreshState', 'body' => { refreshState: state })
  @client.response_handler(response)
end

#updateObject

Method is unavailable

Raises:



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

def update(*)
  unavailable_method
end