in elasticsearch-api/lib/elasticsearch/api/actions/indices/delete.rb [61:94]
def delete(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'indices.delete' }
defined_params = [:index].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' missing" unless arguments[:index]
arguments = arguments.clone
headers = arguments.delete(:headers) || {}
body = nil
_index = arguments.delete(:index)
method = Elasticsearch::API::HTTP_DELETE
path = Utils.listify(_index).to_s
params = Utils.process_params(arguments)
if Array(arguments[:ignore]).include?(404)
Utils.rescue_from_not_found do
Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
)
end
else
Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
)
end
end