[ML] Add REST spec for the update data frame analytics endpoint (#59253) (#59281)

Closes #59148

Backport of #59253
This commit is contained in:
Dimitris Athanasiou 2020-07-09 13:12:21 +03:00 committed by GitHub
parent 1ad00d1ceb
commit d323f8d698
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 79 additions and 0 deletions

View File

@ -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
}
}
}

View File

@ -2100,3 +2100,53 @@ setup:
"includes": ["excluded"] "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"
}