[DOCS] Moves machine learning APIs to docs folder (#31118)

This commit is contained in:
Lisa Cawley 2018-08-31 16:49:24 -07:00 committed by GitHub
parent ca94d052b8
commit b7a63f7e7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
56 changed files with 408 additions and 173 deletions

View File

@ -19,10 +19,20 @@
apply plugin: 'elasticsearch.docs-test'
/* List of files that have snippets that require a gold or platinum licence
and therefore cannot be tested yet... */
/* List of files that have snippets that will not work until platinum tests can occur ... */
buildRestTests.expectedUnconvertedCandidates = [
'reference/ml/transforms.asciidoc',
'reference/ml/apis/delete-calendar-event.asciidoc',
'reference/ml/apis/get-bucket.asciidoc',
'reference/ml/apis/get-category.asciidoc',
'reference/ml/apis/get-influencer.asciidoc',
'reference/ml/apis/get-job-stats.asciidoc',
'reference/ml/apis/get-overall-buckets.asciidoc',
'reference/ml/apis/get-record.asciidoc',
'reference/ml/apis/get-snapshot.asciidoc',
'reference/ml/apis/post-data.asciidoc',
'reference/ml/apis/revert-snapshot.asciidoc',
'reference/ml/apis/update-snapshot.asciidoc',
]
integTestCluster {
@ -867,3 +877,224 @@ buildRestTests.setups['sensor_prefab_data'] = '''
{"node.terms.value":"c","temperature.sum.value":202.0,"temperature.max.value":202.0,"timestamp.date_histogram.time_zone":"UTC","temperature.min.value":202.0,"timestamp.date_histogram._count":1,"timestamp.date_histogram.interval":"1h","_rollup.computed":["temperature.sum","temperature.min","voltage.avg","temperature.max","node.terms","timestamp.date_histogram"],"voltage.avg.value":4.0,"node.terms._count":1,"_rollup.version":1,"timestamp.date_histogram.timestamp":1516294800000,"voltage.avg._count":1.0,"_rollup.id":"sensor"}
'''
buildRestTests.setups['sample_job'] = '''
- do:
xpack.ml.put_job:
job_id: "sample_job"
body: >
{
"description" : "Very basic job",
"analysis_config" : {
"bucket_span":"10m",
"detectors" :[
{
"function": "count"
}
]},
"data_description" : {
"time_field":"timestamp",
"time_format": "epoch_ms"
}
}
'''
buildRestTests.setups['farequote_index'] = '''
- do:
indices.create:
index: farequote
body:
settings:
number_of_shards: 1
number_of_replicas: 0
mappings:
metric:
properties:
time:
type: date
responsetime:
type: float
airline:
type: keyword
doc_count:
type: integer
'''
buildRestTests.setups['farequote_data'] = buildRestTests.setups['farequote_index'] + '''
- do:
bulk:
index: farequote
type: metric
refresh: true
body: |
{"index": {"_id":"1"}}
{"airline":"JZA","responsetime":990.4628,"time":"2016-02-07T00:00:00+0000", "doc_count": 5}
{"index": {"_id":"2"}}
{"airline":"JBU","responsetime":877.5927,"time":"2016-02-07T00:00:00+0000", "doc_count": 23}
{"index": {"_id":"3"}}
{"airline":"KLM","responsetime":1355.4812,"time":"2016-02-07T00:00:00+0000", "doc_count": 42}
'''
buildRestTests.setups['farequote_job'] = buildRestTests.setups['farequote_data'] + '''
- do:
xpack.ml.put_job:
job_id: "farequote"
body: >
{
"analysis_config": {
"bucket_span": "60m",
"detectors": [{
"function": "mean",
"field_name": "responsetime",
"by_field_name": "airline"
}],
"summary_count_field_name": "doc_count"
},
"data_description": {
"time_field": "time"
}
}
'''
buildRestTests.setups['farequote_datafeed'] = buildRestTests.setups['farequote_job'] + '''
- do:
xpack.ml.put_datafeed:
datafeed_id: "datafeed-farequote"
body: >
{
"job_id":"farequote",
"indexes":"farequote"
}
'''
buildRestTests.setups['server_metrics_index'] = '''
- do:
indices.create:
index: server-metrics
body:
settings:
number_of_shards: 1
number_of_replicas: 0
mappings:
metric:
properties:
timestamp:
type: date
total:
type: long
'''
buildRestTests.setups['server_metrics_data'] = buildRestTests.setups['server_metrics_index'] + '''
- do:
bulk:
index: server-metrics
type: metric
refresh: true
body: |
{"index": {"_id":"1177"}}
{"timestamp":"2017-03-23T13:00:00","total":40476}
{"index": {"_id":"1178"}}
{"timestamp":"2017-03-23T13:00:00","total":15287}
{"index": {"_id":"1179"}}
{"timestamp":"2017-03-23T13:00:00","total":-776}
{"index": {"_id":"1180"}}
{"timestamp":"2017-03-23T13:00:00","total":11366}
{"index": {"_id":"1181"}}
{"timestamp":"2017-03-23T13:00:00","total":3606}
{"index": {"_id":"1182"}}
{"timestamp":"2017-03-23T13:00:00","total":19006}
{"index": {"_id":"1183"}}
{"timestamp":"2017-03-23T13:00:00","total":38613}
{"index": {"_id":"1184"}}
{"timestamp":"2017-03-23T13:00:00","total":19516}
{"index": {"_id":"1185"}}
{"timestamp":"2017-03-23T13:00:00","total":-258}
{"index": {"_id":"1186"}}
{"timestamp":"2017-03-23T13:00:00","total":9551}
{"index": {"_id":"1187"}}
{"timestamp":"2017-03-23T13:00:00","total":11217}
{"index": {"_id":"1188"}}
{"timestamp":"2017-03-23T13:00:00","total":22557}
{"index": {"_id":"1189"}}
{"timestamp":"2017-03-23T13:00:00","total":40508}
{"index": {"_id":"1190"}}
{"timestamp":"2017-03-23T13:00:00","total":11887}
{"index": {"_id":"1191"}}
{"timestamp":"2017-03-23T13:00:00","total":31659}
'''
buildRestTests.setups['server_metrics_job'] = buildRestTests.setups['server_metrics_data'] + '''
- do:
xpack.ml.put_job:
job_id: "total-requests"
body: >
{
"description" : "Total sum of requests",
"analysis_config" : {
"bucket_span":"10m",
"detectors" :[
{
"detector_description": "Sum of total",
"function": "sum",
"field_name": "total"
}
]},
"data_description" : {
"time_field":"timestamp",
"time_format": "epoch_ms"
}
}
'''
buildRestTests.setups['server_metrics_datafeed'] = buildRestTests.setups['server_metrics_job'] + '''
- do:
xpack.ml.put_datafeed:
datafeed_id: "datafeed-total-requests"
body: >
{
"job_id":"total-requests",
"indexes":"server-metrics"
}
'''
buildRestTests.setups['server_metrics_openjob'] = buildRestTests.setups['server_metrics_datafeed'] + '''
- do:
xpack.ml.open_job:
job_id: "total-requests"
'''
buildRestTests.setups['server_metrics_startdf'] = buildRestTests.setups['server_metrics_openjob'] + '''
- do:
xpack.ml.start_datafeed:
datafeed_id: "datafeed-total-requests"
'''
buildRestTests.setups['calendar_outages'] = '''
- do:
xpack.ml.put_calendar:
calendar_id: "planned-outages"
'''
buildRestTests.setups['calendar_outages_addevent'] = buildRestTests.setups['calendar_outages'] + '''
- do:
xpack.ml.post_calendar_events:
calendar_id: "planned-outages"
body: >
{ "description": "event 1", "start_time": "2017-12-01T00:00:00Z", "end_time": "2017-12-02T00:00:00Z", "calendar_id": "planned-outages" }
'''
buildRestTests.setups['calendar_outages_openjob'] = buildRestTests.setups['server_metrics_openjob'] + '''
- do:
xpack.ml.put_calendar:
calendar_id: "planned-outages"
'''
buildRestTests.setups['calendar_outages_addjob'] = buildRestTests.setups['server_metrics_openjob'] + '''
- do:
xpack.ml.put_calendar:
calendar_id: "planned-outages"
body: >
{
"job_ids": ["total-requests"]
}
'''
buildRestTests.setups['calendar_outages_addevent'] = buildRestTests.setups['calendar_outages_addjob'] + '''
- do:
xpack.ml.post_calendar_events:
calendar_id: "planned-outages"
body: >
{ "events" : [
{ "description": "event 1", "start_time": "1513641600000", "end_time": "1513728000000"},
{ "description": "event 2", "start_time": "1513814400000", "end_time": "1513900800000"},
{ "description": "event 3", "start_time": "1514160000000", "end_time": "1514246400000"}
]}
'''

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-calendar-resource]]
=== Calendar Resources

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-close-job]]
=== Close Jobs API
++++
@ -80,7 +81,7 @@ The following example closes the `total-requests` job:
POST _xpack/ml/anomaly_detectors/total-requests/_close
--------------------------------------------------
// CONSOLE
// TEST[setup:server_metrics_openjob]
// TEST[skip:setup:server_metrics_openjob]
When the job is closed, you receive the following results:
[source,js]

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-datafeed-resource]]
=== {dfeed-cap} Resources

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-delete-calendar-event]]
=== Delete Events from Calendar API
++++
@ -44,7 +45,7 @@ calendar:
DELETE _xpack/ml/calendars/planned-outages/events/LS8LJGEBMTCMA-qz49st
--------------------------------------------------
// CONSOLE
// TEST[catch:missing]
// TEST[skip:catch:missing]
When the event is removed, you receive the following results:
[source,js]
@ -53,4 +54,3 @@ When the event is removed, you receive the following results:
"acknowledged": true
}
----
// NOTCONSOLE

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-delete-calendar-job]]
=== Delete Jobs from Calendar API
++++
@ -38,7 +39,7 @@ calendar and `total-requests` job:
DELETE _xpack/ml/calendars/planned-outages/jobs/total-requests
--------------------------------------------------
// CONSOLE
// TEST[setup:calendar_outages_addjob]
// TEST[skip:setup:calendar_outages_addjob]
When the job is removed from the calendar, you receive the following
results:
@ -50,4 +51,4 @@ results:
"job_ids": []
}
----
//TESTRESPONSE
// TESTRESPONSE

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-delete-calendar]]
=== Delete Calendar API
++++
@ -40,7 +41,7 @@ The following example deletes the `planned-outages` calendar:
DELETE _xpack/ml/calendars/planned-outages
--------------------------------------------------
// CONSOLE
// TEST[setup:calendar_outages]
// TEST[skip:setup:calendar_outages]
When the calendar is deleted, you receive the following results:
[source,js]
@ -49,4 +50,4 @@ When the calendar is deleted, you receive the following results:
"acknowledged": true
}
----
//TESTRESPONSE
// TESTRESPONSE

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-delete-datafeed]]
=== Delete {dfeeds-cap} API
++++
@ -47,7 +48,7 @@ The following example deletes the `datafeed-total-requests` {dfeed}:
DELETE _xpack/ml/datafeeds/datafeed-total-requests
--------------------------------------------------
// CONSOLE
// TEST[setup:server_metrics_datafeed]
// TEST[skip:setup:server_metrics_datafeed]
When the {dfeed} is deleted, you receive the following results:
[source,js]

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-delete-filter]]
=== Delete Filter API
++++
@ -41,7 +42,7 @@ The following example deletes the `safe_domains` filter:
DELETE _xpack/ml/filters/safe_domains
--------------------------------------------------
// CONSOLE
// TEST[setup:ml_filter_safe_domains]
// TEST[skip:setup:ml_filter_safe_domains]
When the filter is deleted, you receive the following results:
[source,js]
@ -50,4 +51,4 @@ When the filter is deleted, you receive the following results:
"acknowledged": true
}
----
//TESTRESPONSE
// TESTRESPONSE

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-delete-job]]
=== Delete Jobs API
++++
@ -56,7 +57,7 @@ The following example deletes the `total-requests` job:
DELETE _xpack/ml/anomaly_detectors/total-requests
--------------------------------------------------
// CONSOLE
// TEST[setup:server_metrics_job]
// TEST[skip:setup:server_metrics_job]
When the job is deleted, you receive the following results:
[source,js]
@ -65,4 +66,4 @@ When the job is deleted, you receive the following results:
"acknowledged": true
}
----
// TESTRESPONSE
// TESTRESPONSE

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-delete-snapshot]]
=== Delete Model Snapshots API
++++
@ -32,7 +33,6 @@ the `model_snapshot_id` in the results from the get jobs API.
You must have `manage_ml`, or `manage` cluster privileges to use this API.
For more information, see {xpack-ref}/security-privileges.html[Security Privileges].
//<<privileges-list-cluster>>.
==== Examples
@ -53,3 +53,4 @@ When the snapshot is deleted, you receive the following results:
"acknowledged": true
}
----
// TESTRESPONSE

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-event-resource]]
=== Scheduled Event Resources

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-filter-resource]]
=== Filter Resources

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-flush-job]]
=== Flush Jobs API
++++
@ -74,7 +75,7 @@ POST _xpack/ml/anomaly_detectors/total-requests/_flush
}
--------------------------------------------------
// CONSOLE
// TEST[setup:server_metrics_openjob]
// TEST[skip:setup:server_metrics_openjob]
When the operation succeeds, you receive the following results:
[source,js]
@ -84,7 +85,7 @@ When the operation succeeds, you receive the following results:
"last_finalized_bucket_end": 1455234900000
}
----
// TESTRESPONSE[s/"last_finalized_bucket_end": 1455234900000/"last_finalized_bucket_end": $body.last_finalized_bucket_end/]
//TESTRESPONSE[s/"last_finalized_bucket_end": 1455234900000/"last_finalized_bucket_end": $body.last_finalized_bucket_end/]
The `last_finalized_bucket_end` provides the timestamp (in
milliseconds-since-the-epoch) of the end of the last bucket that was processed.
@ -101,7 +102,7 @@ POST _xpack/ml/anomaly_detectors/total-requests/_flush
}
--------------------------------------------------
// CONSOLE
// TEST[setup:server_metrics_openjob]
// TEST[skip:setup:server_metrics_openjob]
When the operation succeeds, you receive the following results:
[source,js]

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-forecast]]
=== Forecast Jobs API
++++

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-get-bucket]]
=== Get Buckets API
++++
@ -81,7 +82,6 @@ that stores the results. The `machine_learning_admin` and `machine_learning_user
roles provide these privileges. For more information, see
{xpack-ref}/security-privileges.html[Security Privileges] and
{xpack-ref}/built-in-roles.html[Built-in Roles].
//<<security-privileges>> and <<built-in-roles>>.
==== Examples

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-get-calendar-event]]
=== Get Scheduled Events API
++++
@ -66,7 +67,7 @@ The following example gets information about the scheduled events in the
GET _xpack/ml/calendars/planned-outages/events
--------------------------------------------------
// CONSOLE
// TEST[setup:calendar_outages_addevent]
// TEST[skip:setup:calendar_outages_addevent]
The API returns the following results:

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-get-calendar]]
=== Get Calendars API
++++
@ -62,7 +63,7 @@ calendar:
GET _xpack/ml/calendars/planned-outages
--------------------------------------------------
// CONSOLE
// TEST[setup:calendar_outages_addjob]
// TEST[skip:setup:calendar_outages_addjob]
The API returns the following results:
[source,js]
@ -79,4 +80,4 @@ The API returns the following results:
]
}
----
//TESTRESPONSE
// TESTRESPONSE

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-get-category]]
=== Get Categories API
++++
@ -18,7 +19,6 @@ Retrieves job results for one or more categories.
For more information about categories, see
{xpack-ref}/ml-configuring-categories.html[Categorizing Log Messages].
//<<ml-configuring-categories>>.
==== Path Parameters
@ -56,7 +56,6 @@ that stores the results. The `machine_learning_admin` and `machine_learning_user
roles provide these privileges. For more information, see
{xpack-ref}/security-privileges.html[Security Privileges] and
{xpack-ref}/built-in-roles.html[Built-in Roles].
//<<security-privileges>> and <<built-in-roles>>.
==== Examples

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-get-datafeed-stats]]
=== Get {dfeed-cap} Statistics API
++++
@ -66,7 +67,7 @@ The following example gets usage information for the
GET _xpack/ml/datafeeds/datafeed-total-requests/_stats
--------------------------------------------------
// CONSOLE
// TEST[setup:server_metrics_startdf]
// TEST[skip:setup:server_metrics_startdf]
The API returns the following results:
[source,js]
@ -97,4 +98,4 @@ The API returns the following results:
// TESTRESPONSE[s/"node-0"/$body.$_path/]
// TESTRESPONSE[s/"hoXMLZB0RWKfR9UPPUCxXX"/$body.$_path/]
// TESTRESPONSE[s/"127.0.0.1:9300"/$body.$_path/]
// TESTRESPONSE[s/"17179869184"/$body.datafeeds.0.node.attributes.ml\\.machine_memory/]
// TESTRESPONSE[s/"17179869184"/$body.datafeeds.0.node.attributes.ml\\.machine_memory/]

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-get-datafeed]]
=== Get {dfeeds-cap} API
++++
@ -60,7 +61,7 @@ The following example gets configuration information for the
GET _xpack/ml/datafeeds/datafeed-total-requests
--------------------------------------------------
// CONSOLE
// TEST[setup:server_metrics_datafeed]
// TEST[skip:setup:server_metrics_datafeed]
The API returns the following results:
[source,js]

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-get-filter]]
=== Get Filters API
++++
@ -62,7 +63,7 @@ filter:
GET _xpack/ml/filters/safe_domains
--------------------------------------------------
// CONSOLE
// TEST[setup:ml_filter_safe_domains]
// TEST[skip:setup:ml_filter_safe_domains]
The API returns the following results:
[source,js]
@ -81,4 +82,4 @@ The API returns the following results:
]
}
----
//TESTRESPONSE
// TESTRESPONSE

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-get-influencer]]
=== Get Influencers API
++++

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-get-job-stats]]
=== Get Job Statistics API
++++

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-get-job]]
=== Get Jobs API
++++
@ -59,7 +60,7 @@ The following example gets configuration information for the `total-requests` jo
GET _xpack/ml/anomaly_detectors/total-requests
--------------------------------------------------
// CONSOLE
// TEST[setup:server_metrics_job]
// TEST[skip:setup:server_metrics_job]
The API returns the following results:
[source,js]

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-get-overall-buckets]]
=== Get Overall Buckets API
++++
@ -93,7 +94,6 @@ that stores the results. The `machine_learning_admin` and `machine_learning_user
roles provide these privileges. For more information, see
{xpack-ref}/security-privileges.html[Security Privileges] and
{xpack-ref}/built-in-roles.html[Built-in Roles].
//<<security-privileges>> and <<built-in-roles>>.
==== Examples

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-get-record]]
=== Get Records API
++++

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-get-snapshot]]
=== Get Model Snapshots API
++++

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-jobstats]]
=== Job Statistics

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-job-resource]]
=== Job Resources

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-apis]]
== Machine Learning APIs
@ -70,57 +71,57 @@ machine learning APIs and in advanced job configuration options in Kibana.
* <<ml-get-record,Get records>>
//ADD
include::ml/post-calendar-event.asciidoc[]
include::ml/put-calendar-job.asciidoc[]
include::post-calendar-event.asciidoc[]
include::put-calendar-job.asciidoc[]
//CLOSE
include::ml/close-job.asciidoc[]
include::close-job.asciidoc[]
//CREATE
include::ml/put-calendar.asciidoc[]
include::ml/put-datafeed.asciidoc[]
include::ml/put-filter.asciidoc[]
include::ml/put-job.asciidoc[]
include::put-calendar.asciidoc[]
include::put-datafeed.asciidoc[]
include::put-filter.asciidoc[]
include::put-job.asciidoc[]
//DELETE
include::ml/delete-calendar.asciidoc[]
include::ml/delete-datafeed.asciidoc[]
include::ml/delete-calendar-event.asciidoc[]
include::ml/delete-filter.asciidoc[]
include::ml/delete-job.asciidoc[]
include::ml/delete-calendar-job.asciidoc[]
include::ml/delete-snapshot.asciidoc[]
include::delete-calendar.asciidoc[]
include::delete-datafeed.asciidoc[]
include::delete-calendar-event.asciidoc[]
include::delete-filter.asciidoc[]
include::delete-job.asciidoc[]
include::delete-calendar-job.asciidoc[]
include::delete-snapshot.asciidoc[]
//FLUSH
include::ml/flush-job.asciidoc[]
include::flush-job.asciidoc[]
//FORECAST
include::ml/forecast.asciidoc[]
include::forecast.asciidoc[]
//GET
include::ml/get-calendar.asciidoc[]
include::ml/get-bucket.asciidoc[]
include::ml/get-overall-buckets.asciidoc[]
include::ml/get-category.asciidoc[]
include::ml/get-datafeed.asciidoc[]
include::ml/get-datafeed-stats.asciidoc[]
include::ml/get-influencer.asciidoc[]
include::ml/get-job.asciidoc[]
include::ml/get-job-stats.asciidoc[]
include::ml/get-snapshot.asciidoc[]
include::ml/get-calendar-event.asciidoc[]
include::ml/get-filter.asciidoc[]
include::ml/get-record.asciidoc[]
include::get-calendar.asciidoc[]
include::get-bucket.asciidoc[]
include::get-overall-buckets.asciidoc[]
include::get-category.asciidoc[]
include::get-datafeed.asciidoc[]
include::get-datafeed-stats.asciidoc[]
include::get-influencer.asciidoc[]
include::get-job.asciidoc[]
include::get-job-stats.asciidoc[]
include::get-snapshot.asciidoc[]
include::get-calendar-event.asciidoc[]
include::get-filter.asciidoc[]
include::get-record.asciidoc[]
//OPEN
include::ml/open-job.asciidoc[]
include::open-job.asciidoc[]
//POST
include::ml/post-data.asciidoc[]
include::post-data.asciidoc[]
//PREVIEW
include::ml/preview-datafeed.asciidoc[]
include::preview-datafeed.asciidoc[]
//REVERT
include::ml/revert-snapshot.asciidoc[]
include::revert-snapshot.asciidoc[]
//START/STOP
include::ml/start-datafeed.asciidoc[]
include::ml/stop-datafeed.asciidoc[]
include::start-datafeed.asciidoc[]
include::stop-datafeed.asciidoc[]
//UPDATE
include::ml/update-datafeed.asciidoc[]
include::ml/update-filter.asciidoc[]
include::ml/update-job.asciidoc[]
include::ml/update-snapshot.asciidoc[]
include::update-datafeed.asciidoc[]
include::update-filter.asciidoc[]
include::update-job.asciidoc[]
include::update-snapshot.asciidoc[]
//VALIDATE
//include::ml/validate-detector.asciidoc[]
//include::ml/validate-job.asciidoc[]
//include::validate-detector.asciidoc[]
//include::validate-job.asciidoc[]

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-open-job]]
=== Open Jobs API
++++
@ -56,7 +57,7 @@ POST _xpack/ml/anomaly_detectors/total-requests/_open
}
--------------------------------------------------
// CONSOLE
// TEST[setup:server_metrics_job]
// TEST[skip:setup:server_metrics_job]
When the job opens, you receive the following results:
[source,js]
@ -65,5 +66,4 @@ When the job opens, you receive the following results:
"opened": true
}
----
//CONSOLE
// TESTRESPONSE

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-post-calendar-event]]
=== Add Events to Calendar API
++++
@ -52,7 +53,7 @@ POST _xpack/ml/calendars/planned-outages/events
}
--------------------------------------------------
// CONSOLE
// TEST[setup:calendar_outages_addjob]
// TEST[skip:setup:calendar_outages_addjob]
The API returns the following results:
@ -81,7 +82,7 @@ The API returns the following results:
]
}
----
//TESTRESPONSE
// TESTRESPONSE
For more information about these properties, see
<<ml-event-resource,Scheduled Event Resources>>.

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-post-data]]
=== Post Data to Jobs API
++++

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-preview-datafeed]]
=== Preview {dfeeds-cap} API
++++
@ -53,7 +54,7 @@ The following example obtains a preview of the `datafeed-farequote` {dfeed}:
GET _xpack/ml/datafeeds/datafeed-farequote/_preview
--------------------------------------------------
// CONSOLE
// TEST[setup:farequote_datafeed]
// TEST[skip:setup:farequote_datafeed]
The data that is returned for this example is as follows:
[source,js]

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-put-calendar-job]]
=== Add Jobs to Calendar API
++++
@ -38,7 +39,7 @@ The following example associates the `planned-outages` calendar with the
PUT _xpack/ml/calendars/planned-outages/jobs/total-requests
--------------------------------------------------
// CONSOLE
// TEST[setup:calendar_outages_openjob]
// TEST[skip:setup:calendar_outages_openjob]
The API returns the following results:
@ -51,4 +52,4 @@ The API returns the following results:
]
}
----
//TESTRESPONSE
// TESTRESPONSE

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-put-calendar]]
=== Create Calendar API
++++
@ -44,6 +45,7 @@ The following example creates the `planned-outages` calendar:
PUT _xpack/ml/calendars/planned-outages
--------------------------------------------------
// CONSOLE
// TEST[skip:need-license]
When the calendar is created, you receive the following results:
[source,js]
@ -53,4 +55,4 @@ When the calendar is created, you receive the following results:
"job_ids": []
}
----
//TESTRESPONSE
// TESTRESPONSE

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-put-datafeed]]
=== Create {dfeeds-cap} API
++++
@ -107,7 +108,7 @@ PUT _xpack/ml/datafeeds/datafeed-total-requests
}
--------------------------------------------------
// CONSOLE
// TEST[setup:server_metrics_job]
// TEST[skip:setup:server_metrics_job]
When the {dfeed} is created, you receive the following results:
[source,js]
@ -132,4 +133,4 @@ When the {dfeed} is created, you receive the following results:
}
----
// TESTRESPONSE[s/"query_delay": "83474ms"/"query_delay": $body.query_delay/]
// TESTRESPONSE[s/"query.boost": "1.0"/"query.boost": $body.query.boost/]
// TESTRESPONSE[s/"query.boost": "1.0"/"query.boost": $body.query.boost/]

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-put-filter]]
=== Create Filter API
++++
@ -55,6 +56,7 @@ PUT _xpack/ml/filters/safe_domains
}
--------------------------------------------------
// CONSOLE
// TEST[skip:need-licence]
When the filter is created, you receive the following response:
[source,js]
@ -65,4 +67,4 @@ When the filter is created, you receive the following response:
"items": ["*.google.com", "wikipedia.org"]
}
----
//TESTRESPONSE
// TESTRESPONSE

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-put-job]]
=== Create Jobs API
++++
@ -104,6 +105,7 @@ PUT _xpack/ml/anomaly_detectors/total-requests
}
--------------------------------------------------
// CONSOLE
// TEST[skip:need-licence]
When the job is created, you receive the following results:
[source,js]

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-results-resource]]
=== Results Resources

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-revert-snapshot]]
=== Revert Model Snapshots API
++++
@ -22,33 +23,6 @@ then it might be appropriate to reset the model state to a time before this
event. For example, you might consider reverting to a saved snapshot after Black
Friday or a critical system failure.
////
To revert to a saved snapshot, you must follow this sequence:
. Close the job
. Revert to a snapshot
. Open the job
. Send new data to the job
When reverting to a snapshot, there is a choice to make about whether or not
you want to keep the results that were created between the time of the snapshot
and the current time. In the case of Black Friday for instance, you might want
to keep the results and carry on processing data from the current time,
though without the models learning the one-off behavior and compensating for it.
However, say in the event of a critical system failure and you decide to reset
and models to a previous known good state and process data from that time,
it makes sense to delete the intervening results for the known bad period and
resend data from that earlier time.
Any gaps in data since the snapshot time will be treated as nulls and not modeled.
If there is a partial bucket at the end of the snapshot and/or at the beginning
of the new input data, then this will be ignored and treated as a gap.
For jobs with many entities, the model state may be very large.
If a model state is several GB, this could take 10-20 mins to revert depending
upon machine spec and resources. If this is the case, please ensure this time
is planned for.
Model size (in bytes) is available as part of the Job Resource Model Size Stats.
////
IMPORTANT: Before you revert to a saved snapshot, you must close the job.
@ -77,7 +51,6 @@ If you want to resend data, then delete the intervening results.
You must have `manage_ml`, or `manage` cluster privileges to use this API.
For more information, see
{xpack-ref}/security-privileges.html[Security Privileges].
//<<privileges-list-cluster>>.
==== Examples

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-snapshot-resource]]
=== Model Snapshot Resources

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-start-datafeed]]
=== Start {dfeeds-cap} API
++++
@ -79,7 +80,6 @@ of the latest processed record.
You must have `manage_ml`, or `manage` cluster privileges to use this API.
For more information, see
{xpack-ref}/security-privileges.html[Security Privileges].
//<<privileges-list-cluster>>.
==== Security Integration
@ -101,7 +101,7 @@ POST _xpack/ml/datafeeds/datafeed-total-requests/_start
}
--------------------------------------------------
// CONSOLE
// TEST[setup:server_metrics_openjob]
// TEST[skip:setup:server_metrics_openjob]
When the {dfeed} starts, you receive the following results:
[source,js]
@ -110,5 +110,4 @@ When the {dfeed} starts, you receive the following results:
"started": true
}
----
// CONSOLE
// TESTRESPONSE
// TESTRESPONSE

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-stop-datafeed]]
=== Stop {dfeeds-cap} API
++++
@ -18,7 +19,6 @@ A {dfeed} can be started and stopped multiple times throughout its lifecycle.
`POST _xpack/ml/datafeeds/_all/_stop`
//TBD: Can there be spaces between the items in the list?
===== Description
@ -63,14 +63,14 @@ POST _xpack/ml/datafeeds/datafeed-total-requests/_stop
}
--------------------------------------------------
// CONSOLE
// TEST[setup:server_metrics_startdf]
// TEST[skip:setup:server_metrics_startdf]
When the {dfeed} stops, you receive the following results:
[source,js]
----
{
"stopped": true
}
----
// CONSOLE
// TESTRESPONSE
// TESTRESPONSE

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-update-datafeed]]
=== Update {dfeeds-cap} API
++++
@ -106,7 +107,7 @@ POST _xpack/ml/datafeeds/datafeed-total-requests/_update
}
--------------------------------------------------
// CONSOLE
// TEST[setup:server_metrics_datafeed]
// TEST[skip:setup:server_metrics_datafeed]
When the {dfeed} is updated, you receive the full {dfeed} configuration with
with the updated values:

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-update-filter]]
=== Update Filter API
++++
@ -52,7 +53,7 @@ POST _xpack/ml/filters/safe_domains/_update
}
--------------------------------------------------
// CONSOLE
// TEST[setup:ml_filter_safe_domains]
// TEST[skip:setup:ml_filter_safe_domains]
The API returns the following results:
@ -64,4 +65,4 @@ The API returns the following results:
"items": ["*.google.com", "*.myorg.com"]
}
----
//TESTRESPONSE
// TESTRESPONSE

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-update-job]]
=== Update Jobs API
++++
@ -121,7 +122,7 @@ POST _xpack/ml/anomaly_detectors/total-requests/_update
}
--------------------------------------------------
// CONSOLE
// TEST[setup:server_metrics_job]
// TEST[skip:setup:server_metrics_job]
When the job is updated, you receive a summary of the job configuration
information, including the updated property values. For example:
@ -177,4 +178,4 @@ information, including the updated property values. For example:
}
----
// TESTRESPONSE[s/"job_version": "7.0.0-alpha1"/"job_version": $body.job_version/]
// TESTRESPONSE[s/"create_time": 1518808660505/"create_time": $body.create_time/]
// TESTRESPONSE[s/"create_time": 1518808660505/"create_time": $body.create_time/]

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-update-snapshot]]
=== Update Model Snapshots API
++++

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-valid-detector]]
=== Validate Detectors API
++++
@ -44,6 +45,7 @@ POST _xpack/ml/anomaly_detectors/_validate/detector
}
--------------------------------------------------
// CONSOLE
// TEST[skip:needs-licence]
When the validation completes, you receive the following results:
[source,js]

View File

@ -1,4 +1,5 @@
[role="xpack"]
[testenv="platinum"]
[[ml-valid-job]]
=== Validate Jobs API
++++
@ -55,6 +56,7 @@ POST _xpack/ml/anomaly_detectors/_validate
}
--------------------------------------------------
// CONSOLE
// TEST[skip:needs-licence]
When the validation is complete, you receive the following results:
[source,js]

View File

@ -549,3 +549,9 @@ See <<security-api-has-privileges>>.
=== X-Pack commands
See <<commands>>.
[role="exclude",id="ml-api-definitions"]
=== Machine learning API definitions
See <<api-definitions>>.

View File

@ -0,0 +1,27 @@
[role="xpack"]
[[api-definitions]]
== Definitions
These resource definitions are used in {ml} and {security} APIs and in {kib}
advanced {ml} job configuration options.
* <<ml-calendar-resource,Calendars>>
* <<ml-datafeed-resource,{dfeeds-cap}>>
* <<ml-datafeed-counts,{dfeed-cap} counts>>
* <<ml-filter-resource,Filters>>
* <<ml-job-resource,Jobs>>
* <<ml-jobstats,Job statistics>>
* <<ml-snapshot-resource,Model snapshots>>
* <<ml-results-resource,Results>>
* <<role-mapping-resources,Role mappings>>
* <<ml-event-resource,Scheduled Events>>
include::{es-repo-dir}/ml/apis/calendarresource.asciidoc[]
include::{es-repo-dir}/ml/apis/datafeedresource.asciidoc[]
include::{es-repo-dir}/ml/apis/filterresource.asciidoc[]
include::{es-repo-dir}/ml/apis/jobresource.asciidoc[]
include::{es-repo-dir}/ml/apis/jobcounts.asciidoc[]
include::{es-repo-dir}/ml/apis/snapshotresource.asciidoc[]
include::{xes-repo-dir}/rest-api/security/role-mapping-resources.asciidoc[]
include::{es-repo-dir}/ml/apis/resultsresource.asciidoc[]
include::{es-repo-dir}/ml/apis/eventresource.asciidoc[]

View File

@ -22,8 +22,8 @@ include::info.asciidoc[]
include::{xes-repo-dir}/rest-api/graph/explore.asciidoc[]
include::{es-repo-dir}/licensing/index.asciidoc[]
include::{es-repo-dir}/migration/migration.asciidoc[]
include::{xes-repo-dir}/rest-api/ml-api.asciidoc[]
include::{es-repo-dir}/ml/apis/ml-api.asciidoc[]
include::{es-repo-dir}/rollup/rollup-api.asciidoc[]
include::{xes-repo-dir}/rest-api/security.asciidoc[]
include::{xes-repo-dir}/rest-api/watcher.asciidoc[]
include::{xes-repo-dir}/rest-api/defs.asciidoc[]
include::defs.asciidoc[]

View File

@ -14,17 +14,6 @@ buildRestTests.expectedUnconvertedCandidates = [
'en/security/authorization/run-as-privilege.asciidoc',
'en/security/ccs-clients-integrations/http.asciidoc',
'en/security/authorization/custom-roles-provider.asciidoc',
'en/rest-api/ml/delete-snapshot.asciidoc',
'en/rest-api/ml/get-bucket.asciidoc',
'en/rest-api/ml/get-job-stats.asciidoc',
'en/rest-api/ml/get-overall-buckets.asciidoc',
'en/rest-api/ml/get-category.asciidoc',
'en/rest-api/ml/get-record.asciidoc',
'en/rest-api/ml/get-influencer.asciidoc',
'en/rest-api/ml/get-snapshot.asciidoc',
'en/rest-api/ml/post-data.asciidoc',
'en/rest-api/ml/revert-snapshot.asciidoc',
'en/rest-api/ml/update-snapshot.asciidoc',
'en/rest-api/watcher/stats.asciidoc',
'en/watcher/example-watches/watching-time-series-data.asciidoc',
]

View File

@ -1,36 +0,0 @@
[role="xpack"]
[[ml-api-definitions]]
== Definitions
These resource definitions are used in {ml} and {security} APIs and in {kib}
advanced {ml} job configuration options.
* <<ml-calendar-resource,Calendars>>
* <<ml-datafeed-resource,{dfeeds-cap}>>
* <<ml-datafeed-counts,{dfeed-cap} counts>>
* <<ml-filter-resource,Filters>>
* <<ml-job-resource,Jobs>>
* <<ml-jobstats,Job statistics>>
* <<ml-snapshot-resource,Model snapshots>>
* <<ml-results-resource,Results>>
* <<role-mapping-resources,Role mappings>>
* <<ml-event-resource,Scheduled Events>>
[role="xpack"]
include::ml/calendarresource.asciidoc[]
[role="xpack"]
include::ml/datafeedresource.asciidoc[]
[role="xpack"]
include::ml/filterresource.asciidoc[]
[role="xpack"]
include::ml/jobresource.asciidoc[]
[role="xpack"]
include::ml/jobcounts.asciidoc[]
[role="xpack"]
include::security/role-mapping-resources.asciidoc[]
[role="xpack"]
include::ml/snapshotresource.asciidoc[]
[role="xpack"]
include::ml/resultsresource.asciidoc[]
[role="xpack"]
include::ml/eventresource.asciidoc[]