Module: Elasticsearch::API::DanglingIndices::Actions
- Included in:
- DanglingIndicesClient
- Defined in:
- lib/elasticsearch/api/namespace/dangling_indices.rb,
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
Deletes the specified dangling index.
-
#import_dangling_index(arguments = {}) ⇒ Object
Imports the specified dangling index.
-
#list_dangling_indices(arguments = {}) ⇒ Object
Returns all dangling indices.
Instance Method Details
#delete_dangling_index(arguments = {}) ⇒ Object
Deletes the specified dangling index
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# 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 = {}) ⇒ Object
Imports the specified dangling index
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# 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 = {}) ⇒ Object
Returns all dangling indices.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# 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 |