libraries/resource_providers/api200/uplink_set_provider.rb
# Looks for enclosures within Location Entries
# An IF statement by itself would try to iterate and raise an exception if locationEntries does not exist
Looks for enclosures within Location Entries
An IF statement by itself would try to iterate and raise an exception if locationEntries does not exist
Looks for enclosures within Location Entries An IF statement by itself would try to iterate and raise an exception if locationEntries does not exist
def load_enclosure
        return unless defined? @item.data['portConfigInfos'][0]['location']['locationEntries']
        @item.data['portConfigInfos'][0]['location']['locationEntries'].each do |entry|
          next unless entry && entry['type'] == 'Enclosure' && !entry['value'].to_s[0..17].include?('/rest/enclosures/')
          entry['value'] = load_resource(:Enclosure, { name: entry['value'], uri: entry['value'] }, 'uri')
        end
      end
def load_enclosure return unless defined? @item . data [ 'portConfigInfos' ] [ 0 ] [ 'location' ] [ 'locationEntries' ] @item . data [ 'portConfigInfos' ] [ 0 ] [ 'location' ] [ 'locationEntries' ] . each do | entry | next unless entry && entry [ 'type' ] == 'Enclosure' && ! entry [ 'value' ] . to_s [ 0 .. 17 ] . include? ( '/rest/enclosures/' ) entry [ 'value' ] = load_resource ( :Enclosure , { name : entry [ 'value' ] , uri : entry [ 'value' ] } , 'uri' ) end end
Looks for enclosures within Location Entries
An IF statement by itself would try to iterate and raise an exception if locationEntries does not exist
Looks for enclosures within Location Entries An IF statement by itself would try to iterate and raise an exception if locationEntries does not exist
# Checks whether the Enclosure has been declared, and sets its URI in case the user has referenced it by name # If the URI is already present, the following block is simply skipped