mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-29 19:38:29 +00:00
Re-deprecate xpack rollup endpoints (#36451)
Redeprecates the `/_xpack/rollup` endpoints in favor of `/_rollup`. When we cleanup the rollup in a cluster containing 6.x nodes we need to use `/_xpack/rollup` instead of `/_rollup` because the 6.x nodes don't know about `/_rollup`. In those cases we must ignore the deprecation warnings that the 7.0 node will return for the end point. Closes #36044
This commit is contained in:
parent
de373060fb
commit
03daad9812
client/rest-high-level/src
main/java/org/elasticsearch/client
test/java/org/elasticsearch/client
docs
build.gradle
reference/rollup
qa/verify-version-constants/src/test/java/org/elasticsearch/qa/verify_version_constants
test/framework/src/main/java/org/elasticsearch/test/rest
x-pack
plugin
ml/qa/native-multi-node-tests/src/test/java/org/elasticsearch/xpack/ml/integration
rollup/src/main/java/org/elasticsearch/xpack/rollup/rest
RestDeleteRollupJobAction.javaRestGetRollupCapsAction.javaRestGetRollupIndexCapsAction.javaRestGetRollupJobsAction.javaRestPutRollupJobAction.javaRestStartRollupJobAction.javaRestStopRollupJobAction.java
src/test/resources/rest-api-spec/api
qa
full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart
multi-node/src/test/java/org/elasticsearch/multi_node
rolling-upgrade/src/test/java/org/elasticsearch/upgrades
@ -43,7 +43,7 @@ final class RollupRequestConverters {
|
|||||||
|
|
||||||
static Request putJob(final PutRollupJobRequest putRollupJobRequest) throws IOException {
|
static Request putJob(final PutRollupJobRequest putRollupJobRequest) throws IOException {
|
||||||
String endpoint = new RequestConverters.EndpointBuilder()
|
String endpoint = new RequestConverters.EndpointBuilder()
|
||||||
.addPathPartAsIs("_xpack", "rollup", "job")
|
.addPathPartAsIs("_rollup", "job")
|
||||||
.addPathPart(putRollupJobRequest.getConfig().getId())
|
.addPathPart(putRollupJobRequest.getConfig().getId())
|
||||||
.build();
|
.build();
|
||||||
Request request = new Request(HttpPut.METHOD_NAME, endpoint);
|
Request request = new Request(HttpPut.METHOD_NAME, endpoint);
|
||||||
@ -53,7 +53,7 @@ final class RollupRequestConverters {
|
|||||||
|
|
||||||
static Request startJob(final StartRollupJobRequest startRollupJobRequest) throws IOException {
|
static Request startJob(final StartRollupJobRequest startRollupJobRequest) throws IOException {
|
||||||
String endpoint = new RequestConverters.EndpointBuilder()
|
String endpoint = new RequestConverters.EndpointBuilder()
|
||||||
.addPathPartAsIs("_xpack", "rollup", "job")
|
.addPathPartAsIs("_rollup", "job")
|
||||||
.addPathPart(startRollupJobRequest.getJobId())
|
.addPathPart(startRollupJobRequest.getJobId())
|
||||||
.addPathPartAsIs("_start")
|
.addPathPartAsIs("_start")
|
||||||
.build();
|
.build();
|
||||||
@ -62,7 +62,7 @@ final class RollupRequestConverters {
|
|||||||
|
|
||||||
static Request stopJob(final StopRollupJobRequest stopRollupJobRequest) throws IOException {
|
static Request stopJob(final StopRollupJobRequest stopRollupJobRequest) throws IOException {
|
||||||
String endpoint = new RequestConverters.EndpointBuilder()
|
String endpoint = new RequestConverters.EndpointBuilder()
|
||||||
.addPathPartAsIs("_xpack", "rollup", "job")
|
.addPathPartAsIs("_rollup", "job")
|
||||||
.addPathPart(stopRollupJobRequest.getJobId())
|
.addPathPart(stopRollupJobRequest.getJobId())
|
||||||
.addPathPartAsIs("_stop")
|
.addPathPartAsIs("_stop")
|
||||||
.build();
|
.build();
|
||||||
@ -78,7 +78,7 @@ final class RollupRequestConverters {
|
|||||||
|
|
||||||
static Request getJob(final GetRollupJobRequest getRollupJobRequest) {
|
static Request getJob(final GetRollupJobRequest getRollupJobRequest) {
|
||||||
String endpoint = new RequestConverters.EndpointBuilder()
|
String endpoint = new RequestConverters.EndpointBuilder()
|
||||||
.addPathPartAsIs("_xpack", "rollup", "job")
|
.addPathPartAsIs("_rollup", "job")
|
||||||
.addPathPart(getRollupJobRequest.getJobId())
|
.addPathPart(getRollupJobRequest.getJobId())
|
||||||
.build();
|
.build();
|
||||||
return new Request(HttpGet.METHOD_NAME, endpoint);
|
return new Request(HttpGet.METHOD_NAME, endpoint);
|
||||||
@ -86,7 +86,7 @@ final class RollupRequestConverters {
|
|||||||
|
|
||||||
static Request deleteJob(final DeleteRollupJobRequest deleteRollupJobRequest) throws IOException {
|
static Request deleteJob(final DeleteRollupJobRequest deleteRollupJobRequest) throws IOException {
|
||||||
String endpoint = new RequestConverters.EndpointBuilder()
|
String endpoint = new RequestConverters.EndpointBuilder()
|
||||||
.addPathPartAsIs("_xpack", "rollup", "job")
|
.addPathPartAsIs("_rollup", "job")
|
||||||
.addPathPart(deleteRollupJobRequest.getId())
|
.addPathPart(deleteRollupJobRequest.getId())
|
||||||
.build();
|
.build();
|
||||||
Request request = new Request(HttpDelete.METHOD_NAME, endpoint);
|
Request request = new Request(HttpDelete.METHOD_NAME, endpoint);
|
||||||
@ -110,7 +110,7 @@ final class RollupRequestConverters {
|
|||||||
|
|
||||||
static Request getRollupCaps(final GetRollupCapsRequest getRollupCapsRequest) throws IOException {
|
static Request getRollupCaps(final GetRollupCapsRequest getRollupCapsRequest) throws IOException {
|
||||||
String endpoint = new RequestConverters.EndpointBuilder()
|
String endpoint = new RequestConverters.EndpointBuilder()
|
||||||
.addPathPartAsIs("_xpack", "rollup", "data")
|
.addPathPartAsIs("_rollup", "data")
|
||||||
.addPathPart(getRollupCapsRequest.getIndexPattern())
|
.addPathPart(getRollupCapsRequest.getIndexPattern())
|
||||||
.build();
|
.build();
|
||||||
Request request = new Request(HttpGet.METHOD_NAME, endpoint);
|
Request request = new Request(HttpGet.METHOD_NAME, endpoint);
|
||||||
@ -121,7 +121,7 @@ final class RollupRequestConverters {
|
|||||||
static Request getRollupIndexCaps(final GetRollupIndexCapsRequest getRollupIndexCapsRequest) throws IOException {
|
static Request getRollupIndexCaps(final GetRollupIndexCapsRequest getRollupIndexCapsRequest) throws IOException {
|
||||||
String endpoint = new RequestConverters.EndpointBuilder()
|
String endpoint = new RequestConverters.EndpointBuilder()
|
||||||
.addCommaSeparatedPathParts(getRollupIndexCapsRequest.indices())
|
.addCommaSeparatedPathParts(getRollupIndexCapsRequest.indices())
|
||||||
.addPathPartAsIs("_xpack", "rollup", "data")
|
.addPathPartAsIs("_rollup", "data")
|
||||||
.build();
|
.build();
|
||||||
Request request = new Request(HttpGet.METHOD_NAME, endpoint);
|
Request request = new Request(HttpGet.METHOD_NAME, endpoint);
|
||||||
request.setEntity(createEntity(getRollupIndexCapsRequest, REQUEST_BODY_CONTENT_TYPE));
|
request.setEntity(createEntity(getRollupIndexCapsRequest, REQUEST_BODY_CONTENT_TYPE));
|
||||||
|
@ -45,7 +45,7 @@ public class RollupRequestConvertersTests extends ESTestCase {
|
|||||||
PutRollupJobRequest put = new PutRollupJobRequest(config);
|
PutRollupJobRequest put = new PutRollupJobRequest(config);
|
||||||
|
|
||||||
Request request = RollupRequestConverters.putJob(put);
|
Request request = RollupRequestConverters.putJob(put);
|
||||||
assertThat(request.getEndpoint(), equalTo("/_xpack/rollup/job/" + job));
|
assertThat(request.getEndpoint(), equalTo("/_rollup/job/" + job));
|
||||||
assertThat(HttpPut.METHOD_NAME, equalTo(request.getMethod()));
|
assertThat(HttpPut.METHOD_NAME, equalTo(request.getMethod()));
|
||||||
assertThat(request.getParameters().keySet(), empty());
|
assertThat(request.getParameters().keySet(), empty());
|
||||||
RequestConvertersTests.assertToXContentBody(put, request.getEntity());
|
RequestConvertersTests.assertToXContentBody(put, request.getEntity());
|
||||||
@ -57,7 +57,7 @@ public class RollupRequestConvertersTests extends ESTestCase {
|
|||||||
StartRollupJobRequest startJob = new StartRollupJobRequest(jobId);
|
StartRollupJobRequest startJob = new StartRollupJobRequest(jobId);
|
||||||
|
|
||||||
Request request = RollupRequestConverters.startJob(startJob);
|
Request request = RollupRequestConverters.startJob(startJob);
|
||||||
assertThat(request.getEndpoint(), equalTo("/_xpack/rollup/job/" + jobId + "/_start"));
|
assertThat(request.getEndpoint(), equalTo("/_rollup/job/" + jobId + "/_start"));
|
||||||
assertThat(HttpPost.METHOD_NAME, equalTo(request.getMethod()));
|
assertThat(HttpPost.METHOD_NAME, equalTo(request.getMethod()));
|
||||||
assertThat(request.getParameters().keySet(), empty());
|
assertThat(request.getParameters().keySet(), empty());
|
||||||
assertThat(request.getEntity(), nullValue());
|
assertThat(request.getEntity(), nullValue());
|
||||||
@ -81,7 +81,7 @@ public class RollupRequestConvertersTests extends ESTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Request request = RollupRequestConverters.stopJob(stopJob);
|
Request request = RollupRequestConverters.stopJob(stopJob);
|
||||||
assertThat(request.getEndpoint(), equalTo("/_xpack/rollup/job/" + jobId + "/_stop"));
|
assertThat(request.getEndpoint(), equalTo("/_rollup/job/" + jobId + "/_stop"));
|
||||||
assertThat(HttpPost.METHOD_NAME, equalTo(request.getMethod()));
|
assertThat(HttpPost.METHOD_NAME, equalTo(request.getMethod()));
|
||||||
assertThat(request.getParameters().keySet().size(), equalTo(expectedParameters));
|
assertThat(request.getParameters().keySet().size(), equalTo(expectedParameters));
|
||||||
assertThat(request.getParameters().get("timeout"), equalTo(expectedTimeOutString));
|
assertThat(request.getParameters().get("timeout"), equalTo(expectedTimeOutString));
|
||||||
@ -95,7 +95,7 @@ public class RollupRequestConvertersTests extends ESTestCase {
|
|||||||
GetRollupJobRequest get = getAll ? new GetRollupJobRequest() : new GetRollupJobRequest(job);
|
GetRollupJobRequest get = getAll ? new GetRollupJobRequest() : new GetRollupJobRequest(job);
|
||||||
|
|
||||||
Request request = RollupRequestConverters.getJob(get);
|
Request request = RollupRequestConverters.getJob(get);
|
||||||
assertThat(request.getEndpoint(), equalTo("/_xpack/rollup/job/" + job));
|
assertThat(request.getEndpoint(), equalTo("/_rollup/job/" + job));
|
||||||
assertThat(HttpGet.METHOD_NAME, equalTo(request.getMethod()));
|
assertThat(HttpGet.METHOD_NAME, equalTo(request.getMethod()));
|
||||||
assertThat(request.getParameters().keySet(), empty());
|
assertThat(request.getParameters().keySet(), empty());
|
||||||
assertThat(request.getEntity(), nullValue());
|
assertThat(request.getEntity(), nullValue());
|
||||||
|
@ -625,7 +625,7 @@ buildRestTests.setups['sensor_rollup_job'] = '''
|
|||||||
- do:
|
- do:
|
||||||
raw:
|
raw:
|
||||||
method: PUT
|
method: PUT
|
||||||
path: _xpack/rollup/job/sensor
|
path: _rollup/job/sensor
|
||||||
body: >
|
body: >
|
||||||
{
|
{
|
||||||
"index_pattern": "sensor-*",
|
"index_pattern": "sensor-*",
|
||||||
@ -696,7 +696,7 @@ buildRestTests.setups['sensor_started_rollup_job'] = '''
|
|||||||
- do:
|
- do:
|
||||||
raw:
|
raw:
|
||||||
method: PUT
|
method: PUT
|
||||||
path: _xpack/rollup/job/sensor
|
path: _rollup/job/sensor
|
||||||
body: >
|
body: >
|
||||||
{
|
{
|
||||||
"index_pattern": "sensor-*",
|
"index_pattern": "sensor-*",
|
||||||
@ -727,7 +727,7 @@ buildRestTests.setups['sensor_started_rollup_job'] = '''
|
|||||||
- do:
|
- do:
|
||||||
raw:
|
raw:
|
||||||
method: POST
|
method: POST
|
||||||
path: _xpack/rollup/job/sensor/_start
|
path: _rollup/job/sensor/_start
|
||||||
'''
|
'''
|
||||||
|
|
||||||
buildRestTests.setups['sensor_index'] = '''
|
buildRestTests.setups['sensor_index'] = '''
|
||||||
|
@ -9,7 +9,7 @@ Most {rollup} endpoints have the following base:
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
----
|
----
|
||||||
/_xpack/rollup/
|
/_rollup/
|
||||||
----
|
----
|
||||||
// NOTCONSOLE
|
// NOTCONSOLE
|
||||||
|
|
||||||
@ -17,18 +17,18 @@ Most {rollup} endpoints have the following base:
|
|||||||
[[rollup-api-jobs]]
|
[[rollup-api-jobs]]
|
||||||
=== /job/
|
=== /job/
|
||||||
|
|
||||||
* {ref}/rollup-put-job.html[PUT /_xpack/rollup/job/<job_id+++>+++]: Create a job
|
* {ref}/rollup-put-job.html[PUT /_rollup/job/<job_id+++>+++]: Create a job
|
||||||
* {ref}/rollup-get-job.html[GET /_xpack/rollup/job]: List jobs
|
* {ref}/rollup-get-job.html[GET /_rollup/job]: List jobs
|
||||||
* {ref}/rollup-get-job.html[GET /_xpack/rollup/job/<job_id+++>+++]: Get job details
|
* {ref}/rollup-get-job.html[GET /_rollup/job/<job_id+++>+++]: Get job details
|
||||||
* {ref}/rollup-start-job.html[POST /_xpack/rollup/job/<job_id>/_start]: Start a job
|
* {ref}/rollup-start-job.html[POST /_rollup/job/<job_id>/_start]: Start a job
|
||||||
* {ref}/rollup-stop-job.html[POST /_xpack/rollup/job/<job_id>/_stop]: Stop a job
|
* {ref}/rollup-stop-job.html[POST /_rollup/job/<job_id>/_stop]: Stop a job
|
||||||
* {ref}/rollup-delete-job.html[DELETE /_xpack/rollup/job/<job_id+++>+++]: Delete a job
|
* {ref}/rollup-delete-job.html[DELETE /_rollup/job/<job_id+++>+++]: Delete a job
|
||||||
|
|
||||||
[float]
|
[float]
|
||||||
[[rollup-api-data]]
|
[[rollup-api-data]]
|
||||||
=== /data/
|
=== /data/
|
||||||
|
|
||||||
* {ref}/rollup-get-rollup-caps.html[GET /_xpack/rollup/data/<index_pattern+++>/_rollup_caps+++]: Get Rollup Capabilities
|
* {ref}/rollup-get-rollup-caps.html[GET /_rollup/data/<index_pattern+++>/_rollup_caps+++]: Get Rollup Capabilities
|
||||||
* {ref}/rollup-get-rollup-index-caps.html[GET /<index_name+++>/_rollup/data/+++]: Get Rollup Index Capabilities
|
* {ref}/rollup-get-rollup-index-caps.html[GET /<index_name+++>/_rollup/data/+++]: Get Rollup Index Capabilities
|
||||||
|
|
||||||
[float]
|
[float]
|
||||||
|
@ -39,7 +39,7 @@ POST my_rollup_index/_delete_by_query
|
|||||||
**********************************
|
**********************************
|
||||||
==== Request
|
==== Request
|
||||||
|
|
||||||
`DELETE _xpack/rollup/job/<job_id>`
|
`DELETE _rollup/job/<job_id>`
|
||||||
|
|
||||||
//===== Description
|
//===== Description
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ If we have a rollup job named `sensor`, it can be deleted with:
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
DELETE _xpack/rollup/job/sensor
|
DELETE _rollup/job/sensor
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// CONSOLE
|
// CONSOLE
|
||||||
// TEST[setup:sensor_rollup_job]
|
// TEST[setup:sensor_rollup_job]
|
||||||
@ -85,7 +85,7 @@ If however we try to delete a job which doesn't exist:
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
DELETE _xpack/rollup/job/does_not_exist
|
DELETE _rollup/job/does_not_exist
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// CONSOLE
|
// CONSOLE
|
||||||
// TEST[catch:missing]
|
// TEST[catch:missing]
|
||||||
|
@ -18,7 +18,7 @@ For details about a historical job, the <<rollup-get-rollup-caps,Rollup Capabili
|
|||||||
|
|
||||||
==== Request
|
==== Request
|
||||||
|
|
||||||
`GET _xpack/rollup/job/<job_id>`
|
`GET _rollup/job/<job_id>`
|
||||||
|
|
||||||
//===== Description
|
//===== Description
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ If we have already created a rollup job named `sensor`, the details about the jo
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
GET _xpack/rollup/job/sensor
|
GET _rollup/job/sensor
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// CONSOLE
|
// CONSOLE
|
||||||
// TEST[setup:sensor_rollup_job]
|
// TEST[setup:sensor_rollup_job]
|
||||||
@ -140,7 +140,7 @@ If we add another job, we can see how multi-job responses are handled:
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
PUT _xpack/rollup/job/sensor2 <1>
|
PUT _rollup/job/sensor2 <1>
|
||||||
{
|
{
|
||||||
"index_pattern": "sensor-*",
|
"index_pattern": "sensor-*",
|
||||||
"rollup_index": "sensor_rollup",
|
"rollup_index": "sensor_rollup",
|
||||||
@ -168,7 +168,7 @@ PUT _xpack/rollup/job/sensor2 <1>
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
GET _xpack/rollup/job/_all <2>
|
GET _rollup/job/_all <2>
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// CONSOLE
|
// CONSOLE
|
||||||
// TEST[setup:sensor_rollup_job]
|
// TEST[setup:sensor_rollup_job]
|
||||||
|
@ -13,7 +13,7 @@ started with the <<rollup-start-job,Start Job API>>.
|
|||||||
|
|
||||||
==== Request
|
==== Request
|
||||||
|
|
||||||
`PUT _xpack/rollup/job/<job_id>`
|
`PUT _rollup/job/<job_id>`
|
||||||
|
|
||||||
//===== Description
|
//===== Description
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ The following example creates a rollup job named "sensor", targeting the "sensor
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
PUT _xpack/rollup/job/sensor
|
PUT _rollup/job/sensor
|
||||||
{
|
{
|
||||||
"index_pattern": "sensor-*",
|
"index_pattern": "sensor-*",
|
||||||
"rollup_index": "sensor_rollup",
|
"rollup_index": "sensor_rollup",
|
||||||
|
@ -21,7 +21,7 @@ live?
|
|||||||
|
|
||||||
==== Request
|
==== Request
|
||||||
|
|
||||||
`GET _xpack/rollup/data/{index}`
|
`GET _rollup/data/{index}`
|
||||||
|
|
||||||
//===== Description
|
//===== Description
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ this future scaling:
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
PUT _xpack/rollup/job/sensor
|
PUT _rollup/job/sensor
|
||||||
{
|
{
|
||||||
"index_pattern": "sensor-*",
|
"index_pattern": "sensor-*",
|
||||||
"rollup_index": "sensor_rollup",
|
"rollup_index": "sensor_rollup",
|
||||||
@ -85,7 +85,7 @@ We can then retrieve the rollup capabilities of that index pattern (`sensor-*`)
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
GET _xpack/rollup/data/sensor-*
|
GET _rollup/data/sensor-*
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// CONSOLE
|
// CONSOLE
|
||||||
// TEST[continued]
|
// TEST[continued]
|
||||||
@ -155,7 +155,7 @@ We could also retrieve the same information with a request to `_all`:
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
GET _xpack/rollup/data/_all
|
GET _rollup/data/_all
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// CONSOLE
|
// CONSOLE
|
||||||
// TEST[continued]
|
// TEST[continued]
|
||||||
@ -164,7 +164,7 @@ But note that if we use the concrete index name (`sensor-1`), we'll retrieve no
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
GET _xpack/rollup/data/sensor-1
|
GET _rollup/data/sensor-1
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// CONSOLE
|
// CONSOLE
|
||||||
// TEST[continued]
|
// TEST[continued]
|
||||||
|
@ -18,7 +18,7 @@ This API will allow you to determine:
|
|||||||
|
|
||||||
==== Request
|
==== Request
|
||||||
|
|
||||||
`GET {index}/_xpack/rollup/data`
|
`GET {index}/_rollup/data`
|
||||||
|
|
||||||
//===== Description
|
//===== Description
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ will be a `sensor-2`, `sensor-3`, etc. Let's create a Rollup job, which stores
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
PUT _xpack/rollup/job/sensor
|
PUT _rollup/job/sensor
|
||||||
{
|
{
|
||||||
"index_pattern": "sensor-*",
|
"index_pattern": "sensor-*",
|
||||||
"rollup_index": "sensor_rollup",
|
"rollup_index": "sensor_rollup",
|
||||||
@ -80,7 +80,7 @@ Index API:
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
GET /sensor_rollup/_xpack/rollup/data
|
GET /sensor_rollup/_rollup/data
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// CONSOLE
|
// CONSOLE
|
||||||
// TEST[continued]
|
// TEST[continued]
|
||||||
@ -153,7 +153,7 @@ Like other APIs that interact with indices, you can specify index patterns inste
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
GET /*_rollup/_xpack/rollup/data
|
GET /*_rollup/_rollup/data
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// CONSOLE
|
// CONSOLE
|
||||||
// TEST[continued]
|
// TEST[continued]
|
||||||
|
@ -15,7 +15,7 @@ A full job configuration might look like this:
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
PUT _xpack/rollup/job/sensor
|
PUT _rollup/job/sensor
|
||||||
{
|
{
|
||||||
"index_pattern": "sensor-*",
|
"index_pattern": "sensor-*",
|
||||||
"rollup_index": "sensor_rollup",
|
"rollup_index": "sensor_rollup",
|
||||||
|
@ -53,7 +53,7 @@ Imagine we have an index named `sensor-1` full of raw data, and we have created
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
PUT _xpack/rollup/job/sensor
|
PUT _rollup/job/sensor
|
||||||
{
|
{
|
||||||
"index_pattern": "sensor-*",
|
"index_pattern": "sensor-*",
|
||||||
"rollup_index": "sensor_rollup",
|
"rollup_index": "sensor_rollup",
|
||||||
|
@ -13,7 +13,7 @@ Starting an already started job has no action.
|
|||||||
|
|
||||||
==== Request
|
==== Request
|
||||||
|
|
||||||
`POST _xpack/rollup/job/<job_id>/_start`
|
`POST _rollup/job/<job_id>/_start`
|
||||||
|
|
||||||
//===== Description
|
//===== Description
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ If we have already created a rollup job named `sensor`, it can be started with:
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
POST _xpack/rollup/job/sensor/_start
|
POST _rollup/job/sensor/_start
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// CONSOLE
|
// CONSOLE
|
||||||
// TEST[setup:sensor_rollup_job]
|
// TEST[setup:sensor_rollup_job]
|
||||||
@ -58,7 +58,7 @@ If however we try to start a job which doesn't exist:
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
POST _xpack/rollup/job/does_not_exist/_start
|
POST _rollup/job/does_not_exist/_start
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// CONSOLE
|
// CONSOLE
|
||||||
// TEST[catch:missing]
|
// TEST[catch:missing]
|
||||||
|
@ -13,7 +13,7 @@ Stopping an already stopped job has no action.
|
|||||||
|
|
||||||
==== Request
|
==== Request
|
||||||
|
|
||||||
`POST _xpack/rollup/job/<job_id>/_stop`
|
`POST _rollup/job/<job_id>/_stop`
|
||||||
|
|
||||||
//===== Description
|
//===== Description
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ If we have an already-started rollup job named `sensor`, it can be stopped with:
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
POST _xpack/rollup/job/sensor/_stop
|
POST _rollup/job/sensor/_stop
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// CONSOLE
|
// CONSOLE
|
||||||
// TEST[setup:sensor_started_rollup_job]
|
// TEST[setup:sensor_started_rollup_job]
|
||||||
@ -71,7 +71,7 @@ If however we try to stop a job which doesn't exist:
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
POST _xpack/rollup/job/does_not_exist/_stop
|
POST _rollup/job/does_not_exist/_stop
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// CONSOLE
|
// CONSOLE
|
||||||
// TEST[catch:missing]
|
// TEST[catch:missing]
|
||||||
@ -106,7 +106,7 @@ stopped. This is accomplished with the `wait_for_completion` query parameter, a
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
POST _xpack/rollup/job/sensor/_stop?wait_for_completion=true&timeout=10s
|
POST _rollup/job/sensor/_stop?wait_for_completion=true&timeout=10s
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// CONSOLE
|
// CONSOLE
|
||||||
// TEST[setup:sensor_started_rollup_job]
|
// TEST[setup:sensor_started_rollup_job]
|
||||||
|
@ -30,7 +30,7 @@ one hour or greater. A rollup job might look like this:
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
PUT _xpack/rollup/job/sensor
|
PUT _rollup/job/sensor
|
||||||
{
|
{
|
||||||
"index_pattern": "sensor-*",
|
"index_pattern": "sensor-*",
|
||||||
"rollup_index": "sensor_rollup",
|
"rollup_index": "sensor_rollup",
|
||||||
@ -60,7 +60,7 @@ PUT _xpack/rollup/job/sensor
|
|||||||
// CONSOLE
|
// CONSOLE
|
||||||
// TEST[setup:sensor_index]
|
// TEST[setup:sensor_index]
|
||||||
|
|
||||||
We give the job the ID of "sensor" (in the url: `PUT _xpack/rollup/job/sensor`), and tell it to rollup the index pattern `"sensor-*"`.
|
We give the job the ID of "sensor" (in the url: `PUT _rollup/job/sensor`), and tell it to rollup the index pattern `"sensor-*"`.
|
||||||
This job will find and rollup any index that matches that pattern. Rollup summaries are then stored in the `"sensor_rollup"` index.
|
This job will find and rollup any index that matches that pattern. Rollup summaries are then stored in the `"sensor_rollup"` index.
|
||||||
|
|
||||||
The `cron` parameter controls when and how often the job activates. When a rollup job's cron schedule triggers, it will begin rolling up
|
The `cron` parameter controls when and how often the job activates. When a rollup job's cron schedule triggers, it will begin rolling up
|
||||||
@ -114,7 +114,7 @@ To start the job, execute this command:
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
POST _xpack/rollup/job/sensor/_start
|
POST _rollup/job/sensor/_start
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// CONSOLE
|
// CONSOLE
|
||||||
// TEST[setup:sensor_rollup_job]
|
// TEST[setup:sensor_rollup_job]
|
||||||
|
@ -162,7 +162,7 @@ the best practice is to combine them into a single rollup job which covers both
|
|||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
PUT _xpack/rollup/job/combined
|
PUT _rollup/job/combined
|
||||||
{
|
{
|
||||||
"index_pattern": "data-*",
|
"index_pattern": "data-*",
|
||||||
"rollup_index": "data_rollup",
|
"rollup_index": "data_rollup",
|
||||||
|
@ -43,4 +43,14 @@ public class VerifyVersionConstantsIT extends ESRestTestCase {
|
|||||||
assertThat(elasticsearchVersion.luceneVersion, equalTo(luceneVersion));
|
assertThat(elasticsearchVersion.luceneVersion, equalTo(luceneVersion));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean preserveClusterUponCompletion() {
|
||||||
|
/*
|
||||||
|
* We don't perform any writes to the cluster so there won't be anything
|
||||||
|
* to clean up. Also, our cleanup code is really only compatible with
|
||||||
|
* *write* compatible versions but this runs with *index* compatible
|
||||||
|
* versions.
|
||||||
|
*/
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -544,7 +544,7 @@ public abstract class ESRestTestCase extends ESTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void wipeRollupJobs() throws IOException, InterruptedException {
|
private void wipeRollupJobs() throws IOException, InterruptedException {
|
||||||
Response response = adminClient().performRequest(new Request("GET", "/_xpack/rollup/job/_all"));
|
Response response = adminClient().performRequest(new Request("GET", "/_rollup/job/_all"));
|
||||||
Map<String, Object> jobs = entityAsMap(response);
|
Map<String, Object> jobs = entityAsMap(response);
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<Map<String, Object>> jobConfigs =
|
List<Map<String, Object>> jobConfigs =
|
||||||
@ -557,7 +557,7 @@ public abstract class ESRestTestCase extends ESTestCase {
|
|||||||
for (Map<String, Object> jobConfig : jobConfigs) {
|
for (Map<String, Object> jobConfig : jobConfigs) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
String jobId = (String) ((Map<String, Object>) jobConfig.get("config")).get("id");
|
String jobId = (String) ((Map<String, Object>) jobConfig.get("config")).get("id");
|
||||||
Request request = new Request("POST", "/_xpack/rollup/job/" + jobId + "/_stop");
|
Request request = new Request("POST", "/_rollup/job/" + jobId + "/_stop");
|
||||||
request.addParameter("ignore", "404");
|
request.addParameter("ignore", "404");
|
||||||
request.addParameter("wait_for_completion", "true");
|
request.addParameter("wait_for_completion", "true");
|
||||||
request.addParameter("timeout", "10s");
|
request.addParameter("timeout", "10s");
|
||||||
@ -568,7 +568,7 @@ public abstract class ESRestTestCase extends ESTestCase {
|
|||||||
for (Map<String, Object> jobConfig : jobConfigs) {
|
for (Map<String, Object> jobConfig : jobConfigs) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
String jobId = (String) ((Map<String, Object>) jobConfig.get("config")).get("id");
|
String jobId = (String) ((Map<String, Object>) jobConfig.get("config")).get("id");
|
||||||
Request request = new Request("DELETE", "/_xpack/rollup/job/" + jobId);
|
Request request = new Request("DELETE", "/_rollup/job/" + jobId);
|
||||||
request.addParameter("ignore", "404"); // Ignore 404s because they imply someone was racing us to delete this
|
request.addParameter("ignore", "404"); // Ignore 404s because they imply someone was racing us to delete this
|
||||||
logger.debug("deleting rollup job [{}]", jobId);
|
logger.debug("deleting rollup job [{}]", jobId);
|
||||||
adminClient().performRequest(request);
|
adminClient().performRequest(request);
|
||||||
@ -902,5 +902,4 @@ public abstract class ESRestTestCase extends ESTestCase {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -396,7 +396,7 @@ public class DatafeedJobsRestIT extends ESRestTestCase {
|
|||||||
client().performRequest(createJobRequest);
|
client().performRequest(createJobRequest);
|
||||||
|
|
||||||
String rollupJobId = "rollup-" + jobId;
|
String rollupJobId = "rollup-" + jobId;
|
||||||
Request createRollupRequest = new Request("PUT", "/_xpack/rollup/job/" + rollupJobId);
|
Request createRollupRequest = new Request("PUT", "/_rollup/job/" + rollupJobId);
|
||||||
createRollupRequest.setJsonEntity("{\n"
|
createRollupRequest.setJsonEntity("{\n"
|
||||||
+ "\"index_pattern\": \"airline-data-aggs\",\n"
|
+ "\"index_pattern\": \"airline-data-aggs\",\n"
|
||||||
+ " \"rollup_index\": \"airline-data-aggs-rollup\",\n"
|
+ " \"rollup_index\": \"airline-data-aggs-rollup\",\n"
|
||||||
@ -764,7 +764,7 @@ public class DatafeedJobsRestIT extends ESRestTestCase {
|
|||||||
client().performRequest(createJobRequest);
|
client().performRequest(createJobRequest);
|
||||||
|
|
||||||
String rollupJobId = "rollup-" + jobId;
|
String rollupJobId = "rollup-" + jobId;
|
||||||
Request createRollupRequest = new Request("PUT", "/_xpack/rollup/job/" + rollupJobId);
|
Request createRollupRequest = new Request("PUT", "/_rollup/job/" + rollupJobId);
|
||||||
createRollupRequest.setJsonEntity("{\n"
|
createRollupRequest.setJsonEntity("{\n"
|
||||||
+ "\"index_pattern\": \"airline-data-aggs\",\n"
|
+ "\"index_pattern\": \"airline-data-aggs\",\n"
|
||||||
+ " \"rollup_index\": \"airline-data-aggs-rollup\",\n"
|
+ " \"rollup_index\": \"airline-data-aggs-rollup\",\n"
|
||||||
@ -792,18 +792,18 @@ public class DatafeedJobsRestIT extends ESRestTestCase {
|
|||||||
+ " ]\n"
|
+ " ]\n"
|
||||||
+ "}");
|
+ "}");
|
||||||
client().performRequest(createRollupRequest);
|
client().performRequest(createRollupRequest);
|
||||||
client().performRequest(new Request("POST", "/_xpack/rollup/job/" + rollupJobId + "/_start"));
|
client().performRequest(new Request("POST", "/_rollup/job/" + rollupJobId + "/_start"));
|
||||||
|
|
||||||
assertBusy(() -> {
|
assertBusy(() -> {
|
||||||
Response getRollup = client().performRequest(new Request("GET", "/_xpack/rollup/job/" + rollupJobId));
|
Response getRollup = client().performRequest(new Request("GET", "/_rollup/job/" + rollupJobId));
|
||||||
String body = EntityUtils.toString(getRollup.getEntity());
|
String body = EntityUtils.toString(getRollup.getEntity());
|
||||||
assertThat(body, containsString("\"job_state\":\"started\""));
|
assertThat(body, containsString("\"job_state\":\"started\""));
|
||||||
assertThat(body, containsString("\"rollups_indexed\":4"));
|
assertThat(body, containsString("\"rollups_indexed\":4"));
|
||||||
}, 60, TimeUnit.SECONDS);
|
}, 60, TimeUnit.SECONDS);
|
||||||
|
|
||||||
client().performRequest(new Request("POST", "/_xpack/rollup/job/" + rollupJobId + "/_stop"));
|
client().performRequest(new Request("POST", "/_rollup/job/" + rollupJobId + "/_stop"));
|
||||||
assertBusy(() -> {
|
assertBusy(() -> {
|
||||||
Response getRollup = client().performRequest(new Request("GET", "/_xpack/rollup/job/" + rollupJobId));
|
Response getRollup = client().performRequest(new Request("GET", "/_rollup/job/" + rollupJobId));
|
||||||
assertThat(EntityUtils.toString(getRollup.getEntity()), containsString("\"job_state\":\"stopped\""));
|
assertThat(EntityUtils.toString(getRollup.getEntity()), containsString("\"job_state\":\"stopped\""));
|
||||||
}, 60, TimeUnit.SECONDS);
|
}, 60, TimeUnit.SECONDS);
|
||||||
|
|
||||||
@ -849,7 +849,7 @@ public class DatafeedJobsRestIT extends ESRestTestCase {
|
|||||||
client().performRequest(createJobRequest);
|
client().performRequest(createJobRequest);
|
||||||
|
|
||||||
String rollupJobId = "rollup-" + jobId;
|
String rollupJobId = "rollup-" + jobId;
|
||||||
Request createRollupRequest = new Request("PUT", "/_xpack/rollup/job/" + rollupJobId);
|
Request createRollupRequest = new Request("PUT", "/_rollup/job/" + rollupJobId);
|
||||||
createRollupRequest.setJsonEntity("{\n"
|
createRollupRequest.setJsonEntity("{\n"
|
||||||
+ "\"index_pattern\": \"airline-data-aggs\",\n"
|
+ "\"index_pattern\": \"airline-data-aggs\",\n"
|
||||||
+ " \"rollup_index\": \"airline-data-aggs-rollup\",\n"
|
+ " \"rollup_index\": \"airline-data-aggs-rollup\",\n"
|
||||||
|
@ -6,8 +6,10 @@
|
|||||||
|
|
||||||
package org.elasticsearch.xpack.rollup.rest;
|
package org.elasticsearch.xpack.rollup.rest;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.elasticsearch.client.node.NodeClient;
|
import org.elasticsearch.client.node.NodeClient;
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
|
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.rest.BaseRestHandler;
|
import org.elasticsearch.rest.BaseRestHandler;
|
||||||
import org.elasticsearch.rest.RestController;
|
import org.elasticsearch.rest.RestController;
|
||||||
@ -18,14 +20,20 @@ import org.elasticsearch.xpack.core.rollup.action.DeleteRollupJobAction;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||||
|
|
||||||
public class RestDeleteRollupJobAction extends BaseRestHandler {
|
public class RestDeleteRollupJobAction extends BaseRestHandler {
|
||||||
|
|
||||||
|
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestDeleteRollupJobAction.class));
|
||||||
|
|
||||||
public static final ParseField ID = new ParseField("id");
|
public static final ParseField ID = new ParseField("id");
|
||||||
|
|
||||||
public RestDeleteRollupJobAction(Settings settings, RestController controller) {
|
public RestDeleteRollupJobAction(Settings settings, RestController controller) {
|
||||||
super(settings);
|
super(settings);
|
||||||
controller.registerHandler(RestRequest.Method.DELETE, "/_xpack/rollup/job/{id}/", this);
|
// TODO: remove deprecated endpoint in 8.0.0
|
||||||
controller.registerHandler(RestRequest.Method.DELETE, "/_rollup/job/{id}/", this);
|
controller.registerWithDeprecatedHandler(
|
||||||
|
DELETE, "/_rollup/job/{id}", this,
|
||||||
|
DELETE, "/_xpack/rollup/job/{id}/", deprecationLogger);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -47,7 +55,7 @@ public class RestDeleteRollupJobAction extends BaseRestHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "rollup_delete_job_action";
|
return "delete_rollup_job";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
14
x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupCapsAction.java
14
x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupCapsAction.java
@ -6,8 +6,10 @@
|
|||||||
|
|
||||||
package org.elasticsearch.xpack.rollup.rest;
|
package org.elasticsearch.xpack.rollup.rest;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.elasticsearch.client.node.NodeClient;
|
import org.elasticsearch.client.node.NodeClient;
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
|
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.rest.BaseRestHandler;
|
import org.elasticsearch.rest.BaseRestHandler;
|
||||||
import org.elasticsearch.rest.RestController;
|
import org.elasticsearch.rest.RestController;
|
||||||
@ -17,14 +19,20 @@ import org.elasticsearch.xpack.core.rollup.action.GetRollupCapsAction;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||||
|
|
||||||
public class RestGetRollupCapsAction extends BaseRestHandler {
|
public class RestGetRollupCapsAction extends BaseRestHandler {
|
||||||
|
|
||||||
|
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetRollupCapsAction.class));
|
||||||
|
|
||||||
public static final ParseField ID = new ParseField("id");
|
public static final ParseField ID = new ParseField("id");
|
||||||
|
|
||||||
public RestGetRollupCapsAction(Settings settings, RestController controller) {
|
public RestGetRollupCapsAction(Settings settings, RestController controller) {
|
||||||
super(settings);
|
super(settings);
|
||||||
controller.registerHandler(RestRequest.Method.GET, "/_xpack/rollup/data/{id}/", this);
|
// TODO: remove deprecated endpoint in 8.0.0
|
||||||
controller.registerHandler(RestRequest.Method.GET, "/_rollup/data/{id}/", this);
|
controller.registerWithDeprecatedHandler(
|
||||||
|
GET, "/_rollup/data/{id}", this,
|
||||||
|
GET, "/_xpack/rollup/data/{id}/", deprecationLogger);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -37,7 +45,7 @@ public class RestGetRollupCapsAction extends BaseRestHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "rollup_get_caps_action";
|
return "get_rollup_caps";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,12 @@
|
|||||||
|
|
||||||
package org.elasticsearch.xpack.rollup.rest;
|
package org.elasticsearch.xpack.rollup.rest;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.elasticsearch.action.support.IndicesOptions;
|
import org.elasticsearch.action.support.IndicesOptions;
|
||||||
import org.elasticsearch.client.node.NodeClient;
|
import org.elasticsearch.client.node.NodeClient;
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
|
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.rest.BaseRestHandler;
|
import org.elasticsearch.rest.BaseRestHandler;
|
||||||
import org.elasticsearch.rest.RestController;
|
import org.elasticsearch.rest.RestController;
|
||||||
@ -17,14 +19,21 @@ import org.elasticsearch.rest.RestRequest;
|
|||||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||||
import org.elasticsearch.xpack.core.rollup.action.GetRollupIndexCapsAction;
|
import org.elasticsearch.xpack.core.rollup.action.GetRollupIndexCapsAction;
|
||||||
|
|
||||||
|
import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||||
|
|
||||||
public class RestGetRollupIndexCapsAction extends BaseRestHandler {
|
public class RestGetRollupIndexCapsAction extends BaseRestHandler {
|
||||||
|
|
||||||
public static final ParseField INDEX = new ParseField("index");
|
private static final DeprecationLogger deprecationLogger =
|
||||||
|
new DeprecationLogger(LogManager.getLogger(RestGetRollupIndexCapsAction.class));
|
||||||
|
|
||||||
|
static final ParseField INDEX = new ParseField("index");
|
||||||
|
|
||||||
public RestGetRollupIndexCapsAction(Settings settings, RestController controller) {
|
public RestGetRollupIndexCapsAction(Settings settings, RestController controller) {
|
||||||
super(settings);
|
super(settings);
|
||||||
controller.registerHandler(RestRequest.Method.GET, "/{index}/_xpack/rollup/data", this);
|
// TODO: remove deprecated endpoint in 8.0.0
|
||||||
controller.registerHandler(RestRequest.Method.GET, "/{index}/_rollup/data", this);
|
controller.registerWithDeprecatedHandler(
|
||||||
|
GET, "/{index}/_rollup/data", this,
|
||||||
|
GET, "/{index}/_xpack/rollup/data", deprecationLogger);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -38,7 +47,7 @@ public class RestGetRollupIndexCapsAction extends BaseRestHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "rollup_get_caps_action";
|
return "get_rollup_index_caps";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
14
x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupJobsAction.java
14
x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupJobsAction.java
@ -6,8 +6,10 @@
|
|||||||
|
|
||||||
package org.elasticsearch.xpack.rollup.rest;
|
package org.elasticsearch.xpack.rollup.rest;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.elasticsearch.client.node.NodeClient;
|
import org.elasticsearch.client.node.NodeClient;
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
|
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.rest.BaseRestHandler;
|
import org.elasticsearch.rest.BaseRestHandler;
|
||||||
import org.elasticsearch.rest.RestController;
|
import org.elasticsearch.rest.RestController;
|
||||||
@ -15,14 +17,20 @@ import org.elasticsearch.rest.RestRequest;
|
|||||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||||
import org.elasticsearch.xpack.core.rollup.action.GetRollupJobsAction;
|
import org.elasticsearch.xpack.core.rollup.action.GetRollupJobsAction;
|
||||||
|
|
||||||
|
import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||||
|
|
||||||
public class RestGetRollupJobsAction extends BaseRestHandler {
|
public class RestGetRollupJobsAction extends BaseRestHandler {
|
||||||
|
|
||||||
|
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetRollupJobsAction.class));
|
||||||
|
|
||||||
public static final ParseField ID = new ParseField("id");
|
public static final ParseField ID = new ParseField("id");
|
||||||
|
|
||||||
public RestGetRollupJobsAction(Settings settings, RestController controller) {
|
public RestGetRollupJobsAction(Settings settings, RestController controller) {
|
||||||
super(settings);
|
super(settings);
|
||||||
controller.registerHandler(RestRequest.Method.GET, "/_xpack/rollup/job/{id}/", this);
|
// TODO: remove deprecated endpoint in 8.0.0
|
||||||
controller.registerHandler(RestRequest.Method.GET, "/_rollup/job/{id}/", this);
|
controller.registerWithDeprecatedHandler(
|
||||||
|
GET, "/_rollup/job/{id}", this,
|
||||||
|
GET, "/_xpack/rollup/job/{id}/", deprecationLogger);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -35,7 +43,7 @@ public class RestGetRollupJobsAction extends BaseRestHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "rollup_get_job_action";
|
return "get_rollup_job";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
14
x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestPutRollupJobAction.java
14
x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestPutRollupJobAction.java
@ -6,7 +6,9 @@
|
|||||||
|
|
||||||
package org.elasticsearch.xpack.rollup.rest;
|
package org.elasticsearch.xpack.rollup.rest;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.elasticsearch.client.node.NodeClient;
|
import org.elasticsearch.client.node.NodeClient;
|
||||||
|
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.rest.BaseRestHandler;
|
import org.elasticsearch.rest.BaseRestHandler;
|
||||||
import org.elasticsearch.rest.RestController;
|
import org.elasticsearch.rest.RestController;
|
||||||
@ -16,12 +18,18 @@ import org.elasticsearch.xpack.core.rollup.action.PutRollupJobAction;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
||||||
|
|
||||||
public class RestPutRollupJobAction extends BaseRestHandler {
|
public class RestPutRollupJobAction extends BaseRestHandler {
|
||||||
|
|
||||||
|
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPutRollupJobAction.class));
|
||||||
|
|
||||||
public RestPutRollupJobAction(Settings settings, RestController controller) {
|
public RestPutRollupJobAction(Settings settings, RestController controller) {
|
||||||
super(settings);
|
super(settings);
|
||||||
controller.registerHandler(RestRequest.Method.PUT, "/_xpack/rollup/job/{id}/", this);
|
// TODO: remove deprecated endpoint in 8.0.0
|
||||||
controller.registerHandler(RestRequest.Method.PUT, "/_rollup/job/{id}/", this);
|
controller.registerWithDeprecatedHandler(
|
||||||
|
PUT, "/_rollup/job/{id}", this,
|
||||||
|
PUT, "/_xpack/rollup/job/{id}", deprecationLogger);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -33,7 +41,7 @@ public class RestPutRollupJobAction extends BaseRestHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "rollup_put_job_action";
|
return "put_rollup_job";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
14
x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStartRollupJobAction.java
14
x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStartRollupJobAction.java
@ -6,7 +6,9 @@
|
|||||||
|
|
||||||
package org.elasticsearch.xpack.rollup.rest;
|
package org.elasticsearch.xpack.rollup.rest;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.elasticsearch.client.node.NodeClient;
|
import org.elasticsearch.client.node.NodeClient;
|
||||||
|
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.rest.BaseRestHandler;
|
import org.elasticsearch.rest.BaseRestHandler;
|
||||||
import org.elasticsearch.rest.RestController;
|
import org.elasticsearch.rest.RestController;
|
||||||
@ -17,12 +19,18 @@ import org.elasticsearch.xpack.core.rollup.action.StartRollupJobAction;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||||
|
|
||||||
public class RestStartRollupJobAction extends BaseRestHandler {
|
public class RestStartRollupJobAction extends BaseRestHandler {
|
||||||
|
|
||||||
|
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestStartRollupJobAction.class));
|
||||||
|
|
||||||
public RestStartRollupJobAction(Settings settings, RestController controller) {
|
public RestStartRollupJobAction(Settings settings, RestController controller) {
|
||||||
super(settings);
|
super(settings);
|
||||||
controller.registerHandler(RestRequest.Method.POST, "/_xpack/rollup/job/{id}/_start", this);
|
// TODO: remove deprecated endpoint in 8.0.0
|
||||||
controller.registerHandler(RestRequest.Method.POST, "/_rollup/job/{id}/_start", this);
|
controller.registerWithDeprecatedHandler(
|
||||||
|
POST, "/_rollup/job/{id}/_start", this,
|
||||||
|
POST, "/_xpack/rollup/job/{id}/_start", deprecationLogger);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -35,7 +43,7 @@ public class RestStartRollupJobAction extends BaseRestHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "rollup_start_job_action";
|
return "start_rollup_job";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
14
x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStopRollupJobAction.java
14
x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStopRollupJobAction.java
@ -6,7 +6,9 @@
|
|||||||
|
|
||||||
package org.elasticsearch.xpack.rollup.rest;
|
package org.elasticsearch.xpack.rollup.rest;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.elasticsearch.client.node.NodeClient;
|
import org.elasticsearch.client.node.NodeClient;
|
||||||
|
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.rest.BaseRestHandler;
|
import org.elasticsearch.rest.BaseRestHandler;
|
||||||
@ -16,12 +18,18 @@ import org.elasticsearch.rest.action.RestToXContentListener;
|
|||||||
import org.elasticsearch.xpack.core.rollup.RollupField;
|
import org.elasticsearch.xpack.core.rollup.RollupField;
|
||||||
import org.elasticsearch.xpack.core.rollup.action.StopRollupJobAction;
|
import org.elasticsearch.xpack.core.rollup.action.StopRollupJobAction;
|
||||||
|
|
||||||
|
import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||||
|
|
||||||
public class RestStopRollupJobAction extends BaseRestHandler {
|
public class RestStopRollupJobAction extends BaseRestHandler {
|
||||||
|
|
||||||
|
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestStopRollupJobAction.class));
|
||||||
|
|
||||||
public RestStopRollupJobAction(Settings settings, RestController controller) {
|
public RestStopRollupJobAction(Settings settings, RestController controller) {
|
||||||
super(settings);
|
super(settings);
|
||||||
controller.registerHandler(RestRequest.Method.POST, "/_xpack/rollup/job/{id}/_stop", this);
|
// TODO: remove deprecated endpoint in 8.0.0
|
||||||
controller.registerHandler(RestRequest.Method.POST, "/_rollup/job/{id}/_stop", this);
|
controller.registerWithDeprecatedHandler(
|
||||||
|
POST, "/_rollup/job/{id}/_stop", this,
|
||||||
|
POST, "/_xpack/rollup/job/{id}/_stop", deprecationLogger);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -36,7 +44,7 @@ public class RestStopRollupJobAction extends BaseRestHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "rollup_stop_job_action";
|
return "stop_rollup_job";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
"documentation": "",
|
"documentation": "",
|
||||||
"methods": [ "DELETE" ],
|
"methods": [ "DELETE" ],
|
||||||
"url": {
|
"url": {
|
||||||
"path": "/_xpack/rollup/job/{id}",
|
"path": "/_rollup/job/{id}",
|
||||||
"paths": [ "/_xpack/rollup/job/{id}", "/_rollup/job/{id}" ],
|
"paths": [ "/_rollup/job/{id}" ],
|
||||||
"parts": {
|
"parts": {
|
||||||
"id": {
|
"id": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
"documentation": "",
|
"documentation": "",
|
||||||
"methods": [ "GET" ],
|
"methods": [ "GET" ],
|
||||||
"url": {
|
"url": {
|
||||||
"path": "/_xpack/rollup/job/{id}",
|
"path": "/_rollup/job/{id}",
|
||||||
"paths": [ "/_xpack/rollup/job/{id}", "/_xpack/rollup/job/", "/_rollup/job/{id}", "/_rollup/job/"],
|
"paths": [ "/_rollup/job/{id}", "/_rollup/job/" ],
|
||||||
"parts": {
|
"parts": {
|
||||||
"id": {
|
"id": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
"documentation": "",
|
"documentation": "",
|
||||||
"methods": [ "GET" ],
|
"methods": [ "GET" ],
|
||||||
"url": {
|
"url": {
|
||||||
"path": "/_xpack/rollup/data/{id}",
|
"path": "/_rollup/data/{id}",
|
||||||
"paths": [ "/_xpack/rollup/data/{id}", "/_xpack/rollup/data/", "/_rollup/data/{id}", "/_rollup/data/" ],
|
"paths": [ "/_rollup/data/{id}", "/_rollup/data/" ],
|
||||||
"parts": {
|
"parts": {
|
||||||
"id": {
|
"id": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
"documentation": "",
|
"documentation": "",
|
||||||
"methods": [ "GET" ],
|
"methods": [ "GET" ],
|
||||||
"url": {
|
"url": {
|
||||||
"path": "/{index}/_xpack/rollup/data",
|
"path": "/{index}/_rollup/data",
|
||||||
"paths": [ "/{index}/_xpack/rollup/data", "/{index}/_rollup/data" ],
|
"paths": [ "/{index}/_rollup/data" ],
|
||||||
"parts": {
|
"parts": {
|
||||||
"index": {
|
"index": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
"documentation": "",
|
"documentation": "",
|
||||||
"methods": [ "PUT" ],
|
"methods": [ "PUT" ],
|
||||||
"url": {
|
"url": {
|
||||||
"path": "/_xpack/rollup/job/{id}",
|
"path": "/_rollup/job/{id}",
|
||||||
"paths": [ "/_xpack/rollup/job/{id}", "/_rollup/job/{id}" ],
|
"paths": [ "/_rollup/job/{id}" ],
|
||||||
"parts": {
|
"parts": {
|
||||||
"id": {
|
"id": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
"documentation": "",
|
"documentation": "",
|
||||||
"methods": [ "POST" ],
|
"methods": [ "POST" ],
|
||||||
"url": {
|
"url": {
|
||||||
"path": "/_xpack/rollup/job/{id}/_start",
|
"path": "/_rollup/job/{id}/_start",
|
||||||
"paths": [ "/_xpack/rollup/job/{id}/_start", "/_rollup/job/{id}/_start" ],
|
"paths": [ "/_rollup/job/{id}/_start" ],
|
||||||
"parts": {
|
"parts": {
|
||||||
"id": {
|
"id": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
"documentation": "",
|
"documentation": "",
|
||||||
"methods": [ "POST" ],
|
"methods": [ "POST" ],
|
||||||
"url": {
|
"url": {
|
||||||
"path": "/_xpack/rollup/job/{id}/_stop",
|
"path": "/_rollup/job/{id}/_stop",
|
||||||
"paths": [ "/_xpack/rollup/job/{id}/_stop", "/_rollup/job/{id}/_stop" ],
|
"paths": [ "/_rollup/job/{id}/_stop" ],
|
||||||
"parts": {
|
"parts": {
|
||||||
"id": {
|
"id": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -280,7 +280,7 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
|
|||||||
assertThat(createRollupJobResponse.get("acknowledged"), equalTo(Boolean.TRUE));
|
assertThat(createRollupJobResponse.get("acknowledged"), equalTo(Boolean.TRUE));
|
||||||
|
|
||||||
// start the rollup job
|
// start the rollup job
|
||||||
final Request startRollupJobRequest = new Request("POST", "_xpack/rollup/job/rollup-job-test/_start");
|
final Request startRollupJobRequest = new Request("POST", "/_xpack/rollup/job/rollup-job-test/_start");
|
||||||
Map<String, Object> startRollupJobResponse = entityAsMap(client().performRequest(startRollupJobRequest));
|
Map<String, Object> startRollupJobResponse = entityAsMap(client().performRequest(startRollupJobRequest));
|
||||||
assertThat(startRollupJobResponse.get("started"), equalTo(Boolean.TRUE));
|
assertThat(startRollupJobResponse.get("started"), equalTo(Boolean.TRUE));
|
||||||
|
|
||||||
@ -339,7 +339,7 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
|
|||||||
assertThat(createRollupJobResponse.get("acknowledged"), equalTo(Boolean.TRUE));
|
assertThat(createRollupJobResponse.get("acknowledged"), equalTo(Boolean.TRUE));
|
||||||
|
|
||||||
// start the rollup job
|
// start the rollup job
|
||||||
final Request startRollupJobRequest = new Request("POST", "_xpack/rollup/job/rollup-id-test/_start");
|
final Request startRollupJobRequest = new Request("POST", "/_xpack/rollup/job/rollup-id-test/_start");
|
||||||
Map<String, Object> startRollupJobResponse = entityAsMap(client().performRequest(startRollupJobRequest));
|
Map<String, Object> startRollupJobResponse = entityAsMap(client().performRequest(startRollupJobRequest));
|
||||||
assertThat(startRollupJobResponse.get("started"), equalTo(Boolean.TRUE));
|
assertThat(startRollupJobResponse.get("started"), equalTo(Boolean.TRUE));
|
||||||
|
|
||||||
@ -374,14 +374,14 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
|
|||||||
assertRollUpJob("rollup-id-test");
|
assertRollUpJob("rollup-id-test");
|
||||||
|
|
||||||
// stop the rollup job to force a state save, which will upgrade the ID
|
// stop the rollup job to force a state save, which will upgrade the ID
|
||||||
final Request stopRollupJobRequest = new Request("POST", "_xpack/rollup/job/rollup-id-test/_stop");
|
final Request stopRollupJobRequest = new Request("POST", "/_rollup/job/rollup-id-test/_stop");
|
||||||
Map<String, Object> stopRollupJobResponse = entityAsMap(client().performRequest(stopRollupJobRequest));
|
Map<String, Object> stopRollupJobResponse = entityAsMap(client().performRequest(stopRollupJobRequest));
|
||||||
assertThat(stopRollupJobResponse.get("stopped"), equalTo(Boolean.TRUE));
|
assertThat(stopRollupJobResponse.get("stopped"), equalTo(Boolean.TRUE));
|
||||||
|
|
||||||
waitForRollUpJob("rollup-id-test", equalTo("stopped"));
|
waitForRollUpJob("rollup-id-test", equalTo("stopped"));
|
||||||
|
|
||||||
// start the rollup job again
|
// start the rollup job again
|
||||||
final Request startRollupJobRequest = new Request("POST", "_xpack/rollup/job/rollup-id-test/_start");
|
final Request startRollupJobRequest = new Request("POST", "/_rollup/job/rollup-id-test/_start");
|
||||||
Map<String, Object> startRollupJobResponse = entityAsMap(client().performRequest(startRollupJobRequest));
|
Map<String, Object> startRollupJobResponse = entityAsMap(client().performRequest(startRollupJobRequest));
|
||||||
assertThat(startRollupJobResponse.get("started"), equalTo(Boolean.TRUE));
|
assertThat(startRollupJobResponse.get("started"), equalTo(Boolean.TRUE));
|
||||||
|
|
||||||
@ -646,7 +646,12 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
|
|||||||
waitForRollUpJob(rollupJob, expectedStates);
|
waitForRollUpJob(rollupJob, expectedStates);
|
||||||
|
|
||||||
// check that the rollup job is started using the RollUp API
|
// check that the rollup job is started using the RollUp API
|
||||||
final Request getRollupJobRequest = new Request("GET", "_xpack/rollup/job/" + rollupJob);
|
final Request getRollupJobRequest;
|
||||||
|
if (isRunningAgainstOldCluster()) {
|
||||||
|
getRollupJobRequest = new Request("GET", "/_xpack/rollup/job/" + rollupJob);
|
||||||
|
} else {
|
||||||
|
getRollupJobRequest = new Request("GET", "/_rollup/job/" + rollupJob);
|
||||||
|
}
|
||||||
Map<String, Object> getRollupJobResponse = entityAsMap(client().performRequest(getRollupJobRequest));
|
Map<String, Object> getRollupJobResponse = entityAsMap(client().performRequest(getRollupJobRequest));
|
||||||
Map<String, Object> job = getJob(getRollupJobResponse, rollupJob);
|
Map<String, Object> job = getJob(getRollupJobResponse, rollupJob);
|
||||||
if (job != null) {
|
if (job != null) {
|
||||||
@ -692,7 +697,12 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
|
|||||||
|
|
||||||
private void waitForRollUpJob(final String rollupJob, final Matcher<?> expectedStates) throws Exception {
|
private void waitForRollUpJob(final String rollupJob, final Matcher<?> expectedStates) throws Exception {
|
||||||
assertBusy(() -> {
|
assertBusy(() -> {
|
||||||
final Request getRollupJobRequest = new Request("GET", "_xpack/rollup/job/" + rollupJob);
|
final Request getRollupJobRequest;
|
||||||
|
if (isRunningAgainstOldCluster()) {
|
||||||
|
getRollupJobRequest = new Request("GET", "/_xpack/rollup/job/" + rollupJob);
|
||||||
|
} else {
|
||||||
|
getRollupJobRequest = new Request("GET", "/_rollup/job/" + rollupJob);
|
||||||
|
}
|
||||||
Response getRollupJobResponse = client().performRequest(getRollupJobRequest);
|
Response getRollupJobResponse = client().performRequest(getRollupJobRequest);
|
||||||
assertThat(getRollupJobResponse.getStatusLine().getStatusCode(), equalTo(RestStatus.OK.getStatus()));
|
assertThat(getRollupJobResponse.getStatusLine().getStatusCode(), equalTo(RestStatus.OK.getStatus()));
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ public class RollupIT extends ESRestTestCase {
|
|||||||
client().performRequest(bulkRequest);
|
client().performRequest(bulkRequest);
|
||||||
|
|
||||||
// create the rollup job
|
// create the rollup job
|
||||||
final Request createRollupJobRequest = new Request("PUT", "/_xpack/rollup/job/rollup-job-test");
|
final Request createRollupJobRequest = new Request("PUT", "/_rollup/job/rollup-job-test");
|
||||||
int pageSize = randomIntBetween(2, 50);
|
int pageSize = randomIntBetween(2, 50);
|
||||||
createRollupJobRequest.setJsonEntity("{"
|
createRollupJobRequest.setJsonEntity("{"
|
||||||
+ "\"index_pattern\":\"rollup-*\","
|
+ "\"index_pattern\":\"rollup-*\","
|
||||||
@ -127,7 +127,7 @@ public class RollupIT extends ESRestTestCase {
|
|||||||
assertThat(createRollupJobResponse.get("acknowledged"), equalTo(Boolean.TRUE));
|
assertThat(createRollupJobResponse.get("acknowledged"), equalTo(Boolean.TRUE));
|
||||||
|
|
||||||
// start the rollup job
|
// start the rollup job
|
||||||
final Request startRollupJobRequest = new Request("POST", "_xpack/rollup/job/rollup-job-test/_start");
|
final Request startRollupJobRequest = new Request("POST", "_rollup/job/rollup-job-test/_start");
|
||||||
Map<String, Object> startRollupJobResponse = toMap(client().performRequest(startRollupJobRequest));
|
Map<String, Object> startRollupJobResponse = toMap(client().performRequest(startRollupJobRequest));
|
||||||
assertThat(startRollupJobResponse.get("started"), equalTo(Boolean.TRUE));
|
assertThat(startRollupJobResponse.get("started"), equalTo(Boolean.TRUE));
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ public class RollupIT extends ESRestTestCase {
|
|||||||
|
|
||||||
// Wait for the job to finish, by watching how many rollup docs we've indexed
|
// Wait for the job to finish, by watching how many rollup docs we've indexed
|
||||||
assertBusy(() -> {
|
assertBusy(() -> {
|
||||||
final Request getRollupJobRequest = new Request("GET", "_xpack/rollup/job/rollup-job-test");
|
final Request getRollupJobRequest = new Request("GET", "_rollup/job/rollup-job-test");
|
||||||
Response getRollupJobResponse = client().performRequest(getRollupJobRequest);
|
Response getRollupJobResponse = client().performRequest(getRollupJobRequest);
|
||||||
assertThat(getRollupJobResponse.getStatusLine().getStatusCode(), equalTo(RestStatus.OK.getStatus()));
|
assertThat(getRollupJobResponse.getStatusLine().getStatusCode(), equalTo(RestStatus.OK.getStatus()));
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ public class RollupIT extends ESRestTestCase {
|
|||||||
waitForRollUpJob(rollupJob, states);
|
waitForRollUpJob(rollupJob, states);
|
||||||
|
|
||||||
// check that the rollup job is started using the RollUp API
|
// check that the rollup job is started using the RollUp API
|
||||||
final Request getRollupJobRequest = new Request("GET", "_xpack/rollup/job/" + rollupJob);
|
final Request getRollupJobRequest = new Request("GET", "_rollup/job/" + rollupJob);
|
||||||
Map<String, Object> getRollupJobResponse = toMap(client().performRequest(getRollupJobRequest));
|
Map<String, Object> getRollupJobResponse = toMap(client().performRequest(getRollupJobRequest));
|
||||||
Map<String, Object> job = getJob(getRollupJobResponse, rollupJob);
|
Map<String, Object> job = getJob(getRollupJobResponse, rollupJob);
|
||||||
if (job != null) {
|
if (job != null) {
|
||||||
@ -246,7 +246,7 @@ public class RollupIT extends ESRestTestCase {
|
|||||||
|
|
||||||
private void waitForRollUpJob(final String rollupJob, String[] expectedStates) throws Exception {
|
private void waitForRollUpJob(final String rollupJob, String[] expectedStates) throws Exception {
|
||||||
assertBusy(() -> {
|
assertBusy(() -> {
|
||||||
final Request getRollupJobRequest = new Request("GET", "_xpack/rollup/job/" + rollupJob);
|
final Request getRollupJobRequest = new Request("GET", "_rollup/job/" + rollupJob);
|
||||||
Response getRollupJobResponse = client().performRequest(getRollupJobRequest);
|
Response getRollupJobResponse = client().performRequest(getRollupJobRequest);
|
||||||
assertThat(getRollupJobResponse.getStatusLine().getStatusCode(), equalTo(RestStatus.OK.getStatus()));
|
assertThat(getRollupJobResponse.getStatusLine().getStatusCode(), equalTo(RestStatus.OK.getStatus()));
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ public class RollupIDUpgradeIT extends AbstractUpgradeTestCase {
|
|||||||
client().performRequest(indexRequest);
|
client().performRequest(indexRequest);
|
||||||
|
|
||||||
// create the rollup job
|
// create the rollup job
|
||||||
final Request createRollupJobRequest = new Request("PUT", "/_xpack/rollup/job/rollup-id-test");
|
final Request createRollupJobRequest = new Request("PUT", "/_rollup/job/rollup-id-test");
|
||||||
createRollupJobRequest.setJsonEntity("{"
|
createRollupJobRequest.setJsonEntity("{"
|
||||||
+ "\"index_pattern\":\"target\","
|
+ "\"index_pattern\":\"target\","
|
||||||
+ "\"rollup_index\":\"rollup\","
|
+ "\"rollup_index\":\"rollup\","
|
||||||
@ -121,7 +121,7 @@ public class RollupIDUpgradeIT extends AbstractUpgradeTestCase {
|
|||||||
client().performRequest(updateSettings);
|
client().performRequest(updateSettings);
|
||||||
|
|
||||||
// start the rollup job
|
// start the rollup job
|
||||||
final Request startRollupJobRequest = new Request("POST", "_xpack/rollup/job/rollup-id-test/_start");
|
final Request startRollupJobRequest = new Request("POST", "_rollup/job/rollup-id-test/_start");
|
||||||
Map<String, Object> startRollupJobResponse = entityAsMap(client().performRequest(startRollupJobRequest));
|
Map<String, Object> startRollupJobResponse = entityAsMap(client().performRequest(startRollupJobRequest));
|
||||||
assertThat(startRollupJobResponse.get("started"), equalTo(Boolean.TRUE));
|
assertThat(startRollupJobResponse.get("started"), equalTo(Boolean.TRUE));
|
||||||
|
|
||||||
@ -227,7 +227,7 @@ public class RollupIDUpgradeIT extends AbstractUpgradeTestCase {
|
|||||||
waitForRollUpJob(rollupJob, expectedStates);
|
waitForRollUpJob(rollupJob, expectedStates);
|
||||||
|
|
||||||
// check that the rollup job is started using the RollUp API
|
// check that the rollup job is started using the RollUp API
|
||||||
final Request getRollupJobRequest = new Request("GET", "_xpack/rollup/job/" + rollupJob);
|
final Request getRollupJobRequest = new Request("GET", "_rollup/job/" + rollupJob);
|
||||||
Map<String, Object> getRollupJobResponse = entityAsMap(client().performRequest(getRollupJobRequest));
|
Map<String, Object> getRollupJobResponse = entityAsMap(client().performRequest(getRollupJobRequest));
|
||||||
Map<String, Object> job = getJob(getRollupJobResponse, rollupJob);
|
Map<String, Object> job = getJob(getRollupJobResponse, rollupJob);
|
||||||
if (job != null) {
|
if (job != null) {
|
||||||
@ -265,7 +265,7 @@ public class RollupIDUpgradeIT extends AbstractUpgradeTestCase {
|
|||||||
|
|
||||||
private void waitForRollUpJob(final String rollupJob, final Matcher<?> expectedStates) throws Exception {
|
private void waitForRollUpJob(final String rollupJob, final Matcher<?> expectedStates) throws Exception {
|
||||||
assertBusy(() -> {
|
assertBusy(() -> {
|
||||||
final Request getRollupJobRequest = new Request("GET", "_xpack/rollup/job/" + rollupJob);
|
final Request getRollupJobRequest = new Request("GET", "_rollup/job/" + rollupJob);
|
||||||
Response getRollupJobResponse = client().performRequest(getRollupJobRequest);
|
Response getRollupJobResponse = client().performRequest(getRollupJobRequest);
|
||||||
assertThat(getRollupJobResponse.getStatusLine().getStatusCode(), equalTo(RestStatus.OK.getStatus()));
|
assertThat(getRollupJobResponse.getStatusLine().getStatusCode(), equalTo(RestStatus.OK.getStatus()));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user