[DOCS] Enable code snippet testing in open job API (elastic/x-pack-elasticsearch#3053)

* [DOCS] Enable code snippet testing in open job API

* [DOCS] Fixed open job API example

Original commit: elastic/x-pack-elasticsearch@f789041c2a
This commit is contained in:
Lisa Cawley 2017-11-28 08:26:58 -08:00 committed by GitHub
parent ac01962a62
commit b6f322e72e
2 changed files with 6 additions and 7 deletions

View File

@ -74,7 +74,6 @@ buildRestTests.expectedUnconvertedCandidates = [
'en/rest-api/ml/get-datafeed-stats.asciidoc',
'en/rest-api/ml/get-job-stats.asciidoc',
'en/rest-api/ml/get-record.asciidoc',
'en/rest-api/ml/open-job.asciidoc',
'en/rest-api/ml/preview-datafeed.asciidoc',
'en/rest-api/ml/update-datafeed.asciidoc',
'en/rest-api/ml/update-job.asciidoc',

View File

@ -13,8 +13,6 @@ A job can be opened and closed multiple times throughout its lifecycle.
==== Description
A job must be open in order to it to accept and analyze data.
When you open a new job, it starts with an empty model.
When you open an existing job, the most recent model state is automatically loaded.
@ -39,22 +37,22 @@ The job is ready to resume its analysis from where it left off, once new data is
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
The following example opens the `event_rate` job and sets an optional property:
The following example opens the `total-requests` job and sets an optional
property:
[source,js]
--------------------------------------------------
POST _xpack/ml/anomaly_detectors/event_rate/_open
POST _xpack/ml/anomaly_detectors/total-requests/_open
{
"timeout": "35m"
}
--------------------------------------------------
// CONSOLE
// TEST[skip:todo]
// TEST[setup:server_metrics_job]
When the job opens, you receive the following results:
[source,js]
@ -63,3 +61,5 @@ When the job opens, you receive the following results:
"opened": true
}
----
//CONSOLE
// TESTRESPONSE