Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Deprecate X-Pack centric ML endpoints #36315

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public class RestTestsFromSnippetsTask extends SnippetsTask {
* format of the response is incompatible i.e. it is not a JSON object.
*/
static shouldAddShardFailureCheck(String path) {
return path.startsWith('_cat') == false && path.startsWith('_xpack/ml/datafeeds/') == false
return path.startsWith('_cat') == false && path.startsWith('_ml/datafeeds/') == false
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ class RestTestFromSnippetsTaskTests extends GradleUnitTestCase {
void testIsDocWriteRequest() {
assertTrue(shouldAddShardFailureCheck("doc-index/_search"));
assertFalse(shouldAddShardFailureCheck("_cat"))
assertFalse(shouldAddShardFailureCheck("_xpack/ml/datafeeds/datafeed-id/_preview"));
assertFalse(shouldAddShardFailureCheck("_ml/datafeeds/datafeed-id/_preview"));
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/reference/ml/aggregations.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ example:

[source,js]
----------------------------------
PUT _xpack/ml/anomaly_detectors/farequote
PUT _ml/anomaly_detectors/farequote
{
"analysis_config": {
"bucket_span": "60m",
Expand Down Expand Up @@ -55,7 +55,7 @@ The aggregations are defined in the {dfeed} as follows:

[source,js]
----------------------------------
PUT _xpack/ml/datafeeds/datafeed-farequote
PUT _ml/datafeeds/datafeed-farequote
{
"job_id":"farequote",
"indices": ["farequote"],
Expand Down
8 changes: 4 additions & 4 deletions docs/reference/ml/apis/close-job.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ operations, but you can still explore and navigate results.

==== Request

`POST _xpack/ml/anomaly_detectors/<job_id>/_close` +
`POST _ml/anomaly_detectors/<job_id>/_close` +

`POST _xpack/ml/anomaly_detectors/<job_id>,<job_id>/_close` +
`POST _ml/anomaly_detectors/<job_id>,<job_id>/_close` +

`POST _xpack/ml/anomaly_detectors/_all/_close` +
`POST _ml/anomaly_detectors/_all/_close` +


==== Description
Expand Down Expand Up @@ -78,7 +78,7 @@ The following example closes the `total-requests` job:

[source,js]
--------------------------------------------------
POST _xpack/ml/anomaly_detectors/total-requests/_close
POST _ml/anomaly_detectors/total-requests/_close
--------------------------------------------------
// CONSOLE
// TEST[skip:setup:server_metrics_openjob]
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/ml/apis/delete-calendar-event.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Deletes scheduled events from a calendar.

==== Request

`DELETE _xpack/ml/calendars/<calendar_id>/events/<event_id>`
`DELETE _ml/calendars/<calendar_id>/events/<event_id>`


==== Description
Expand Down Expand Up @@ -42,7 +42,7 @@ calendar:

[source,js]
--------------------------------------------------
DELETE _xpack/ml/calendars/planned-outages/events/LS8LJGEBMTCMA-qz49st
DELETE _ml/calendars/planned-outages/events/LS8LJGEBMTCMA-qz49st
--------------------------------------------------
// CONSOLE
// TEST[skip:catch:missing]
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/ml/apis/delete-calendar-job.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Deletes jobs from a calendar.

==== Request

`DELETE _xpack/ml/calendars/<calendar_id>/jobs/<job_id>`
`DELETE _ml/calendars/<calendar_id>/jobs/<job_id>`


==== Path Parameters
Expand All @@ -36,7 +36,7 @@ calendar and `total-requests` job:

[source,js]
--------------------------------------------------
DELETE _xpack/ml/calendars/planned-outages/jobs/total-requests
DELETE _ml/calendars/planned-outages/jobs/total-requests
--------------------------------------------------
// CONSOLE
// TEST[skip:setup:calendar_outages_addjob]
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/ml/apis/delete-calendar.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Deletes a calendar.

==== Request

`DELETE _xpack/ml/calendars/<calendar_id>`
`DELETE _ml/calendars/<calendar_id>`


==== Description
Expand All @@ -38,7 +38,7 @@ The following example deletes the `planned-outages` calendar:

[source,js]
--------------------------------------------------
DELETE _xpack/ml/calendars/planned-outages
DELETE _ml/calendars/planned-outages
--------------------------------------------------
// CONSOLE
// TEST[skip:setup:calendar_outages]
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/ml/apis/delete-datafeed.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Deletes an existing {dfeed}.

==== Request

`DELETE _xpack/ml/datafeeds/<feed_id>`
`DELETE _ml/datafeeds/<feed_id>`


==== Description
Expand Down Expand Up @@ -45,7 +45,7 @@ The following example deletes the `datafeed-total-requests` {dfeed}:

[source,js]
--------------------------------------------------
DELETE _xpack/ml/datafeeds/datafeed-total-requests
DELETE _ml/datafeeds/datafeed-total-requests
--------------------------------------------------
// CONSOLE
// TEST[skip:setup:server_metrics_datafeed]
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/ml/apis/delete-expired-data.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Deletes expired and unused machine learning data.

==== Request

`DELETE _xpack/ml/_delete_expired_data`
`DELETE _ml/_delete_expired_data`

==== Description

Expand All @@ -32,7 +32,7 @@ The endpoint takes no arguments:

[source,js]
--------------------------------------------------
DELETE _xpack/ml/_delete_expired_data
DELETE _ml/_delete_expired_data
--------------------------------------------------
// CONSOLE
// TEST
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/ml/apis/delete-filter.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Deletes a filter.

==== Request

`DELETE _xpack/ml/filters/<filter_id>`
`DELETE _ml/filters/<filter_id>`


==== Description
Expand Down Expand Up @@ -39,7 +39,7 @@ The following example deletes the `safe_domains` filter:

[source,js]
--------------------------------------------------
DELETE _xpack/ml/filters/safe_domains
DELETE _ml/filters/safe_domains
--------------------------------------------------
// CONSOLE
// TEST[skip:setup:ml_filter_safe_domains]
Expand Down
8 changes: 4 additions & 4 deletions docs/reference/ml/apis/delete-forecast.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Deletes forecasts from a {ml} job.

==== Request

`DELETE _xpack/ml/anomaly_detectors/<job_id>/_forecast` +
`DELETE _ml/anomaly_detectors/<job_id>/_forecast` +

`DELETE _xpack/ml/anomaly_detectors/<job_id>/_forecast/<forecast_id>` +
`DELETE _ml/anomaly_detectors/<job_id>/_forecast/<forecast_id>` +

`DELETE _xpack/ml/anomaly_detectors/<job_id>/_forecast/_all`
`DELETE _ml/anomaly_detectors/<job_id>/_forecast/_all`


==== Description
Expand Down Expand Up @@ -63,7 +63,7 @@ The following example deletes all forecasts from the `total-requests` job:

[source,js]
--------------------------------------------------
DELETE _xpack/ml/anomaly_detectors/total-requests/_forecast/_all
DELETE _ml/anomaly_detectors/total-requests/_forecast/_all
--------------------------------------------------
// CONSOLE
// TEST[skip:setup:server_metrics_openjob]
Expand Down
8 changes: 4 additions & 4 deletions docs/reference/ml/apis/delete-job.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Deletes an existing anomaly detection job.

==== Request

`DELETE _xpack/ml/anomaly_detectors/<job_id>`
`DELETE _ml/anomaly_detectors/<job_id>`


==== Description
Expand Down Expand Up @@ -57,7 +57,7 @@ The following example deletes the `total-requests` job:

[source,js]
--------------------------------------------------
DELETE _xpack/ml/anomaly_detectors/total-requests
DELETE _ml/anomaly_detectors/total-requests
--------------------------------------------------
// CONSOLE
// TEST[skip:setup:server_metrics_job]
Expand All @@ -75,7 +75,7 @@ In the next example we delete the `total-requests` job asynchronously:

[source,js]
--------------------------------------------------
DELETE _xpack/ml/anomaly_detectors/total-requests?wait_for_completion=false
DELETE _ml/anomaly_detectors/total-requests?wait_for_completion=false
--------------------------------------------------
// CONSOLE
// TEST[skip:setup:server_metrics_job]
Expand All @@ -88,4 +88,4 @@ of the job deletion task:
"task": "oTUltX4IQMOUUVeiohTt8A:39"
}
----
// TESTRESPONSE[s/"task": "oTUltX4IQMOUUVeiohTt8A:39"/"task": $body.task/]
// TESTRESPONSE[s/"task": "oTUltX4IQMOUUVeiohTt8A:39"/"task": $body.task/]
6 changes: 3 additions & 3 deletions docs/reference/ml/apis/delete-snapshot.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Deletes an existing model snapshot.

==== Request

`DELETE _xpack/ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>`
`DELETE _ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>`


==== Description
Expand Down Expand Up @@ -41,7 +41,7 @@ The following example deletes the `1491948163` snapshot:

[source,js]
--------------------------------------------------
DELETE _xpack/ml/anomaly_detectors/farequote/model_snapshots/1491948163
DELETE _ml/anomaly_detectors/farequote/model_snapshots/1491948163
--------------------------------------------------
// CONSOLE
// TEST[skip:todo]
Expand All @@ -53,4 +53,4 @@ When the snapshot is deleted, you receive the following results:
"acknowledged": true
}
----
// TESTRESPONSE
// TESTRESPONSE
12 changes: 6 additions & 6 deletions docs/reference/ml/apis/find-file-structure.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ suitable to be ingested into {es}.

==== Request

`POST _xpack/ml/find_file_structure`
`POST _ml/find_file_structure`


==== Description
Expand Down Expand Up @@ -220,7 +220,7 @@ some books. You can send the contents to the `find_file_structure` endpoint:

[source,js]
----
POST _xpack/ml/find_file_structure
POST _ml/find_file_structure
{"name": "Leviathan Wakes", "author": "James S.A. Corey", "release_date": "2011-06-02", "page_count": 561}
{"name": "Hyperion", "author": "Dan Simmons", "release_date": "1989-05-26", "page_count": 482}
{"name": "Dune", "author": "Frank Herbert", "release_date": "1965-06-01", "page_count": 604}
Expand Down Expand Up @@ -501,7 +501,7 @@ to match what is specified in the `head` command.

[source,js]
----
curl -s "s3.amazonaws.com/nyc-tlc/trip+data/yellow_tripdata_2018-06.csv" | head -20000 | curl -s -H "Content-Type: application/json" -XPOST "localhost:9200/_xpack/ml/find_file_structure?pretty&lines_to_sample=20000" -T -
curl -s "s3.amazonaws.com/nyc-tlc/trip+data/yellow_tripdata_2018-06.csv" | head -20000 | curl -s -H "Content-Type: application/json" -XPOST "localhost:9200/_ml/find_file_structure?pretty&lines_to_sample=20000" -T -
----
// NOTCONSOLE
// Not converting to console because this shows how curl can be used
Expand Down Expand Up @@ -1305,7 +1305,7 @@ analysis:

[source,js]
----
curl -s "s3.amazonaws.com/nyc-tlc/trip+data/yellow_tripdata_2018-06.csv" | head -200000 | curl -s -H "Content-Type: application/json" -XPOST "localhost:9200/_xpack/ml/find_file_structure?pretty&lines_to_sample=200000&timeout=1s" -T -
curl -s "s3.amazonaws.com/nyc-tlc/trip+data/yellow_tripdata_2018-06.csv" | head -200000 | curl -s -H "Content-Type: application/json" -XPOST "localhost:9200/_ml/find_file_structure?pretty&lines_to_sample=200000&timeout=1s" -T -
----
// NOTCONSOLE
// Not converting to console because this shows how curl can be used
Expand Down Expand Up @@ -1342,7 +1342,7 @@ This is an example of analyzing {es}'s own log file:

[source,js]
----
curl -s -H "Content-Type: application/json" -XPOST "localhost:9200/_xpack/ml/find_file_structure?pretty" -T "$ES_HOME/logs/elasticsearch.log"
curl -s -H "Content-Type: application/json" -XPOST "localhost:9200/_ml/find_file_structure?pretty" -T "$ES_HOME/logs/elasticsearch.log"
----
// NOTCONSOLE
// Not converting to console because this shows how curl can be used
Expand Down Expand Up @@ -1496,7 +1496,7 @@ query parameter (appropriately URL escaped):

[source,js]
----
curl -s -H "Content-Type: application/json" -XPOST "localhost:9200/_xpack/ml/find_file_structure?pretty&format=semi_structured_text&grok_pattern=%5C%5B%25%7BTIMESTAMP_ISO8601:timestamp%7D%5C%5D%5C%5B%25%7BLOGLEVEL:loglevel%7D%20*%5C%5D%5C%5B%25%7BJAVACLASS:class%7D%20*%5C%5D%20%5C%5B%25%7BHOSTNAME:node%7D%5C%5D%20%25%7BJAVALOGMESSAGE:message%7D" -T "$ES_HOME/logs/elasticsearch.log"
curl -s -H "Content-Type: application/json" -XPOST "localhost:9200/_ml/find_file_structure?pretty&format=semi_structured_text&grok_pattern=%5C%5B%25%7BTIMESTAMP_ISO8601:timestamp%7D%5C%5D%5C%5B%25%7BLOGLEVEL:loglevel%7D%20*%5C%5D%5C%5B%25%7BJAVACLASS:class%7D%20*%5C%5D%20%5C%5B%25%7BHOSTNAME:node%7D%5C%5D%20%25%7BJAVALOGMESSAGE:message%7D" -T "$ES_HOME/logs/elasticsearch.log"
----
// NOTCONSOLE
// Not converting to console because this shows how curl can be used
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/ml/apis/flush-job.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Forces any buffered data to be processed by the job.

==== Request

`POST _xpack/ml/anomaly_detectors/<job_id>/_flush`
`POST _ml/anomaly_detectors/<job_id>/_flush`


==== Description
Expand Down Expand Up @@ -69,7 +69,7 @@ The following example flushes the `total-requests` job:

[source,js]
--------------------------------------------------
POST _xpack/ml/anomaly_detectors/total-requests/_flush
POST _ml/anomaly_detectors/total-requests/_flush
{
"calc_interim": true
}
Expand All @@ -96,7 +96,7 @@ on January 1, 2018:

[source,js]
--------------------------------------------------
POST _xpack/ml/anomaly_detectors/total-requests/_flush
POST _ml/anomaly_detectors/total-requests/_flush
{
"advance_time": "1514804400"
}
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/ml/apis/forecast.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Predicts the future behavior of a time series by using its historical behavior.

==== Request

`POST _xpack/ml/anomaly_detectors/<job_id>/_forecast`
`POST _ml/anomaly_detectors/<job_id>/_forecast`


==== Description
Expand Down Expand Up @@ -57,7 +57,7 @@ The following example requests a 10 day forecast for the `total-requests` job:

[source,js]
--------------------------------------------------
POST _xpack/ml/anomaly_detectors/total-requests/_forecast
POST _ml/anomaly_detectors/total-requests/_forecast
{
"duration": "10d"
}
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/ml/apis/get-bucket.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Retrieves job results for one or more buckets.

==== Request

`GET _xpack/ml/anomaly_detectors/<job_id>/results/buckets` +
`GET _ml/anomaly_detectors/<job_id>/results/buckets` +

`GET _xpack/ml/anomaly_detectors/<job_id>/results/buckets/<timestamp>`
`GET _ml/anomaly_detectors/<job_id>/results/buckets/<timestamp>`


==== Description
Expand Down Expand Up @@ -90,7 +90,7 @@ The following example gets bucket information for the `it-ops-kpi` job:

[source,js]
--------------------------------------------------
GET _xpack/ml/anomaly_detectors/it-ops-kpi/results/buckets
GET _ml/anomaly_detectors/it-ops-kpi/results/buckets
{
"anomaly_score": 80,
"start": "1454530200001"
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/ml/apis/get-calendar-event.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ calendars.

==== Request

`GET _xpack/ml/calendars/<calendar_id>/events` +
`GET _ml/calendars/<calendar_id>/events` +

`GET _xpack/ml/calendars/_all/events`
`GET _ml/calendars/_all/events`


===== Description
Expand Down Expand Up @@ -64,7 +64,7 @@ The following example gets information about the scheduled events in the

[source,js]
--------------------------------------------------
GET _xpack/ml/calendars/planned-outages/events
GET _ml/calendars/planned-outages/events
--------------------------------------------------
// CONSOLE
// TEST[skip:setup:calendar_outages_addevent]
Expand Down
Loading