Method: Elasticsearch::API::Cluster::Actions#put_settings

Defined in:
lib/elasticsearch/api/actions/cluster/put_settings.rb

#put_settings(arguments = {}) ⇒ Object

Updates the cluster settings.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :flat_settings (Boolean)

    Return settings in flat format (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :timeout (Time)

    Explicit operation timeout

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The settings to be updated. Can be either ‘transient` or `persistent` (survives cluster restart). (Required)

Raises:

  • (ArgumentError)

See Also:


35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/elasticsearch/api/actions/cluster/put_settings.rb', line 35

def put_settings(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'cluster.put_settings' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body) || {}

  method = Elasticsearch::API::HTTP_PUT
  path   = '_cluster/settings'
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end