module Elasticsearch::API::DanglingIndices::Actions

Public Instance Methods

delete_dangling_index(arguments = {}) click to toggle source

Deletes the specified dangling index

@option arguments [String] :index_uuid The UUID of the dangling index @option arguments [Boolean] :accept_data_loss Must be set to true in order to delete the dangling index @option arguments [Time] :timeout Explicit operation timeout @option arguments [Time] :master_timeout Specify timeout for connection to master @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/modules-gateway-dangling-indices.html

# File lib/elasticsearch/api/actions/dangling_indices/delete_dangling_index.rb, line 35
def delete_dangling_index(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'dangling_indices.delete_dangling_index' }

  defined_params = [:index_uuid].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index_uuid' missing" unless arguments[:index_uuid]

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

  body = nil

  _index_uuid = arguments.delete(:index_uuid)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_dangling/#{Utils.__listify(_index_uuid)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
import_dangling_index(arguments = {}) click to toggle source

Imports the specified dangling index

@option arguments [String] :index_uuid The UUID of the dangling index @option arguments [Boolean] :accept_data_loss Must be set to true in order to import the dangling index @option arguments [Time] :timeout Explicit operation timeout @option arguments [Time] :master_timeout Specify timeout for connection to master @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/modules-gateway-dangling-indices.html

# File lib/elasticsearch/api/actions/dangling_indices/import_dangling_index.rb, line 35
def import_dangling_index(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'dangling_indices.import_dangling_index' }

  defined_params = [:index_uuid].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index_uuid' missing" unless arguments[:index_uuid]

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

  body = nil

  _index_uuid = arguments.delete(:index_uuid)

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

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
list_dangling_indices(arguments = {}) click to toggle source

Returns all dangling indices.

@option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/modules-gateway-dangling-indices.html

# File lib/elasticsearch/api/actions/dangling_indices/list_dangling_indices.rb, line 31
def list_dangling_indices(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'dangling_indices.list_dangling_indices' }

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

  body   = nil

  method = Elasticsearch::API::HTTP_GET
  path   = '_dangling'
  params = {}

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