Module: OpenSearch::API::DanglingIndices::Actions

Included in:
DanglingIndicesClient
Defined in:
lib/opensearch/api/namespace/dangling_indices.rb,
lib/opensearch/api/actions/dangling_indices/params_registry.rb,
lib/opensearch/api/actions/dangling_indices/delete_dangling_index.rb,
lib/opensearch/api/actions/dangling_indices/import_dangling_index.rb,
lib/opensearch/api/actions/dangling_indices/list_dangling_indices.rb

Defined Under Namespace

Modules: ParamsRegistry

Instance Method Summary collapse

Instance Method Details

#delete_dangling_index(arguments = {}) ⇒ Object

Deletes the specified dangling index

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :index_uuid (String)

    The UUID of the dangling index

  • :accept_data_loss (Boolean)

    Must be set to true in order to delete the dangling index

  • :timeout (Time)

    Explicit operation timeout

  • :master_timeout (Time) — default: DEPRECATED: use cluster_manager_timeout instead

    Specify timeout for connection to master

  • :cluster_manager_timeout (Time)

    Specify timeout for connection to cluster_manager

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/opensearch/api/actions/dangling_indices/delete_dangling_index.rb', line 41

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

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

  arguments = arguments.clone

  _index_uuid = arguments.delete(:index_uuid)

  method = OpenSearch::API::HTTP_DELETE
  path   = "_dangling/#{Utils.__listify(_index_uuid)}"
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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

#import_dangling_index(arguments = {}) ⇒ Object

Imports the specified dangling index

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :index_uuid (String)

    The UUID of the dangling index

  • :accept_data_loss (Boolean)

    Must be set to true in order to import the dangling index

  • :timeout (Time)

    Explicit operation timeout

  • :master_timeout (Time) — default: DEPRECATED: use cluster_manager_timeout instead

    Specify timeout for connection to master

  • :cluster_manager_timeout (Time)

    Specify timeout for connection to cluster_manager

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)


40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/opensearch/api/actions/dangling_indices/import_dangling_index.rb', line 40

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

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

  arguments = arguments.clone

  _index_uuid = arguments.delete(:index_uuid)

  method = OpenSearch::API::HTTP_POST
  path   = "_dangling/#{Utils.__listify(_index_uuid)}"
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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

#list_dangling_indices(arguments = {}) ⇒ Object

Returns all dangling indices.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :headers (Hash)

    Custom HTTP headers



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/opensearch/api/actions/dangling_indices/list_dangling_indices.rb', line 36

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

  arguments = arguments.clone

  method = OpenSearch::API::HTTP_GET
  path   = "_dangling"
  params = {}

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