API call for ML job Kibana settings

Hi,

I am creating datafeeds and ML jobs via API calls and they are working just fine, but I always have to open Kibana and select Synchronize saved objects if I want them to show up in the UI.
Is there a way to do the same programmatically via API call?

Also, I have just discovered that ML jobs supports Kibana Spaces. How can I select the spaces for each job via API?

Thank you!

Hi,

Saved objects can be synchronized via a Kibana API:
GET <KIBANA_SERVER>/api/ml/saved_objects/sync
Adding the argument ?simulate=true to the end will show you what the endpoint will do before doing it.

To assign an initial space to a job, you can call that sync endpoint with a space in the path. e.g.
GET <KIBANA_SERVER>/s/<SPACE_NAME>/api/ml/saved_objects/sync
This will create the saved objects and assign the job to that space.

To assign a job to multiple spaces or to change the current job's space after the initial sync, I'd recommend using the UI.

I hope this is helpful.

Cheers,
James

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.