Module: ILO_SDK::ServiceRootHelper
- Included in:
- Client
- Defined in:
- lib/ilo-sdk/helpers/service_root_helper.rb
Overview
Contains helper methods for Service Root Actions
Instance Method Summary collapse
-
#get_registry(registry_prefix) ⇒ String
Get the Registry with given registry_prefix.
-
#get_schema(schema_prefix) ⇒ String
Get the schema information with given prefix.
Instance Method Details
#get_registry(registry_prefix) ⇒ String
Get the Registry with given registry_prefix
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/ilo-sdk/helpers/service_root_helper.rb', line 35 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) ⇒ String
Get the schema information with given prefix
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ilo-sdk/helpers/service_root_helper.rb', line 17 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 |