Class: OneviewSDK::API300::Synergy::SASInterconnect

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

Overview

SAS Interconnect resource implementation

Constant Summary collapse

BASE_URI =
'/rest/sas-interconnects'.freeze
TYPE_URI =
'/rest/sas-interconnect-types'.freeze

Constants inherited from Resource

Resource::UNIQUE_IDENTIFIERS

Instance Attribute Summary

Attributes inherited from Resource

#api_version, #client, #data, #logger

Class Method Summary collapse

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) ⇒ SASInterconnect

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.


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

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

Class Method Details

.get_type(client, name) ⇒ Array

Retrieves a SAS interconnect type by name

Parameters:

  • client (OneviewSDK::Client)

    The client object for the OneView appliance

  • name (String)

    Interconnect type name

Returns:

  • (Array)

    Interconnect type


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

def self.get_type(client, name)
  results = get_types(client)
  results.find { |interconnect_type| interconnect_type['name'] == name }
end

.get_types(client) ⇒ Object

Retrieves SAS interconnect types

Parameters:


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

def self.get_types(client)
  response = client.rest_get(TYPE_URI)
  response = client.response_handler(response)
  response['members']
end

Instance Method Details

#createObject

Method is not available

Raises:


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

def create(*)
  unavailable_method
end

#deleteObject

Method is not available

Raises:


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

def delete(*)
  unavailable_method
end

#patch(operation, path, value) ⇒ Object

Updates specific attributes for a given SAS interconnect

Parameters:

  • operation (String)

    operation to be performed

  • path (String)

    path

  • value (String)

    value


78
79
80
81
82
83
# File 'lib/oneview-sdk/resource/api300/synergy/sas_interconnect.rb', line 78

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

#set_refresh_state(state) ⇒ Object

Set refresh state for SAS Interconnect

Parameters:

  • state (String)

    Desired refresh state


67
68
69
70
71
72
# File 'lib/oneview-sdk/resource/api300/synergy/sas_interconnect.rb', line 67

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

#updateObject

Method is not available

Raises:


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

def update(*)
  unavailable_method
end