Class: HybridPlatformsConductor::HpcPlugins::Cmdb::PlatformHandlers

Inherits:
Cmdb
  • Object
show all
Defined in:
lib/hybrid_platforms_conductor/hpc_plugins/cmdb/platform_handlers.rb

Overview

CMDB getting metadata from the Platform Handlers directly

Constant Summary

Constants included from LoggerHelpers

LoggerHelpers::LEVELS_MODIFIERS, LoggerHelpers::LEVELS_TO_STDERR

Instance Method Summary collapse

Methods inherited from Cmdb

#initialize

Methods inherited from Plugin

extend_config_dsl_with, #initialize, valid?

Methods included from LoggerHelpers

#err, #init_loggers, #log_component=, #log_debug?, #log_level=, #out, #section, #set_loggers_format, #stderr_device, #stderr_device=, #stderr_displayed?, #stdout_device, #stdout_device=, #stdout_displayed?, #stdouts_to_s, #with_progress_bar

Constructor Details

This class inherits a constructor from HybridPlatformsConductor::Cmdb

Instance Method Details

#get_others(nodes, metadata) ⇒ Object

Get other properties for a given set of nodes. It’s better to not use this method and prefer using methods naming the property being returned. As the nodes_handler can’t know in advance which properties will be returned, it will call it every time there is a missing property. If this method always returns the same values, it would be clever to cache it here.

API
  • This method is optional.

API
  • @platforms_handler can be used.

API
  • @nodes_handler can be used.

API
  • @cmd_runner can be used.

Parameters
  • nodes (Array<String>): The nodes to lookup the property for.

  • metadata (Hash<String, Hash<Symbol,Object> >): Existing metadata for each node. Dependent properties should be present here.

Result
  • Hash<String, Hash<Symbol,Object> >: The corresponding properties, per required node.

    Nodes for which the property can't be fetched can be ommitted.
    


44
45
46
# File 'lib/hybrid_platforms_conductor/hpc_plugins/cmdb/platform_handlers.rb', line 44

def get_others(nodes, )
  Hash[nodes.map { |node| [node, platform_for(node).(node)] }]
end

#get_services(nodes, metadata) ⇒ Object

Get a specific property for a given set of nodes.

API
  • @platforms_handler can be used.

API
  • @nodes_handler can be used.

API
  • @cmd_runner can be used.

Parameters
  • nodes (Array<String>): The nodes to lookup the property for.

  • metadata (Hash<String, Hash<Symbol,Object> >): Existing metadata for each node. Dependent properties should be present here.

Result
  • Hash<String, Object>: The corresponding property, per required node.

    Nodes for which the property can't be fetched can be ommitted.
    


25
26
27
# File 'lib/hybrid_platforms_conductor/hpc_plugins/cmdb/platform_handlers.rb', line 25

def get_services(nodes, )
  Hash[nodes.map { |node| [node, platform_for(node).services_for(node)] }]
end