2017-04-11 21:52:47 -04:00
//lcawley Verified example output 2017-04-11
2017-04-04 18:26:39 -04:00
[[ml-update-job]]
==== Update Jobs
The update job API allows you to update certain properties of a job.
===== Request
`POST _xpack/ml/anomaly_detectors/<job_id>/_update`
2017-04-18 18:13:21 -04:00
2017-04-04 18:26:39 -04:00
===== Description
2017-04-18 18:13:21 -04:00
You must have `manage_ml`, or `manage` cluster privileges to use this API.
For more information, see <<privileges-list-cluster>>.
//TBD: Important:: Updates do not take effect until after then job is closed and new data is sent to it.
2017-04-04 18:26:39 -04:00
===== Path Parameters
`job_id` (required)::
2017-04-11 22:26:18 -04:00
(string) Identifier for the job
2017-04-04 18:26:39 -04:00
===== Request Body
The following properties can be updated after the job is created:
`analysis_config`::
2017-04-11 22:26:18 -04:00
(object) The analysis configuration, which specifies how to analyze the data.
2017-04-04 18:26:39 -04:00
See <<ml-analysisconfig, analysis configuration objects>>. In particular, the following properties can be updated: `categorization_filters`, `detector_description`, TBD.
`analysis_limits`::
2017-04-11 22:26:18 -04:00
(object) Specifies runtime limits for the job.
2017-04-06 10:56:46 -04:00
See <<ml-apilimits,analysis limits>>. NOTE:
* You can update the `analysis_limits` only while the job is closed.
* The `model_memory_limit` property value cannot be decreased.
* If the `memory_status` property in the `model_size_stats` object has a value of `hard_limit`,
increasing the `model_memory_limit` is not recommended.
2017-04-04 18:26:39 -04:00
`description`::
2017-04-11 22:26:18 -04:00
(string) An optional description of the job.
2017-04-04 18:26:39 -04:00
////
This expects data to be sent in JSON format using the POST `_data` API.
===== Responses
TBD
////
////
200
(EmptyResponse) The cluster has been successfully deleted
404
(BasicFailedReply) The cluster specified by {cluster_id} cannot be found (code: clusters.cluster_not_found)
412
(BasicFailedReply) The Elasticsearch cluster has not been shutdown yet (code: clusters.cluster_plan_state_error)
////
===== Examples
The following example updates the `it-ops-kpi` job:
[source,js]
--------------------------------------------------
2017-04-11 21:52:47 -04:00
POST _xpack/ml/anomaly_detectors/it-ops-kpi/_update
2017-04-04 18:26:39 -04:00
{
"description":"New description",
"analysis_limits":{
"model_memory_limit": 8192
}
}
--------------------------------------------------
// CONSOLE
// TEST[skip:todo]
When the job is updated, you receive the following results:
2017-04-21 11:23:27 -04:00
[source,js]
2017-04-04 18:26:39 -04:00
----
{
"job_id": "it-ops-kpi",
2017-04-11 21:52:47 -04:00
"job_type": "anomaly_detector",
2017-04-04 18:26:39 -04:00
"description": "New description",
...
"analysis_limits": {
"model_memory_limit": 8192
2017-04-11 21:52:47 -04:00
},
2017-04-04 18:26:39 -04:00
...
}
----