Elasticsearch has a Saved Objects API and it is in their documentation, but I can’t find it in the Opensearch documentation. I’ve tried the “curl -XPOST -k http:// localhost:5601/api/saved_objects/_export” kind of commands but it does not work. Has it been deprecated? If not, how do I access it?
@curlquest This worked for me with OpenSearch Dashboards 2.15.0
curl --insecure -X POST "https://localhost:5601/api/saved_objects/_export" -H "osd-xsrf: true" -H "Content-Type: application/json" -u admin:Eliatra123 -d'
{
"type": ["index-pattern", "search", "visualization", "dashboard"]
}'
I’m getting “{“error”:“no handler found for uri [/api/saved_objects/_export] and method [POST]”}” as a response. I wonder if I don’t have something installed? It’s an Opensearch instance made from AWS.
@curlquest I’ve tested against standalone OpenSearch Dashboards deployment. If you have issues with managed AWS service then you should contact their support.
I executed following command but I was able to export only 4 objects. However there were 56 objects in total when I made the request via browser
curl --insecure -X POST "https://192.168.0.81:5601/api/saved_objects/_export" -H "osd-xsrf: true" -H "Content-Type: application/json" -u admin:opensearch -d'
{
"type": "index-pattern"
}'
How to resolve it to fetch all the saved objects. I have basically 56 index patterns saved and I want to export them
@Iqra_shafiq Do you mean 56 index pattern objects?
yes