Skip to content

Commit ca3d6e7

Browse files
committed
[API] Adds ignore 404 parameter to query_rules.delete_ruleset
1 parent c414616 commit ca3d6e7

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

elasticsearch-api/lib/elasticsearch/api/actions/query_rules/delete_ruleset.rb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,19 @@ def delete_ruleset(arguments = {})
5050

5151
method = Elasticsearch::API::HTTP_DELETE
5252
path = "_query_rules/#{Utils.listify(_ruleset_id)}"
53-
params = {}
53+
params = Utils.process_params(arguments)
5454

55-
Elasticsearch::API::Response.new(
56-
perform_request(method, path, params, body, headers, request_opts)
57-
)
55+
if Array(arguments[:ignore]).include?(404)
56+
Utils.rescue_from_not_found do
57+
Elasticsearch::API::Response.new(
58+
perform_request(method, path, params, body, headers, request_opts)
59+
)
60+
end
61+
else
62+
Elasticsearch::API::Response.new(
63+
perform_request(method, path, params, body, headers, request_opts)
64+
)
65+
end
5866
end
5967
end
6068
end

elasticsearch-api/lib/elasticsearch/api/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
module Elasticsearch
1919
module API
2020
VERSION = '9.0.0'.freeze
21-
ES_SPECIFICATION_COMMIT = '55d1444f19ce33e5a7a318e51ccc638a7901959c'.freeze
21+
ES_SPECIFICATION_COMMIT = '1403bac9354d232024184bd992ecc76aaa9e68fa'.freeze
2222
end
2323
end

0 commit comments

Comments
 (0)