Module: Elasticsearch::API::Cluster::Actions::ParamsRegistry

Extended by:
ParamsRegistry
Included in:
ParamsRegistry
Defined in:
lib/elasticsearch/api/actions/cluster/params_registry.rb

Constant Summary collapse

PARAMS =

A Mapping of all the actions to their list of valid params.

Since:

  • 6.2.0

{}

Instance Method Summary collapse

Instance Method Details

#get(action) ⇒ Array<Symbol>

Get the list of valid params for a given action.

Examples:

Get the list of valid params.

ParamsRegistry.get(:benchmark)

Since:

  • 6.2.0



37
38
39
# File 'lib/elasticsearch/api/actions/cluster/params_registry.rb', line 37

def get(action)
  PARAMS.fetch(action, [])
end

#register(action, valid_params) ⇒ Object

Register an action with its list of valid params.

Examples:

Register the action.

ParamsRegistry.register(:benchmark, [ :verbose ])

Since:

  • 6.2.0



23
24
25
# File 'lib/elasticsearch/api/actions/cluster/params_registry.rb', line 23

def register(action, valid_params)
  PARAMS[action.to_sym] = valid_params
end