Module: Elasticsearch::XPack::API::Indices::Actions::ParamsRegistry

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

Constant Summary collapse

PARAMS =

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

Since:

  • 7.4.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)

Parameters:

  • action (Symbol)

    The action.

Returns:

  • (Array<Symbol>)

    The list of valid params for the action.

Since:

  • 7.4.0



54
55
56
# File 'lib/elasticsearch/xpack/api/actions/indices/params_registry.rb', line 54

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 ])

Parameters:

  • action (Symbol)

    The action to register.

  • valid_params (Array[Symbol])

    The list of valid params.

Since:

  • 7.4.0



40
41
42
# File 'lib/elasticsearch/xpack/api/actions/indices/params_registry.rb', line 40

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