Can we use Kibana REST API's to create the dashboards Programmatically in OpenSearchDashboard

Hi Team,

can we use Kibana REST API’s to create the dashboards Programmatically in OpenSearchDashboard…

Can you please share me any reference to go through the Kibana REST API’s…

Thanks,
Hema

Thanks,
Hema

Anything that you previously used in the Kibana API, you can use in OpenSearch Dashboards. I think the documentation team is working on getting the OpenSearch Dashboards API covered, but the OpenSearch API is priority.

Some of the plugins have undocumented APIs, but that’s just because they aren’t finalized when the OpenSearch project inherited them from Open Distro. Moving forward, there is an effort to be more systematic about making all APIs public.

ThankYou for your inputs…

Can you please point me to the location/reference code to go through the OpenSearhcDashboard API’s … Because i was not able to find in any place… It will be more helpful if you provide those details…

Just want to make more clear : My requirement is : I was trying to create the Dashboards programetically in OpenSearchDashborad using Python language… So i was looking for the Python REST API’s to do this…

Thanks…
Hema

Is this what you are after?

We use a CURL command to programmatically create visualisations and dashboards

curl -X POST \\
     -H "osd-xsrf: true" \\
     -H "securitytenant: $tenant" \\
     "http://$USERNAME:$PASSWORD@host:5601/api/saved_objects/_import?overwrite=true" \\
     --form file=@data.ndjson

Thanks Jong…

Hope this for import dashboard na…

Yes similar to this i was looking for the curl command to create the visualization and dashboard…

If possible can you please point me to the OpenSearhcDashboard API to create the dashboard so that we can call that API directly from code and create the dashboard…

Thanks,
Hema

I believe you want Create saved objects API | Kibana Guide [8.4] | Elastic

If you use your browser’s developer tools to watch the HTTP requests that are being fired when you save a dashboard using Kibana you will see exactly what API call you need to make to programmatically create these.

Or alternatively use the saved_objects/_import route to create multiple visualisations and dashboards all in one.

Thanks Jong…

Will try it out and let you know if any help required…

Thank You so Much…

Thanks,
Hema

I encountered a similar issue. I am trying to create an index pattern when my OpenSearch docker stack is created. I attempted to use the curl instructions listed above. Unfortunately, my index pattern was not created. I have posted a summary of my issue on StackOverflow.