[CCR] Resume follow Api should not require a request body (#37217)

Closes #37022
This commit is contained in:
Martijn van Groningen 2019-01-10 09:48:26 +01:00 committed by GitHub
parent eb12de550a
commit 1a41d84536
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 4 deletions

View File

@ -52,7 +52,6 @@
- do:
ccr.resume_follow:
index: bar
body: {}
- is_true: acknowledged
- do:

View File

@ -37,8 +37,14 @@ public class RestResumeFollowAction extends BaseRestHandler {
}
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;
}
}
}

View File

@ -15,7 +15,7 @@
},
"body": {
"description" : "The name of the leader index and other optional ccr related parameters",
"required" : true
"required" : false
}
}
}