A newer version is available. For the latest information, see the
current release documentation.
Sync machine learning saved objects APIedit
Synchronizes Kibana saved objects for machine learning jobs.
Requestedit
GET <kibana host>:<port>/api/ml/saved_objects/sync
GET <kibana host>:<port>/s/<space_id>/api/ml/saved_objects/sync
Path parametersedit
-
space_id
-
(Optional, string) An identifier for the space. If
space_id
is not provided in the URL the default space is used.
Query parametersedit
-
simulate
-
(Optional, boolean) When
true
, simulates the synchronization by only returning the list actions that would be performed.
Response bodyedit
-
datafeedsAdded
- (array) If a saved object for an anomaly detection job is missing a datafeed identifier, it is added. This list contains the datafeed identifiers and indicates whether the synchronization was successful.
-
datafeedsRemoved
- (array) If saved objects exist for datafeeds that no longer exist, they are deleted. This list contains the datafeed identifiers and indicates whether the synchronization was successful.
-
savedObjectsCreated
- (array) If saved objects are missing for machine learning jobs, they are created. This list contains the job identifiers and indicates whether the synchronization was successful.
-
savedObjectsDeleted
- (array) If saved objects exist for jobs that no longer exist, they are deleted. This list contains the job identifiers and indicates whether the synchronization was successful.
Response codeedit
-
200
- Indicates a successful call.
Exampleedit
Retrieve the list of machine learning saved objects that require synchronization:
$ curl -X GET api/ml/saved_objects/sync?simulate=true
If there are two jobs and a datafeed that need to be synchronized, for example, the API returns the following:
{{"savedObjectsCreated":{"myjob1":{"success":true},"myjob2":{"success":true}},"savedObjectsDeleted":{},"datafeedsAdded":{},"datafeedsRemoved":{"myfeed3":{"success":true}}}
To perform the synchronization, re-run the API and omit the simulate
parameter.