Watcher: Hijack REST delete/udpate by query operations

Delete/Update by query was not disabled for the watcher index
on HTTP.

relates elastic/x-pack-elasticsearch#586

Original commit: elastic/x-pack-elasticsearch@b41b375379
This commit is contained in:
Alexander Reelsen 2017-02-17 14:32:31 +01:00
parent 48ee5e021d
commit 7d7da4262f
2 changed files with 30 additions and 1 deletions

View File

@ -43,6 +43,10 @@ public class RestHijackOperationAction extends WatcherRestHandler {
controller.registerHandler(PUT, Watch.INDEX + "/watch/_bulk", unsupportedHandler); controller.registerHandler(PUT, Watch.INDEX + "/watch/_bulk", unsupportedHandler);
controller.registerHandler(PUT, Watch.INDEX + "/_bulk", unsupportedHandler); controller.registerHandler(PUT, Watch.INDEX + "/_bulk", unsupportedHandler);
controller.registerHandler(DELETE, Watch.INDEX, unsupportedHandler); controller.registerHandler(DELETE, Watch.INDEX, unsupportedHandler);
controller.registerHandler(POST, Watch.INDEX + "/_delete_by_query", unsupportedHandler);
controller.registerHandler(POST, Watch.INDEX + "/watch/_delete_by_query", unsupportedHandler);
controller.registerHandler(POST, Watch.INDEX + "/_update_by_query", unsupportedHandler);
controller.registerHandler(POST, Watch.INDEX + "/watch/_update_by_query", unsupportedHandler);
} }
} }

View File

@ -48,7 +48,6 @@
- { "index": {}} - { "index": {}}
- {} - {}
- do: - do:
catch: /not supported/ catch: /not supported/
bulk: bulk:
@ -56,3 +55,29 @@
body: body:
- { "index": {}} - { "index": {}}
- {} - {}
- do:
catch: /not supported/
delete_by_query:
index: ".watches"
body: {}
- do:
catch: /not supported/
delete_by_query:
index: ".watches"
type: "watch"
body: {}
- do:
catch: /not supported/
update_by_query:
index: ".watches"
body: {}
- do:
catch: /not supported/
update_by_query:
index: ".watches"
type: "watch"
body: {}