Method: Elasticsearch::API::Indices::Actions#downsample

Defined in:
lib/elasticsearch/api/actions/indices/downsample.rb

#downsample(arguments = {}) ⇒ Object

Downsample an index This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Options Hash (arguments):

  • :index (String)

    The index to downsample (Required)

  • :target_index (String)

    The name of the target index to store downsampled data (Required)

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The downsampling configuration (Required)

Raises:

  • (ArgumentError)

See Also:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/elasticsearch/api/actions/indices/downsample.rb', line 38

def downsample(arguments = {})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
  raise ArgumentError, "Required argument 'target_index' missing" unless arguments[:target_index]

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

  body   = arguments.delete(:body)

  _index = arguments.delete(:index)

  _target_index = arguments.delete(:target_index)

  method = Elasticsearch::API::HTTP_POST
  path   = "#{Utils.__listify(_index)}/_downsample/#{Utils.__listify(_target_index)}"
  params = {}

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