Method: Elasticsearch::API::Rollup::Actions#rollup

Defined in:
lib/elasticsearch/api/actions/rollup/rollup.rb

#rollup(arguments = {}) ⇒ Object

Rollup 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.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :index (String)

    The index to roll up (Required)

  • :rollup_index (String)

    The name of the rollup index to create (Required)

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The rollup configuration (Required)

Raises:

  • (ArgumentError)

See Also:



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

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

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

  body = arguments.delete(:body)

  arguments = arguments.clone

  _index = arguments.delete(:index)

  _rollup_index = arguments.delete(:rollup_index)

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

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