Class: OneviewSDK::API300::Synergy::SASLogicalInterconnectGroup
- Defined in:
- lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect_group.rb
Overview
SAS Logical interconnect group resource implementation
Direct Known Subclasses
Constant Summary collapse
- BASE_URI =
'/rest/sas-logical-interconnect-groups'.freeze
Constants inherited from Resource
Resource::DEFAULT_REQUEST_HEADER, Resource::UNIQUE_IDENTIFIERS
Instance Attribute Summary collapse
-
#bay_count ⇒ Object
readonly
Returns the value of attribute bay_count.
Attributes inherited from Resource
#api_version, #client, #data, #logger
Instance Method Summary collapse
-
#add_interconnect(bay, type, enclosure_index = 1) ⇒ Object
Adds an interconnect.
-
#initialize(client, params = {}, api_ver = nil) ⇒ SASLogicalInterconnectGroup
constructor
Create a resource object, associate it with a client, and set its properties.
Methods inherited from Resource
#==, #[], #[]=, build_query, #create, #create!, #deep_merge!, #delete, #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) ⇒ SASLogicalInterconnectGroup
Create a resource object, associate it with a client, and set its properties.
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect_group.rb', line 27 def initialize(client, params = {}, api_ver = nil) super # Default values: @data['enclosureType'] ||= 'SY12000' @data['enclosureIndexes'] ||= [1] @data['state'] ||= 'Active' @data['type'] ||= 'sas-logical-interconnect-group' @data['interconnectBaySet'] ||= 1 @data['interconnectMapTemplate'] ||= {} @data['interconnectMapTemplate']['interconnectMapEntryTemplates'] ||= [] end |
Instance Attribute Details
#bay_count ⇒ Object (readonly)
Returns the value of attribute bay_count.
21 22 23 |
# File 'lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect_group.rb', line 21 def bay_count @bay_count end |
Instance Method Details
#add_interconnect(bay, type, enclosure_index = 1) ⇒ Object
Adds an interconnect
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect_group.rb', line 43 def add_interconnect(bay, type, enclosure_index = 1) parse_interconnect_map_template(bay, enclosure_index) @data['interconnectMapTemplate']['interconnectMapEntryTemplates'].each do |entry| entry['logicalLocation']['locationEntries'].each do |location| if location['type'] == 'Bay' && location['relativeValue'] == bay entry['permittedInterconnectTypeUri'] = OneviewSDK::API300::Synergy::SASInterconnect.get_type(@client, type)['uri'] end end end rescue StandardError list = OneviewSDK::API300::Synergy::SASInterconnect.get_types(@client).map { |t| t['name'] } raise "SAS Interconnect type '#{type}' not found! Supported types: #{list}" end |