Module: Elasticsearch::API::DanglingIndices::Actions
- Defined in:
- lib/elasticsearch/api/actions/dangling_indices/delete_dangling_index.rb,
lib/elasticsearch/api/actions/dangling_indices/import_dangling_index.rb,
lib/elasticsearch/api/actions/dangling_indices/list_dangling_indices.rb
Instance Method Summary collapse
-
#delete_dangling_index(arguments = {}) ⇒ Object
Delete a dangling index.
-
#import_dangling_index(arguments = {}) ⇒ Object
Import a dangling index.
-
#list_dangling_indices(arguments = {}) ⇒ Object
Get the dangling indices.
Instance Method Details
#delete_dangling_index(arguments = {}) ⇒ Object
Delete a dangling index. If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling. For example, this can happen if you delete more than ‘cluster.indices.tombstones.size` indices while an Elasticsearch node is offline.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/elasticsearch/api/actions/dangling_indices/delete_dangling_index.rb', line 48 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 = {}) ⇒ Object
Import a dangling index. If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling. For example, this can happen if you delete more than ‘cluster.indices.tombstones.size` indices while an Elasticsearch node is offline.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/elasticsearch/api/actions/dangling_indices/import_dangling_index.rb', line 49 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 = {}) ⇒ Object
Get the dangling indices. If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling. For example, this can happen if you delete more than ‘cluster.indices.tombstones.size` indices while an Elasticsearch node is offline. Use this API to list dangling indices, which you can then import or delete.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/elasticsearch/api/actions/dangling_indices/list_dangling_indices.rb', line 45 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 = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |