Method: Elasticsearch::API::Indices::Actions#disk_usage

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

#disk_usage(arguments = {}) ⇒ Object

Analyzes the disk usage of each field of an index or data stream 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)

    Comma-separated list of indices or data streams to analyze the disk usage

  • :run_expensive_tasks (Boolean)

    Must be set to [true] in order for the task to be performed. Defaults to false.

  • :flush (Boolean)

    Whether flush or not before analyzing the index disk usage. Defaults to true

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



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

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

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

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_POST
  path   = "#{Utils.__listify(_index)}/_disk_usage"
  params = Utils.process_params(arguments)

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