From cd4021274ae1c98a5d0d29a2e1b0155f3d8090ff Mon Sep 17 00:00:00 2001 From: lcawl Date: Mon, 8 Jul 2019 11:43:18 -0700 Subject: [PATCH] [DOCS] Enables testing for create job ML API (#44022) --- docs/reference/ml/apis/ml-api.asciidoc | 49 ++++++++++--------- docs/reference/ml/apis/put-job.asciidoc | 63 +++++++++++++------------ 2 files changed, 60 insertions(+), 52 deletions(-) diff --git a/docs/reference/ml/apis/ml-api.asciidoc b/docs/reference/ml/apis/ml-api.asciidoc index 54a7b4e60c1..f4da1143735 100644 --- a/docs/reference/ml/apis/ml-api.asciidoc +++ b/docs/reference/ml/apis/ml-api.asciidoc @@ -7,7 +7,21 @@ You can use the following APIs to perform {ml} activities. See <> for the resource definitions used by the machine learning APIs and in advanced job configuration options in Kibana. -[float] +[discrete] +[[ml-api-anomaly-job-endpoint]] +=== {anomaly-jobs-cap} +//* <>, <> +* <> or <> +* <> or <> +* <> or <> +* <> or <> +* <> +* <> +* <> +* <> or <> + + +[discrete] [[ml-api-calendar-endpoint]] === Calendars @@ -16,7 +30,7 @@ machine learning APIs and in advanced job configuration options in Kibana. * <>, <> * <>, <> -[float] +[discrete] [[ml-api-filter-endpoint]] === Filters @@ -24,7 +38,7 @@ machine learning APIs and in advanced job configuration options in Kibana. * <> * <> -[float] +[discrete] [[ml-api-datafeed-endpoint]] === {dfeeds-cap} @@ -34,7 +48,7 @@ machine learning APIs and in advanced job configuration options in Kibana. * <> * <> -[float] +[discrete] [[ml-api-dfanalytics-endpoint]] === {dfanalytics-cap} APIs @@ -45,21 +59,14 @@ machine learning APIs and in advanced job configuration options in Kibana. * <> or <> * <> -[float] + +[discrete] [[ml-api-job-endpoint]] === Jobs -//* <>, <> -* <>, <> -* <>, <> -* <>, <> -* <>, <> -* <> -* <> -* <> -* <>, <> +See <> and <>. -[float] +[discrete] [[ml-api-snapshot-endpoint]] === Model Snapshots @@ -69,7 +76,7 @@ machine learning APIs and in advanced job configuration options in Kibana. * <> -[float] +[discrete] [[ml-api-result-endpoint]] === Results @@ -79,25 +86,25 @@ machine learning APIs and in advanced job configuration options in Kibana. * <> * <> -[float] +[discrete] [[ml-api-file-structure-endpoint]] === File structure * <> -[float] +[discrete] [[ml-api-ml-info-endpoint]] === Info * <> -[float] +[discrete] [[ml-api-delete-expired-data-endpoint]] === Delete expired data * <> -[float] +[discrete] [[ml-set-upgrade-mode-endpoint]] === Set upgrade mode @@ -109,10 +116,10 @@ include::put-calendar-job.asciidoc[] //CLOSE include::close-job.asciidoc[] //CREATE +include::put-job.asciidoc[] include::put-calendar.asciidoc[] include::put-datafeed.asciidoc[] include::put-filter.asciidoc[] -include::put-job.asciidoc[] include::put-dfanalytics.asciidoc[] //DELETE include::delete-calendar.asciidoc[] diff --git a/docs/reference/ml/apis/put-job.asciidoc b/docs/reference/ml/apis/put-job.asciidoc index c60de488180..11903e7fe18 100644 --- a/docs/reference/ml/apis/put-job.asciidoc +++ b/docs/reference/ml/apis/put-job.asciidoc @@ -1,12 +1,14 @@ [role="xpack"] [testenv="platinum"] [[ml-put-job]] -=== Create jobs API +=== Create {anomaly-jobs} API + +[subs="attributes"] ++++ -Create jobs +Create {anomaly-jobs} ++++ -Instantiates a job. +Instantiates an {anomaly-job}. [[ml-put-job-request]] ==== {api-request-title} @@ -23,10 +25,10 @@ Instantiates a job. [[ml-put-job-desc]] ==== {api-description-title} -IMPORTANT: You must use {kib} or this API to create a {ml} job. Do not put a job - directly to the `.ml-config` index using the Elasticsearch index API. - If {es} {security-features} are enabled, do not give users `write` - privileges on the `.ml-config` index. +IMPORTANT: You must use {kib} or this API to create an {anomaly-job}. Do not put +a job directly to the `.ml-config` index using the {es} index API. If {es} +{security-features} are enabled, do not give users `write` privileges on the +`.ml-config` index. [[ml-put-job-path-parms]] ==== {api-path-parms-title} @@ -114,40 +116,39 @@ PUT _ml/anomaly_detectors/total-requests } -------------------------------------------------- // CONSOLE -// TEST[skip:need-licence] When the job is created, you receive the following results: [source,js] ---- { - "job_id": "total-requests", - "job_type": "anomaly_detector", - "job_version": "7.0.0-alpha1", - "description": "Total sum of requests", - "create_time": 1517011406091, - "analysis_config": { - "bucket_span": "10m", - "detectors": [ + "job_id" : "total-requests", + "job_type" : "anomaly_detector", + "job_version" : "7.4.0", + "description" : "Total sum of requests", + "create_time" : 1562352500629, + "analysis_config" : { + "bucket_span" : "10m", + "detectors" : [ { - "detector_description": "Sum of total", - "function": "sum", - "field_name": "total", - "detector_index": 0 + "detector_description" : "Sum of total", + "function" : "sum", + "field_name" : "total", + "detector_index" : 0 } ], - "influencers": [] + "influencers" : [ ] }, - "analysis_limits": { - "model_memory_limit": "1024mb", - "categorization_examples_limit": 4 + "analysis_limits" : { + "model_memory_limit" : "1024mb", + "categorization_examples_limit" : 4 }, - "data_description": { - "time_field": "timestamp", - "time_format": "epoch_ms" + "data_description" : { + "time_field" : "timestamp", + "time_format" : "epoch_ms" }, - "model_snapshot_retention_days": 1, - "results_index_name": "shared" + "model_snapshot_retention_days" : 1, + "results_index_name" : "shared" } ---- -// TESTRESPONSE[s/"job_version": "7.0.0-alpha1"/"job_version": $body.job_version/] -// TESTRESPONSE[s/"create_time": 1517011406091/"create_time": $body.create_time/] +// TESTRESPONSE[s/"job_version" : "7.4.0"/"job_version" : $body.job_version/] +// TESTRESPONSE[s/1562352500629/$body.$_path/]