Sorry, I didn't realize you are using Kibana 4.0.3.
In newer versions of Kibana, 4.1+, there is an index for Kibana that stores all of the saved objects. So if you had Kibana 4.5 and the Sense plugin, you could do something like:
GET .kibana/visualization/_search
And you'd see result documents that look like (this is one generated by Beats Dashboard creator):
{
"_index": ".kibana",
"_type": "visualization",
"_id": "Servers",
"_score": 1,
"_source": {
"visState": "{\"type\":\"table\",\"params\":{\"perPage\":10,\"showPartialRows\":false,\"showMeticsAtAllLevels\":false},\"aggs\":[{\"id\":\"1\",\"type\":\"avg\",\"schema\":\"metric\",\"params\":{\"field\":\"cpu.user_p\"}},{\"id\":\"3\",\"type\":\"avg\",\"schema\":\"metric\",\"params\":{\"field\":\"cpu.system_p\"}},{\"id\":\"4\",\"type\":\"max\",\"schema\":\"metric\",\"params\":{\"field\":\"mem.total\"}},{\"id\":\"5\",\"type\":\"max\",\"schema\":\"metric\",\"params\":{\"field\":\"mem.used\"}},{\"id\":\"8\",\"type\":\"max\",\"schema\":\"metric\",\"params\":{\"field\":\"mem.used_p\"}},{\"id\":\"6\",\"type\":\"max\",\"schema\":\"metric\",\"params\":{\"field\":\"mem.free\"}},{\"id\":\"9\",\"type\":\"terms\",\"schema\":\"bucket\",\"params\":{\"field\":\"beat.name\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\"}}],\"listeners\":{}}",
"description": "",
"title": "Servers",
"version": 1,
"savedSearchId": "System-stats",
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[]}"
}
}
}
So if you could programatically create those kind of documents yourself, and index them into the .kibana
index.
But I am not sure exactly how this could be done in Kibana 4.0.x. It must have some method of storing saved objects in an Elasticsearch index.