Class: OneviewSDK::API300::Synergy::LogicalEnclosure

Inherits:
C7000::LogicalEnclosure show all
Defined in:
lib/oneview-sdk/resource/api300/synergy/logical_enclosure.rb

Overview

Logical Enclosure resource implementation on API300 Synergy

Constant Summary

Constants inherited from OneviewSDK::API200::LogicalEnclosure

OneviewSDK::API200::LogicalEnclosure::BASE_URI

Constants inherited from Resource

Resource::BASE_URI, Resource::UNIQUE_IDENTIFIERS

Instance Attribute Summary

Attributes inherited from Resource

#api_version, #client, #data, #logger

Instance Method Summary collapse

Methods inherited from C7000::LogicalEnclosure

#patch

Methods inherited from OneviewSDK::API200::LogicalEnclosure

#get_script, #reconfigure, #support_dump, #update_from_group

Methods inherited from Resource

#==, #[], #[]=, build_query, #create, #create!, #delete, #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) ⇒ LogicalEnclosure

Returns a new instance of LogicalEnclosure.


20
21
22
# File 'lib/oneview-sdk/resource/api300/synergy/logical_enclosure.rb', line 20

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

Instance Method Details

#set_enclosure_group(enclosure_group) ⇒ Object

Sets the enclosure group for the logical enclosure

Parameters:


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

def set_enclosure_group(enclosure_group)
  self['enclosureGroupUri'] = enclosure_group['uri'] if enclosure_group['uri'] || enclosure_group.retrieve!
  raise "Resource #{enclosure_group['name']} could not be found!" unless enclosure_group['uri']
end

#set_enclosures(enclosures = []) ⇒ Object

Sets a list of enclosures uris for the logical enclosure

Parameters:

  • Array (Array)

    of OneviewSDK::API300::Synergy::Enclosure


33
34
35
36
37
38
39
40
41
42
# File 'lib/oneview-sdk/resource/api300/synergy/logical_enclosure.rb', line 33

def set_enclosures(enclosures = [])
  enclosureUris = []
  enclosures.each do |enclosure|
    enclosureUris.push(enclosure['uri']) if enclosure['uri'] || enclosure.retrieve!
    raise "Resource #{enclosure['name']} could not be found!" unless enclosure['uri']
  end

  raise 'EnclosureUris is empty!' if enclosureUris.empty?
  self['enclosureUris'] = enclosureUris unless enclosureUris.empty?
end

#set_firmware_driver(firmware) ⇒ Object

Sets the firmware driver uri for the logical enclosure

Parameters:


46
47
48
49
# File 'lib/oneview-sdk/resource/api300/synergy/logical_enclosure.rb', line 46

def set_firmware_driver(firmware)
  self['firmwareBaselineUri'] = firmware['uri'] if firmware['uri'] || firmware.retrieve!
  raise "Resource #{firmware['customBaselineName']} could not be found!" unless firmware['uri']
end

#set_scriptObject

Method is not available

Raises:


53
54
55
# File 'lib/oneview-sdk/resource/api300/synergy/logical_enclosure.rb', line 53

def set_script(*)
  unavailable_method
end