Conversation
This reverts commit 7a462df.
hub-cap
left a comment
There was a problem hiding this comment.
Small nits, one question.
|
|
||
| static Request executeWatch(ExecuteWatchRequest executeWatchRequest) throws IOException { | ||
| RequestConverters.EndpointBuilder builder = new RequestConverters.EndpointBuilder() | ||
| .addPathPart("_xpack", "watcher", "watch"); |
There was a problem hiding this comment.
these can be .addPathPartAsIs since they are not user supplied.
| RequestConverters.EndpointBuilder builder = new RequestConverters.EndpointBuilder() | ||
| .addPathPart("_xpack", "watcher", "watch"); | ||
| if (executeWatchRequest.getId() != null) { | ||
| builder.addPathPart(executeWatchRequest.getId()); |
There was a problem hiding this comment.
addPathPart wont "build" anything thats null, so u can just call it instead of checking for null.
|
|
||
| request.setActionMode("action1", ExecuteWatchRequest.ActionExecutionMode.SIMULATE); | ||
|
|
||
| String triggerData = "{ \"entry1\" : \"blah\", \"entry2\" : \"blah\" }"; |
There was a problem hiding this comment.
are these mandatory? if they can be null pls add some random() here. If they cant be null then pls add them to the constructor as final's if possible :)
...core/src/main/java/org/elasticsearch/xpack/core/watcher/support/xcontent/XContentSource.java
Show resolved
Hide resolved
|
Thanks @hub-cap, I pushed some changes to address your comments. |
hub-cap
left a comment
There was a problem hiding this comment.
one minor nit. Also, something to note is that there is a PR that is conflicting with this that removes _xpack from the HLRC and tests etc... If it merges first, ill link it to you, otherwise you win and I have to do the work ;)
| builder.addPathPart(executeWatchRequest.getId()); | ||
| } | ||
| .addPathPartAsIs("_xpack", "watcher", "watch"); | ||
| builder.addPathPart(executeWatchRequest.getId()); // will ignore if ID is null |
There was a problem hiding this comment.
String endpoint = new RequestConverters.EndpointBuilder()
.addPathPartAsIs("_xpack", "watcher", "watch")
.addPathPart(...getId())
.addPathPartAsIs("_execute").build()
|
run the gradle build tests 2 |
This change adds support for the execute watch API in the high level rest client
Relates to #29827