module Elasticsearch::XPack::API::Rollup::Actions

Public Instance Methods

delete_job(arguments = {}) click to toggle source

Deletes an existing rollup job. 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.

@option arguments [String] :id The ID of the job to delete @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/rollup-delete-job.html

# File lib/elasticsearch/xpack/api/actions/rollup/delete_job.rb, line 34
def delete_job(arguments = {})
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]

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

  arguments = arguments.clone

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_rollup/job/#{Elasticsearch::API::Utils.__listify(_id)}"
  params = {}

  body = nil
  perform_request(method, path, params, body, headers).body
end
get_jobs(arguments = {}) click to toggle source

Retrieves the configuration, stats, and status of rollup jobs. 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.

@option arguments [String] :id The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/rollup-get-job.html

# File lib/elasticsearch/xpack/api/actions/rollup/get_jobs.rb, line 34
def get_jobs(arguments = {})
  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _id
             "_rollup/job/#{Elasticsearch::API::Utils.__listify(_id)}"
           else
             "_rollup/job"
           end
  params = {}

  body = nil
  perform_request(method, path, params, body, headers).body
end
get_rollup_caps(arguments = {}) click to toggle source

Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. 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.

@option arguments [String] :id The ID of the index to check rollup capabilities on, or left blank for all jobs @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/rollup-get-rollup-caps.html

# File lib/elasticsearch/xpack/api/actions/rollup/get_rollup_caps.rb, line 34
def get_rollup_caps(arguments = {})
  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _id
             "_rollup/data/#{Elasticsearch::API::Utils.__listify(_id)}"
           else
             "_rollup/data"
           end
  params = {}

  body = nil
  perform_request(method, path, params, body, headers).body
end
get_rollup_index_caps(arguments = {}) click to toggle source

Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). 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.

@option arguments [String] :index The rollup index or index pattern to obtain rollup capabilities from. @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/rollup-get-rollup-index-caps.html

# File lib/elasticsearch/xpack/api/actions/rollup/get_rollup_index_caps.rb, line 34
def get_rollup_index_caps(arguments = {})
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]

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

  arguments = arguments.clone

  _index = arguments.delete(:index)

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

  body = nil
  perform_request(method, path, params, body, headers).body
end
put_job(arguments = {}) click to toggle source

Creates a rollup job. 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.

@option arguments [String] :id The ID of the job to create @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The job configuration (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/rollup-put-job.html

# File lib/elasticsearch/xpack/api/actions/rollup/put_job.rb, line 35
def put_job(arguments = {})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]

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

  arguments = arguments.clone

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_rollup/job/#{Elasticsearch::API::Utils.__listify(_id)}"
  params = {}

  body = arguments[:body]
  perform_request(method, path, params, body, headers).body
end
rollup(arguments = {}) click to toggle source

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.

@option arguments [String] :index The index to roll up (Required) @option arguments [String] :rollup_index The name of the rollup index to create (Required) @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The rollup configuration (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/xpack-rollup.html

# File lib/elasticsearch/xpack/api/actions/rollup/rollup.rb, line 36
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) || {}

  arguments = arguments.clone

  _index = arguments.delete(:index)

  _rollup_index = arguments.delete(:rollup_index)

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

  body = arguments[:body]
  perform_request(method, path, params, body, headers).body
end
start_job(arguments = {}) click to toggle source

Starts an existing, stopped rollup job. 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.

@option arguments [String] :id The ID of the job to start @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/rollup-start-job.html

# File lib/elasticsearch/xpack/api/actions/rollup/start_job.rb, line 34
def start_job(arguments = {})
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]

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

  arguments = arguments.clone

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_rollup/job/#{Elasticsearch::API::Utils.__listify(_id)}/_start"
  params = {}

  body = nil
  perform_request(method, path, params, body, headers).body
end
stop_job(arguments = {}) click to toggle source

Stops an existing, started rollup job. 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.

@option arguments [String] :id The ID of the job to stop @option arguments [Boolean] :wait_for_completion True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false. @option arguments [Time] :timeout Block for (at maximum) the specified duration while waiting for the job to stop. Defaults to 30s. @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/rollup-stop-job.html

# File lib/elasticsearch/xpack/api/actions/rollup/stop_job.rb, line 36
def stop_job(arguments = {})
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]

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

  arguments = arguments.clone

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_rollup/job/#{Elasticsearch::API::Utils.__listify(_id)}/_stop"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = nil
  perform_request(method, path, params, body, headers).body
end