module ILO_SDK::ServiceRootHelper
Contains helper methods for Service Root Actions
Public Instance Methods
get_registry(registry_prefix)
click to toggle source
Get the Registry with given registry_prefix @param [String, Symbol] registry_prefix @raise [RuntimeError] if the request failed @return [Array] registry
# File lib/ilo-sdk/helpers/service_root_helper.rb, line 37 def get_registry(registry_prefix) response = rest_get('/redfish/v1/Registries/') registries = response_handler(response)['Items'] registry = registries.select { |reg| reg['Schema'].start_with?(registry_prefix) } info = [] registry.each do |reg| response = rest_get(reg['Location'][0]['Uri']['extref']) registry_store = response_handler(response) info.push(registry_store) end info end
get_schema(schema_prefix)
click to toggle source
Get the schema information with given prefix @param [String, Symbol] schema_prefix @raise [RuntimeError] if the request failed @return [Array] schema
# File lib/ilo-sdk/helpers/service_root_helper.rb, line 19 def get_schema(schema_prefix) response = rest_get('/redfish/v1/Schemas/') schemas = response_handler(response)['Items'] schema = schemas.select { |s| s['Schema'].start_with?(schema_prefix) } raise "NO schema found with this schema prefix : #{schema_prefix}" if schema.empty? info = [] schema.each do |sc| response = rest_get(sc['Location'][0]['Uri']['extref']) schema_store = response_handler(response) info.push(schema_store) end info end