Skip to content

Commit

Permalink
[CCR] Resume follow Api should not require a request body (#37217)
Browse files Browse the repository at this point in the history
Closes #37022
  • Loading branch information
martijnvg authored Jan 10, 2019
1 parent eb12de5 commit 1a41d84
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
- do:
ccr.resume_follow:
index: bar
body: {}
- is_true: acknowledged

- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient
}

static Request createRequest(RestRequest restRequest) throws IOException {
try (XContentParser parser = restRequest.contentOrSourceParamParser()) {
return Request.fromXContent(parser, restRequest.param("index"));
if (restRequest.hasContentOrSourceParam()) {
try (XContentParser parser = restRequest.contentOrSourceParamParser()) {
return Request.fromXContent(parser, restRequest.param("index"));
}
} else {
Request request = new Request();
request.setFollowerIndex(restRequest.param("index"));
return request;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"body": {
"description" : "The name of the leader index and other optional ccr related parameters",
"required" : true
"required" : false
}
}
}

0 comments on commit 1a41d84

Please sign in to comment.