Skip to content

Commit

Permalink
[ML] Add REST spec for the update data frame analytics endpoint (#59253
Browse files Browse the repository at this point in the history
…) (#59281)

Closes #59148

Backport of #59253
  • Loading branch information
dimitris-athanasiou authored Jul 9, 2020
1 parent 1ad00d1 commit d323f8d
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit d323f8d

Please sign in to comment.