module Elasticsearch::XPack::API::Indices::Actions

Public Instance Methods

create_data_stream(arguments = {}) click to toggle source

Creates a data stream

@option arguments [String] :name The name of the data stream @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/data-streams.html

# File lib/elasticsearch/xpack/api/actions/indices/create_data_stream.rb, line 30
def create_data_stream(arguments = {})
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

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

  arguments = arguments.clone

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_data_stream/#{Elasticsearch::API::Utils.__listify(_name)}"
  params = {}

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

Provides statistics on operations happening in a data stream.

@option arguments [List] :name A comma-separated list of data stream names; use `_all` or empty string to perform the operation on all data streams @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/data-streams.html

# File lib/elasticsearch/xpack/api/actions/indices/data_streams_stats.rb, line 30
def data_streams_stats(arguments = {})
  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = if _name
             "_data_stream/#{Elasticsearch::API::Utils.__listify(_name)}/_stats"
           else
             "_data_stream/_stats"
           end
  params = {}

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

Deletes a data stream.

@option arguments [List] :name A comma-separated list of data streams to delete; use `*` to delete all data streams @option arguments [String] :expand_wildcards Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/data-streams.html

# File lib/elasticsearch/xpack/api/actions/indices/delete_data_stream.rb, line 31
def delete_data_stream(arguments = {})
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

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

  arguments = arguments.clone

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_data_stream/#{Elasticsearch::API::Utils.__listify(_name)}"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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

Freezes an index. A frozen index has almost no overhead on the cluster (except for maintaining its metadata in memory) and is read-only.

@option arguments [String] :index The name of the index to freeze @option arguments [Time] :timeout Explicit operation timeout @option arguments [Time] :master_timeout Specify timeout for connection to master @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) @option arguments [String] :wait_for_active_shards Sets the number of active shards to wait for before the operation returns. @option arguments [Hash] :headers Custom HTTP headers

*Deprecation notice*: Frozen indices are deprecated because they provide no benefit given improvements in heap memory utilization. They will be removed in a future release. Deprecated since version 7.14.0

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/freeze-index-api.html

# File lib/elasticsearch/xpack/api/actions/indices/freeze.rb, line 41
def freeze(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_POST
  path   = "#{Elasticsearch::API::Utils.__listify(_index)}/_freeze"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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

Returns data streams.

@option arguments [List] :name A comma-separated list of data streams to get; use `*` to get all data streams @option arguments [String] :expand_wildcards Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/data-streams.html

# File lib/elasticsearch/xpack/api/actions/indices/get_data_stream.rb, line 31
def get_data_stream(arguments = {})
  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = if _name
             "_data_stream/#{Elasticsearch::API::Utils.__listify(_name)}"
           else
             "_data_stream"
           end
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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

Migrates an alias to a data stream

@option arguments [String] :name The name of the alias to migrate @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/data-streams.html

# File lib/elasticsearch/xpack/api/actions/indices/migrate_to_data_stream.rb, line 30
def migrate_to_data_stream(arguments = {})
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

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

  arguments = arguments.clone

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_POST
  path   = "_data_stream/_migrate/#{Elasticsearch::API::Utils.__listify(_name)}"
  params = {}

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

Promotes a data stream from a replicated data stream managed by CCR to a regular data stream

@option arguments [String] :name The name of the data stream @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/data-streams.html

# File lib/elasticsearch/xpack/api/actions/indices/promote_data_stream.rb, line 30
def promote_data_stream(arguments = {})
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

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

  arguments = arguments.clone

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_POST
  path   = "_data_stream/_promote/#{Elasticsearch::API::Utils.__listify(_name)}"
  params = {}

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

Reloads an index's search analyzers and their resources.

@option arguments [List] :index A comma-separated list of index names to reload analyzers for @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/indices-reload-analyzers.html

# File lib/elasticsearch/xpack/api/actions/indices/reload_search_analyzers.rb, line 33
def reload_search_analyzers(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)}/_reload_search_analyzers"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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

Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again.

@option arguments [String] :index The name of the index to unfreeze @option arguments [Time] :timeout Explicit operation timeout @option arguments [Time] :master_timeout Specify timeout for connection to master @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) @option arguments [String] :wait_for_active_shards Sets the number of active shards to wait for before the operation returns. @option arguments [Hash] :headers Custom HTTP headers

*Deprecation notice*: Frozen indices are deprecated because they provide no benefit given improvements in heap memory utilization. They will be removed in a future release. Deprecated since version 7.14.0

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/unfreeze-index-api.html

# File lib/elasticsearch/xpack/api/actions/indices/unfreeze.rb, line 41
def unfreeze(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_POST
  path   = "#{Elasticsearch::API::Utils.__listify(_index)}/_unfreeze"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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