I am trying to build dynamic dashboards of Kibana through my own web application. I have succeeded to create new visualizations dynamically with user-defined params using the Kibana API Plugin by Webiks.
The problem I am hitting is after I create these visualizations, and try to save it through the REST call to Kibana saved objects, the browser tab gets stuck and become completely unresponsive. This problem occurs only after trying to save the second visualization. The first visualization gets saved to the Dashboard easily.
As the browser gets stuck there, I am not being able to see any logs in the console as well.
Kibana API Endpoint:
POST localhost:5601/api/saved_objects/dashboard/${dashboard.id}?overwrite=true
and in this call, I send the dashboard attributes object.
Strange, I'm seeing the same thing locally in master too. I tried to add all the various headers to the request that Kibana uses, but no luck, the request never completes. Seems like a bug though, the server should respond with something. I encourage you to open an issue about it on the Kibana issue tracker.
EDIT: Actually, I think it was a problem in the software I was using... it works when I just use curl. I get an error saying I need to add the kbn-xsrf header, and when I do that, it works.
Maybe there's a bug in that kibana-API library you're using?
Okay, I figured it out.
The problem was with the object visualization object. I was sending the following object in the body of the REST call, previously: { id: "abc", type: 'visualization' }
oblivious to the fact that grid data is also a somewhat necessary object to save visualization within the dashboard.
I have now updated the object as follows and it's working perfectly fine now.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.