//lcawley Verified example output 2017-04-11
[[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`


===== Description

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 re-opened.

===== Path Parameters

`job_id` (required)::
  (string) Identifier for the job

===== Request Body

The following properties can be updated after the job is created:

`analysis_config`::
  (object) The analysis configuration, which specifies how to analyze the data.
  See <<ml-analysisconfig, analysis configuration objects>>.  In particular, the following properties can be updated: `categorization_filters`, `detector_description`, TBD.

`analysis_limits`::
  (object) Specifies runtime limits for the job.
  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`,
  this means that it was unable to process some data. You may wish to re-run this job
  with an increased `model_memory_limit`. 

`description`::
  (string) An optional description of the job.

////
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]
--------------------------------------------------
POST _xpack/ml/anomaly_detectors/it-ops-kpi/_update
{
    "description":"New description",
    "analysis_limits":{
      "model_memory_limit": 8192
    }
}
--------------------------------------------------
// CONSOLE
// TEST[skip:todo]

When the job is updated, you receive the following results:
[source,js]
----
{
  "job_id": "it-ops-kpi",
  "job_type": "anomaly_detector",
  "description": "New description",
  ...
  "analysis_limits": {
    "model_memory_limit": 8192
  },
  ...
}
----
