Skip to content

Commit e8af4e2

Browse files
committed
Fix #38623 remove xpack namespace REST API (#38625)
* Fix #38623 remove xpack namespace REST API Except for xpack.usage and xpack.info API's, this moves the last remaining API's out of the xpack namespace * rename xpack api's inside inside the files as well * updated yaml tests references to xpack namespaces api's * update callsApi calls in the IT subclasses * make sure docs testing does not use xpack namespaced api's * fix leftover xpack namespaced method names in docs/build.gradle * found another leftover reference (cherry picked from commit ccb5d93)
1 parent 9a50845 commit e8af4e2

File tree

110 files changed

+447
-447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+447
-447
lines changed

docs/build.gradle

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ buildRestTests.setups['sensor_prefab_data'] = '''
840840
'''
841841
buildRestTests.setups['sample_job'] = '''
842842
- do:
843-
xpack.ml.put_job:
843+
ml.put_job:
844844
job_id: "sample_job"
845845
body: >
846846
{
@@ -894,7 +894,7 @@ buildRestTests.setups['farequote_data'] = buildRestTests.setups['farequote_index
894894
'''
895895
buildRestTests.setups['farequote_job'] = buildRestTests.setups['farequote_data'] + '''
896896
- do:
897-
xpack.ml.put_job:
897+
ml.put_job:
898898
job_id: "farequote"
899899
body: >
900900
{
@@ -914,7 +914,7 @@ buildRestTests.setups['farequote_job'] = buildRestTests.setups['farequote_data']
914914
'''
915915
buildRestTests.setups['farequote_datafeed'] = buildRestTests.setups['farequote_job'] + '''
916916
- do:
917-
xpack.ml.put_datafeed:
917+
ml.put_datafeed:
918918
datafeed_id: "datafeed-farequote"
919919
body: >
920920
{
@@ -978,7 +978,7 @@ buildRestTests.setups['server_metrics_data'] = buildRestTests.setups['server_met
978978
'''
979979
buildRestTests.setups['server_metrics_job'] = buildRestTests.setups['server_metrics_data'] + '''
980980
- do:
981-
xpack.ml.put_job:
981+
ml.put_job:
982982
job_id: "total-requests"
983983
body: >
984984
{
@@ -1000,7 +1000,7 @@ buildRestTests.setups['server_metrics_job'] = buildRestTests.setups['server_metr
10001000
'''
10011001
buildRestTests.setups['server_metrics_datafeed'] = buildRestTests.setups['server_metrics_job'] + '''
10021002
- do:
1003-
xpack.ml.put_datafeed:
1003+
ml.put_datafeed:
10041004
datafeed_id: "datafeed-total-requests"
10051005
body: >
10061006
{
@@ -1010,22 +1010,22 @@ buildRestTests.setups['server_metrics_datafeed'] = buildRestTests.setups['server
10101010
'''
10111011
buildRestTests.setups['server_metrics_openjob'] = buildRestTests.setups['server_metrics_datafeed'] + '''
10121012
- do:
1013-
xpack.ml.open_job:
1013+
ml.open_job:
10141014
job_id: "total-requests"
10151015
'''
10161016
buildRestTests.setups['server_metrics_startdf'] = buildRestTests.setups['server_metrics_openjob'] + '''
10171017
- do:
1018-
xpack.ml.start_datafeed:
1018+
ml.start_datafeed:
10191019
datafeed_id: "datafeed-total-requests"
10201020
'''
10211021
buildRestTests.setups['calendar_outages'] = '''
10221022
- do:
1023-
xpack.ml.put_calendar:
1023+
ml.put_calendar:
10241024
calendar_id: "planned-outages"
10251025
'''
10261026
buildRestTests.setups['calendar_outages_addevent'] = buildRestTests.setups['calendar_outages'] + '''
10271027
- do:
1028-
xpack.ml.post_calendar_events:
1028+
ml.post_calendar_events:
10291029
calendar_id: "planned-outages"
10301030
body: >
10311031
{ "description": "event 1", "start_time": "2017-12-01T00:00:00Z", "end_time": "2017-12-02T00:00:00Z", "calendar_id": "planned-outages" }
@@ -1034,12 +1034,12 @@ buildRestTests.setups['calendar_outages_addevent'] = buildRestTests.setups['cale
10341034
'''
10351035
buildRestTests.setups['calendar_outages_openjob'] = buildRestTests.setups['server_metrics_openjob'] + '''
10361036
- do:
1037-
xpack.ml.put_calendar:
1037+
ml.put_calendar:
10381038
calendar_id: "planned-outages"
10391039
'''
10401040
buildRestTests.setups['calendar_outages_addjob'] = buildRestTests.setups['server_metrics_openjob'] + '''
10411041
- do:
1042-
xpack.ml.put_calendar:
1042+
ml.put_calendar:
10431043
calendar_id: "planned-outages"
10441044
body: >
10451045
{
@@ -1048,7 +1048,7 @@ buildRestTests.setups['calendar_outages_addjob'] = buildRestTests.setups['server
10481048
'''
10491049
buildRestTests.setups['calendar_outages_addevent'] = buildRestTests.setups['calendar_outages_addjob'] + '''
10501050
- do:
1051-
xpack.ml.post_calendar_events:
1051+
ml.post_calendar_events:
10521052
calendar_id: "planned-outages"
10531053
body: >
10541054
{ "events" : [

x-pack/docs/build.gradle

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ buildRestTests.docs = fileTree(projectDir) {
9797
Map<String, String> setups = buildRestTests.setups
9898
setups['my_inactive_watch'] = '''
9999
- do:
100-
xpack.watcher.put_watch:
100+
watcher.put_watch:
101101
id: "my_watch"
102102
active: false
103103
body: >
@@ -216,7 +216,7 @@ setups['library'] = '''
216216
'''
217217
setups['sample_job'] = '''
218218
- do:
219-
xpack.ml.put_job:
219+
ml.put_job:
220220
job_id: "sample_job"
221221
body: >
222222
{
@@ -270,7 +270,7 @@ setups['farequote_data'] = setups['farequote_index'] + '''
270270
'''
271271
setups['farequote_job'] = setups['farequote_data'] + '''
272272
- do:
273-
xpack.ml.put_job:
273+
ml.put_job:
274274
job_id: "farequote"
275275
body: >
276276
{
@@ -290,7 +290,7 @@ setups['farequote_job'] = setups['farequote_data'] + '''
290290
'''
291291
setups['farequote_datafeed'] = setups['farequote_job'] + '''
292292
- do:
293-
xpack.ml.put_datafeed:
293+
ml.put_datafeed:
294294
datafeed_id: "datafeed-farequote"
295295
body: >
296296
{
@@ -300,7 +300,7 @@ setups['farequote_datafeed'] = setups['farequote_job'] + '''
300300
'''
301301
setups['ml_filter_safe_domains'] = '''
302302
- do:
303-
xpack.ml.put_filter:
303+
ml.put_filter:
304304
filter_id: "safe_domains"
305305
body: >
306306
{
@@ -364,7 +364,7 @@ setups['server_metrics_data'] = setups['server_metrics_index'] + '''
364364
'''
365365
setups['server_metrics_job'] = setups['server_metrics_data'] + '''
366366
- do:
367-
xpack.ml.put_job:
367+
ml.put_job:
368368
job_id: "total-requests"
369369
body: >
370370
{
@@ -386,7 +386,7 @@ setups['server_metrics_job'] = setups['server_metrics_data'] + '''
386386
'''
387387
setups['server_metrics_datafeed'] = setups['server_metrics_job'] + '''
388388
- do:
389-
xpack.ml.put_datafeed:
389+
ml.put_datafeed:
390390
datafeed_id: "datafeed-total-requests"
391391
body: >
392392
{
@@ -396,22 +396,22 @@ setups['server_metrics_datafeed'] = setups['server_metrics_job'] + '''
396396
'''
397397
setups['server_metrics_openjob'] = setups['server_metrics_datafeed'] + '''
398398
- do:
399-
xpack.ml.open_job:
399+
ml.open_job:
400400
job_id: "total-requests"
401401
'''
402402
setups['server_metrics_startdf'] = setups['server_metrics_openjob'] + '''
403403
- do:
404-
xpack.ml.start_datafeed:
404+
ml.start_datafeed:
405405
datafeed_id: "datafeed-total-requests"
406406
'''
407407
setups['calendar_outages'] = '''
408408
- do:
409-
xpack.ml.put_calendar:
409+
ml.put_calendar:
410410
calendar_id: "planned-outages"
411411
'''
412412
setups['calendar_outages_addevent'] = setups['calendar_outages'] + '''
413413
- do:
414-
xpack.ml.post_calendar_events:
414+
ml.post_calendar_events:
415415
calendar_id: "planned-outages"
416416
body: >
417417
{ "description": "event 1", "start_time": "2017-12-01T00:00:00Z", "end_time": "2017-12-02T00:00:00Z", "calendar_id": "planned-outages" }
@@ -420,12 +420,12 @@ setups['calendar_outages_addevent'] = setups['calendar_outages'] + '''
420420
'''
421421
setups['calendar_outages_openjob'] = setups['server_metrics_openjob'] + '''
422422
- do:
423-
xpack.ml.put_calendar:
423+
ml.put_calendar:
424424
calendar_id: "planned-outages"
425425
'''
426426
setups['calendar_outages_addjob'] = setups['server_metrics_openjob'] + '''
427427
- do:
428-
xpack.ml.put_calendar:
428+
ml.put_calendar:
429429
calendar_id: "planned-outages"
430430
body: >
431431
{
@@ -434,7 +434,7 @@ setups['calendar_outages_addjob'] = setups['server_metrics_openjob'] + '''
434434
'''
435435
setups['calendar_outages_addevent'] = setups['calendar_outages_addjob'] + '''
436436
- do:
437-
xpack.ml.post_calendar_events:
437+
ml.post_calendar_events:
438438
calendar_id: "planned-outages"
439439
body: >
440440
{ "events" : [
@@ -473,7 +473,7 @@ setups['sensor_rollup_job'] = '''
473473
node:
474474
type: keyword
475475
- do:
476-
xpack.rollup.put_job:
476+
rollup.put_job:
477477
id: "sensor"
478478
body: >
479479
{
@@ -541,7 +541,7 @@ setups['sensor_started_rollup_job'] = '''
541541
{"timestamp": 1516297294000, "temperature": 202, "voltage": 4.0, "node": "c"}
542542
543543
- do:
544-
xpack.rollup.put_job:
544+
rollup.put_job:
545545
id: "sensor"
546546
body: >
547547
{
@@ -571,7 +571,7 @@ setups['sensor_started_rollup_job'] = '''
571571
]
572572
}
573573
- do:
574-
xpack.rollup.start_job:
574+
rollup.start_job:
575575
id: "sensor"
576576
'''
577577

x-pack/docs/src/test/java/org/elasticsearch/smoketest/XDocsClientYamlTestSuiteIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ public void reenableWatcher() throws Exception {
7979
if (isWatcherTest()) {
8080
assertBusy(() -> {
8181
ClientYamlTestResponse response =
82-
getAdminExecutionContext().callApi("xpack.watcher.stats", emptyMap(), emptyList(), emptyMap());
82+
getAdminExecutionContext().callApi("watcher.stats", emptyMap(), emptyList(), emptyMap());
8383
String state = (String) response.evaluate("stats.0.watcher_state");
8484

8585
switch (state) {
8686
case "stopped":
8787
ClientYamlTestResponse startResponse =
88-
getAdminExecutionContext().callApi("xpack.watcher.start", emptyMap(), emptyList(), emptyMap());
88+
getAdminExecutionContext().callApi("watcher.start", emptyMap(), emptyList(), emptyMap());
8989
boolean isAcknowledged = (boolean) startResponse.evaluate("acknowledged");
9090
assertThat(isAcknowledged, is(true));
9191
throw new AssertionError("waiting until stopped state reached started state");

x-pack/plugin/ml/qa/ml-with-security/src/test/java/org/elasticsearch/smoketest/MlWithSecurityUserRoleIT.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public void test() throws IOException {
3535
// role
3636
for (ExecutableSection section : testCandidate.getTestSection().getExecutableSections()) {
3737
if (section instanceof DoSection) {
38-
if (((DoSection) section).getApiCallSection().getApi().startsWith("xpack.ml.") &&
39-
((DoSection) section).getApiCallSection().getApi().startsWith("xpack.ml.get_") == false &&
40-
((DoSection) section).getApiCallSection().getApi().equals("xpack.ml.find_file_structure") == false) {
38+
if (((DoSection) section).getApiCallSection().getApi().startsWith("ml.") &&
39+
((DoSection) section).getApiCallSection().getApi().startsWith("ml.get_") == false &&
40+
((DoSection) section).getApiCallSection().getApi().equals("ml.find_file_structure") == false) {
4141
fail("should have failed because of missing role");
4242
}
4343
}

x-pack/plugin/src/test/java/org/elasticsearch/xpack/test/rest/XPackRestIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ private void waitForWatcher() throws Exception {
105105
if (isWatcherTest()) {
106106
assertBusy(() -> {
107107
ClientYamlTestResponse response =
108-
getAdminExecutionContext().callApi("xpack.watcher.stats", emptyMap(), emptyList(), emptyMap());
108+
getAdminExecutionContext().callApi("watcher.stats", emptyMap(), emptyList(), emptyMap());
109109
String state = (String) response.evaluate("stats.0.watcher_state");
110110

111111
switch (state) {
112112
case "stopped":
113113
ClientYamlTestResponse startResponse =
114-
getAdminExecutionContext().callApi("xpack.watcher.start", emptyMap(), emptyList(), emptyMap());
114+
getAdminExecutionContext().callApi("watcher.start", emptyMap(), emptyList(), emptyMap());
115115
boolean isAcknowledged = (boolean) startResponse.evaluate("acknowledged");
116116
assertThat(isAcknowledged, is(true));
117117
throw new AssertionError("waiting until stopped state reached started state");

x-pack/plugin/src/test/resources/rest-api-spec/api/xpack.graph.explore.json renamed to x-pack/plugin/src/test/resources/rest-api-spec/api/graph.explore.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"xpack.graph.explore": {
2+
"graph.explore": {
33
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html",
44
"methods": ["GET", "POST"],
55
"url": {

x-pack/plugin/src/test/resources/rest-api-spec/api/xpack.license.delete.json renamed to x-pack/plugin/src/test/resources/rest-api-spec/api/license.delete.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"xpack.license.delete": {
2+
"license.delete": {
33
"documentation": "https://www.elastic.co/guide/en/x-pack/current/license-management.html",
44
"methods": ["DELETE"],
55
"url": {

x-pack/plugin/src/test/resources/rest-api-spec/api/xpack.license.get.json renamed to x-pack/plugin/src/test/resources/rest-api-spec/api/license.get.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"xpack.license.get": {
2+
"license.get": {
33
"documentation": "https://www.elastic.co/guide/en/x-pack/current/license-management.html",
44
"methods": ["GET"],
55
"url": {

x-pack/plugin/src/test/resources/rest-api-spec/api/xpack.license.get_basic_status.json renamed to x-pack/plugin/src/test/resources/rest-api-spec/api/license.get_basic_status.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"xpack.license.get_basic_status": {
2+
"license.get_basic_status": {
33
"documentation": "https://www.elastic.co/guide/en/x-pack/current/license-management.html",
44
"methods": ["GET"],
55
"url": {

x-pack/plugin/src/test/resources/rest-api-spec/api/xpack.license.get_trial_status.json renamed to x-pack/plugin/src/test/resources/rest-api-spec/api/license.get_trial_status.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"xpack.license.get_trial_status": {
2+
"license.get_trial_status": {
33
"documentation": "https://www.elastic.co/guide/en/x-pack/current/license-management.html",
44
"methods": ["GET"],
55
"url": {

0 commit comments

Comments
 (0)