diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_data_frame_analytics.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_data_frame_analytics.json new file mode 100644 index 00000000000..9086a655833 --- /dev/null +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_data_frame_analytics.json @@ -0,0 +1,29 @@ +{ + "ml.update_data_frame_analytics":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/update-dfanalytics.html", + "description":"Updates certain properties of a data frame analytics job." + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_ml/data_frame/analytics/{id}/_update", + "methods":[ + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The ID of the data frame analytics to update" + } + } + } + ] + }, + "body":{ + "description":"The data frame analytics settings to update", + "required":true + } + } +} diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/test/ml/data_frame_analytics_crud.yml b/x-pack/plugin/src/test/resources/rest-api-spec/test/ml/data_frame_analytics_crud.yml index 43d20cc02b3..9922f721255 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/test/ml/data_frame_analytics_crud.yml +++ b/x-pack/plugin/src/test/resources/rest-api-spec/test/ml/data_frame_analytics_crud.yml @@ -2100,3 +2100,53 @@ setup: "includes": ["excluded"] } } + +--- +"Test update given all updatable settings": + + - do: + ml.put_data_frame_analytics: + id: "update-test-job" + body: > + { + "source": { + "index": "index-source" + }, + "dest": { + "index": "index-dest" + }, + "analysis": {"outlier_detection":{}}, + "description": "before update", + "model_memory_limit": "20mb", + "allow_lazy_start": false + } + - match: { id: "update-test-job" } + - match: { description: "before update" } + - match: { model_memory_limit: "20mb" } + - match: { allow_lazy_start: false } + + - do: + ml.update_data_frame_analytics: + id: "update-test-job" + body: > + { + "description": "after update", + "model_memory_limit": "30mb", + "allow_lazy_start": true + } + - match: { id: "update-test-job" } + - match: { description: "after update" } + - match: { model_memory_limit: "30mb" } + - match: { allow_lazy_start: true } + +--- +"Test update given missing analytics": + + - do: + catch: missing + ml.update_data_frame_analytics: + id: "missing-analytics" + body: > + { + "description": "blah" + }