elasticsearch/docs/reference/ml/anomaly-detection/apis/ml-apis.asciidoc
Dimitris Athanasiou dc61a72c9e
[ML] Reset anomaly detection job API (#73908)
Adds a new API that allows a user to reset
an anomaly detection job.

To use the API do:

```
POST _ml/anomaly_detectors/<job_id>_reset
```

The API removes all data associated to the job.
In particular, it deletes model state, results and stats.

However, job notifications and user annotations are not removed.

Also, the API can be called asynchronously by setting the parameter
`wait_for_completion` to `false` (defaults to `true`). When run
that way the API returns the task id for further monitoring.

In order to prevent the job from opening while it is resetting,
a new job field has been added called `blocked`. It is an object
that contains a `reason` and the `task_id`. `reason` can take
a value from ["delete", "reset", "revert"] as all these
operations should block the job from opening. The `task_id` is also
included in order to allow tracking the task if necessary.

Finally, this commit also sets the `blocked` field when
the revert snapshot API is called as a job should not be opened
while it is reverted to a different model snapshot.
2021-06-14 18:56:28 +03:00

89 lines
2.7 KiB
Text

[role="xpack"]
[testenv="platinum"]
[[ml-apis]]
= {ml-cap} {anomaly-detect} APIs
You can use the following APIs to perform {ml} {anomaly-detect} activities.
See also <<ml-df-analytics-apis>>.
[discrete]
[[ml-api-anomaly-job-endpoint]]
== {anomaly-jobs-cap}
//* <<ml-valid-detector,Validate detectors>>, <<ml-valid-job,Validate job>>
* <<ml-put-job,Create>> or <<ml-delete-job,delete {anomaly-jobs}>>
* <<ml-put-calendar-job,Add>> or <<ml-delete-calendar-job,delete a {anomaly-job} from a calendar>>
* <<ml-open-job,Open>> or <<ml-close-job,close {anomaly-jobs}>>
* <<ml-get-job,Get {anomaly-jobs} info>> or <<ml-get-job-stats,statistics>>
* <<ml-flush-job,Flush {anomaly-jobs}>>
* <<ml-post-data,Post data to {anomaly-jobs}>>
* <<ml-update-job,Update {anomaly-jobs}>>
* <<ml-forecast,Create>> or <<ml-delete-forecast,delete forecasts>>
* <<ml-reset-job,Reset {anomaly-jobs}>>
[discrete]
[[ml-api-calendar-endpoint]]
== Calendars
* <<ml-put-calendar,Create calendar>>, <<ml-delete-calendar,Delete calendar>>
* <<ml-put-calendar-job,Add job to calendar>>, <<ml-delete-calendar-job,Delete job from calendar>>
* <<ml-post-calendar-event,Add scheduled events to calendar>>, <<ml-delete-calendar-event,Delete scheduled events from calendar>>
* <<ml-get-calendar,Get calendars>>, <<ml-get-calendar-event,Get scheduled events>>
[discrete]
[[ml-api-filter-endpoint]]
== Filters
* <<ml-put-filter,Create filter>>, <<ml-delete-filter,Delete filter>>
* <<ml-update-filter,Update filters>>
* <<ml-get-filter,Get filters>>
[discrete]
[[ml-api-datafeed-endpoint]]
== {dfeeds-cap}
* <<ml-put-datafeed,Create {dfeed}>>, <<ml-delete-datafeed,Delete {dfeed}>>
* <<ml-start-datafeed,Start {dfeed}>>, <<ml-stop-datafeed,Stop {dfeed}>>
* <<ml-get-datafeed,Get {dfeed} info>>, <<ml-get-datafeed-stats,Get {dfeed} statistics>>
* <<ml-preview-datafeed,Preview {dfeed}>>
* <<ml-update-datafeed,Update {dfeed}>>
[discrete]
[[ml-api-snapshot-endpoint]]
== Model snapshots
* <<ml-delete-snapshot,Delete model snapshot>>
* <<ml-get-snapshot,Get model snapshot info>>
* <<ml-revert-snapshot,Revert model snapshot>>
* <<ml-update-snapshot,Update model snapshot>>
* <<ml-upgrade-job-model-snapshot,Upgrade model snapshot>>
[discrete]
[[ml-api-result-endpoint]]
== Results
* <<ml-get-bucket,Get buckets>>
* <<ml-get-overall-buckets,Get overall buckets>>
* <<ml-get-category,Get categories>>
* <<ml-get-influencer,Get influencers>>
* <<ml-get-record,Get records>>
[discrete]
[[ml-api-ml-info-endpoint]]
== Info
* <<get-ml-info,Machine learning info>>
[discrete]
[[ml-api-delete-expired-data-endpoint]]
== Delete expired data
* <<ml-delete-expired-data,Delete expired data>>
[discrete]
[[ml-set-upgrade-mode-endpoint]]
== Set upgrade mode
* <<ml-set-upgrade-mode, Set upgrade mode>>