Skip to content

Commit b80b018

Browse files
authored
[8.15] Emit deprecation warning when executing one of the rollup APIs (#113042)
* [8.15] Emit deprecation warning when executing one of the rollup APIs Backporting #112807 to 8.15 branch. Currently none of the rollup APIs deprecation warning. Only the reference docs indicate that rollup has been deprecated. Relates to #112690 * Fixed compile errors after cherry-picking from main branch. * fix issue after merging * added some more allowed warnings
1 parent adf33e9 commit b80b018

File tree

34 files changed

+354
-28
lines changed

34 files changed

+354
-28
lines changed

docs/build.gradle

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,9 @@ buildRestTests.setups['library'] = '''
852852
853853
'''
854854
buildRestTests.setups['sensor_rollup_job'] = '''
855+
- requires:
856+
test_runner_features: [ "allowed_warnings" ]
857+
855858
- do:
856859
indices.create:
857860
index: dummy-rollup-index
@@ -882,9 +885,10 @@ buildRestTests.setups['sensor_rollup_job'] = '''
882885
node:
883886
type: keyword
884887
- do:
885-
raw:
886-
method: PUT
887-
path: _rollup/job/sensor
888+
allowed_warnings:
889+
- "The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information."
890+
rollup.put_job:
891+
id: sensor
888892
body: >
889893
{
890894
"index_pattern": "sensor-*",
@@ -914,6 +918,9 @@ buildRestTests.setups['sensor_rollup_job'] = '''
914918
}
915919
'''
916920
buildRestTests.setups['sensor_started_rollup_job'] = '''
921+
- requires:
922+
test_runner_features: [ "allowed_warnings" ]
923+
917924
- do:
918925
indices.create:
919926
index: dummy-rollup-index
@@ -963,9 +970,10 @@ buildRestTests.setups['sensor_started_rollup_job'] = '''
963970
{"timestamp": 1516297294000, "temperature": 202, "voltage": 4.0, "node": "c"}
964971
965972
- do:
966-
raw:
967-
method: PUT
968-
path: _rollup/job/sensor
973+
allowed_warnings:
974+
- "The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information."
975+
rollup.put_job:
976+
id: sensor
969977
body: >
970978
{
971979
"index_pattern": "sensor-*",
@@ -994,9 +1002,10 @@ buildRestTests.setups['sensor_started_rollup_job'] = '''
9941002
]
9951003
}
9961004
- do:
997-
raw:
998-
method: POST
999-
path: _rollup/job/sensor/_start
1005+
allowed_warnings:
1006+
- "The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information."
1007+
rollup.start_job:
1008+
id: sensor
10001009
'''
10011010

10021011
buildRestTests.setups['sensor_index'] = '''

docs/reference/rollup/apis/delete-job.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ If we have a rollup job named `sensor`, it can be deleted with:
8080
DELETE _rollup/job/sensor
8181
--------------------------------------------------
8282
// TEST[setup:sensor_rollup_job]
83+
// TEST[warning:The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information.]
8384

8485
Which will return the response:
8586

docs/reference/rollup/apis/get-job.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ job can be retrieved with:
8989
GET _rollup/job/sensor
9090
--------------------------------------------------
9191
// TEST[setup:sensor_rollup_job]
92+
// TEST[warning:The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information.]
9293

9394
The API yields the following response:
9495

@@ -192,6 +193,7 @@ PUT _rollup/job/sensor2 <1>
192193
GET _rollup/job/_all <2>
193194
--------------------------------------------------
194195
// TEST[setup:sensor_rollup_job]
196+
// TEST[warning:The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information.]
195197
<1> We create a second job with name `sensor2`
196198
<2> Then request all jobs by using `_all` in the GetJobs API
197199

docs/reference/rollup/apis/put-job.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ PUT _rollup/job/sensor
281281
}
282282
--------------------------------------------------
283283
// TEST[setup:sensor_index]
284+
// TEST[warning:The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information.]
284285
<1> This configuration enables date histograms to be used on the `timestamp`
285286
field and `terms` aggregations to be used on the `node` field.
286287
<2> This configuration defines metrics over two fields: `temperature` and

docs/reference/rollup/apis/rollup-caps.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ PUT _rollup/job/sensor
8383
}
8484
--------------------------------------------------
8585
// TEST[setup:sensor_index]
86+
// TEST[warning:The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information.]
8687

8788
We can then retrieve the rollup capabilities of that index pattern (`sensor-*`)
8889
via the following command:
@@ -92,6 +93,7 @@ via the following command:
9293
GET _rollup/data/sensor-*
9394
--------------------------------------------------
9495
// TEST[continued]
96+
// TEST[warning:The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information.]
9597

9698
Which will yield the following response:
9799

@@ -164,6 +166,7 @@ We could also retrieve the same information with a request to `_all`:
164166
GET _rollup/data/_all
165167
--------------------------------------------------
166168
// TEST[continued]
169+
// TEST[warning:The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information.]
167170

168171
But note that if we use the concrete index name (`sensor-1`), we'll retrieve no
169172
rollup capabilities:
@@ -173,6 +176,7 @@ rollup capabilities:
173176
GET _rollup/data/sensor-1
174177
--------------------------------------------------
175178
// TEST[continued]
179+
// TEST[warning:The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information.]
176180

177181
[source,console-result]
178182
----

docs/reference/rollup/apis/rollup-index-caps.asciidoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ PUT _rollup/job/sensor
8080
}
8181
--------------------------------------------------
8282
// TEST[setup:sensor_index]
83+
// TEST[warning:The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information.]
8384

8485
If at a later date, we'd like to determine what jobs and capabilities were
8586
stored in the `sensor_rollup` index, we can use the get rollup index API:
@@ -89,6 +90,7 @@ stored in the `sensor_rollup` index, we can use the get rollup index API:
8990
GET /sensor_rollup/_rollup/data
9091
--------------------------------------------------
9192
// TEST[continued]
93+
// TEST[warning:The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information.]
9294

9395
Note how we are requesting the concrete rollup index name (`sensor_rollup`) as
9496
the first part of the URL. This will yield the following response:
@@ -164,3 +166,4 @@ instead of explicit indices:
164166
GET /*_rollup/_rollup/data
165167
--------------------------------------------------
166168
// TEST[continued]
169+
// TEST[warning:The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information.]

docs/reference/rollup/apis/rollup-search.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ PUT _rollup/job/sensor
105105
}
106106
--------------------------------------------------
107107
// TEST[setup:sensor_index]
108+
// TEST[warning:The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information.]
108109

109110
This rolls up the `sensor-*` pattern and stores the results in `sensor_rollup`.
110111
To search this rolled up data, we need to use the `_rollup_search` endpoint.
@@ -127,6 +128,7 @@ GET /sensor_rollup/_rollup_search
127128
--------------------------------------------------
128129
// TEST[setup:sensor_prefab_data]
129130
// TEST[s/_rollup_search/_rollup_search?filter_path=took,timed_out,terminated_early,_shards,hits,aggregations/]
131+
// TEST[warning:The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information.]
130132

131133
The query is targeting the `sensor_rollup` data, since this contains the rollup
132134
data as configured in the job. A `max` aggregation has been used on the
@@ -182,6 +184,7 @@ GET sensor_rollup/_rollup_search
182184
--------------------------------------------------
183185
// TEST[continued]
184186
// TEST[catch:/illegal_argument_exception/]
187+
// TEST[warning:The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information.]
185188

186189
[source,console-result]
187190
----
@@ -225,6 +228,7 @@ GET sensor-1,sensor_rollup/_rollup_search <1>
225228
--------------------------------------------------
226229
// TEST[continued]
227230
// TEST[s/_rollup_search/_rollup_search?filter_path=took,timed_out,terminated_early,_shards,hits,aggregations/]
231+
// TEST[warning:The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information.]
228232
<1> Note the URI now searches `sensor-1` and `sensor_rollup` at the same time
229233

230234
When the search is executed, the rollup search endpoint does two things:

docs/reference/rollup/apis/start-job.asciidoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ If we have already created a {rollup-job} named `sensor`, it can be started with
5151
POST _rollup/job/sensor/_start
5252
--------------------------------------------------
5353
// TEST[setup:sensor_rollup_job]
54+
// TEST[warning:The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information.]
5455

5556
Which will return the response:
5657

@@ -59,4 +60,4 @@ Which will return the response:
5960
{
6061
"started": true
6162
}
62-
----
63+
----

docs/reference/rollup/apis/stop-job.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ the indexer has fully stopped. This is accomplished with the
7676
POST _rollup/job/sensor/_stop?wait_for_completion=true&timeout=10s
7777
--------------------------------------------------
7878
// TEST[setup:sensor_started_rollup_job]
79+
// TEST[warning:The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information.]
7980

8081
The parameter blocks the API call from returning until either the job has moved
8182
to `STOPPED` or the specified time has elapsed. If the specified time elapses

docs/reference/rollup/migrating-to-downsampling.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ PUT _rollup/job/sensor
5151
}
5252
--------------------------------------------------
5353
// TEST[setup:sensor_index]
54+
// TEST[warning:The rollup functionality will be removed in in Elasticsearch 9.0. See docs for more information.]
5455

5556
The equivalent <<tsds,time series data stream (TSDS)>> setup that uses downsampling via DSL:
5657

0 commit comments

Comments
 (0)