Method: Elasticsearch::API::Watcher::Actions#update_settings

Defined in:
lib/elasticsearch/api/actions/watcher/update_settings.rb

#update_settings(arguments = {}) ⇒ Object

Update settings for the watcher system index

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :timeout (Time)

    Specify timeout for waiting for acknowledgement from all nodes

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    An object with the new index settings (Required)

Raises:

  • (ArgumentError)

See Also:


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

def update_settings(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'watcher.update_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   = '_watcher/settings'
  params = Utils.process_params(arguments)

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