Class: OneviewSDK::API300::C7000::EnclosureGroup
- Inherits:
-
OneviewSDK::API200::EnclosureGroup
- Object
- Resource
- OneviewSDK::API200::Resource
- OneviewSDK::API200::EnclosureGroup
- OneviewSDK::API300::C7000::EnclosureGroup
- Defined in:
- lib/oneview-sdk/resource/api300/c7000/enclosure_group.rb
Overview
Enclosure group resource implementation on API300 C7000
Direct Known Subclasses
Synergy::EnclosureGroup, OneviewSDK::API500::C7000::EnclosureGroup
Constant Summary
Constants inherited from OneviewSDK::API200::EnclosureGroup
OneviewSDK::API200::EnclosureGroup::BASE_URI
Constants inherited from Resource
Resource::BASE_URI, Resource::DEFAULT_REQUEST_HEADER, Resource::UNIQUE_IDENTIFIERS
Instance Attribute Summary
Attributes inherited from Resource
#api_version, #client, #data, #logger
Instance Method Summary collapse
-
#add_logical_interconnect_group(lig, enclosureIndex = nil) ⇒ OneviewSDK::API300::C7000::EnclosureGroup
Adds the logical interconnect group.
-
#create_interconnect_bay_mapping ⇒ OneviewSDK::API300::C7000::EnclosureGroup
Creates the interconnect bay mapping.
-
#initialize(client, params = {}, api_ver = nil) ⇒ EnclosureGroup
constructor
Create a resource object, associate it with a client, and set its properties.
Methods inherited from OneviewSDK::API200::EnclosureGroup
Methods inherited from Resource
#==, #[], #[]=, build_query, #create, #create!, #deep_merge!, #delete, #each, #eql?, #exists?, find_by, find_with_pagination, from_file, get_all, #like?, #refresh, #retrieve!, schema, #schema, #set, #set_all, #to_file, #update
Constructor Details
#initialize(client, params = {}, api_ver = nil) ⇒ EnclosureGroup
Create a resource object, associate it with a client, and set its properties.
24 25 26 27 28 29 30 31 |
# File 'lib/oneview-sdk/resource/api300/c7000/enclosure_group.rb', line 24 def initialize(client, params = {}, api_ver = nil) @data ||= {} # Default values: @data['type'] ||= 'EnclosureGroupV300' @data['enclosureCount'] ||= 1 @data['interconnectBayMappingCount'] ||= 8 super end |
Instance Method Details
#add_logical_interconnect_group(lig, enclosureIndex = nil) ⇒ OneviewSDK::API300::C7000::EnclosureGroup
Adds the logical interconnect group
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/oneview-sdk/resource/api300/c7000/enclosure_group.rb', line 38 def add_logical_interconnect_group(lig, enclosureIndex = nil) lig.retrieve! unless lig['uri'] raise(NotFound, "The logical interconnect group #{lig['name']} was not found") unless lig['uri'] lig['interconnectMapTemplate']['interconnectMapEntryTemplates'].each do |entry| entry['logicalLocation']['locationEntries'].each do |location| next unless location['type'] == 'Bay' && entry['permittedInterconnectTypeUri'] add_lig_to_bay(location['relativeValue'], lig, enclosureIndex) end end self end |
#create_interconnect_bay_mapping ⇒ OneviewSDK::API300::C7000::EnclosureGroup
Creates the interconnect bay mapping
52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/oneview-sdk/resource/api300/c7000/enclosure_group.rb', line 52 def create_interconnect_bay_mapping @data['interconnectBayMappings'] = [] 1.upto(@data['enclosureCount']) do |enclosureIndex| 1.upto(@data['interconnectBayMappingCount']) do |bay_number| entry = { 'enclosureIndex' => enclosureIndex, 'interconnectBay' => bay_number, 'logicalInterconnectGroupUri' => nil } @data['interconnectBayMappings'] << entry end end self end |