Another attempt, without accepting gzip:
❯ curl 'http://nas.fritz.box:5601/api/saved_objects/bulk_get' \
> -XPOST \
> -H 'Referer: http://nas.fritz.box:5601/app/kibana' \
> -H 'Content-Type: application/json;charset=UTF-8' \
> -H 'Origin: http://nas.fritz.box:5601' \
> -H 'Host: nas.fritz.box:5601' \
> -H 'Accept: application/json, text/plain, */*' \
> -H 'Connection: keep-alive' \
> -H 'Content-Length: 70' \
> -H 'kbn-version: 6.0.0' \
> --data-binary '[{"id":"590a60f0-5d87-11e7-8884-1bb4c3b890e4","type":"visualization"}]'
{"saved_objects":[{"id":"590a60f0-5d87-11e7-8884-1bb4c3b890e4","type":"visualization","version":3,"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\n \"index\": \"metricbeat-*\",\n \"query\": {\n \"query_string\": {\n \"query\": \"*\",\n \"analyze_wildcard\": true\n }\n },\n \"filter\": []\n}"},"title":"Number of processes [Metricbeat System]","uiStateJSON":"{\n \"vis\": {\n \"defaultColors\": {\n \"0 - 100\": \"rgb(0,104,55)\"\n }\n }\n}","version":1,"visState":"{\n \"title\": \"Number of processes\",\n \"type\": \"metric\",\n \"params\": {\n \"addLegend\": false,\n \"addTooltip\": true,\n \"gauge\": {\n \"autoExtend\": false,\n \"backStyle\": \"Full\",\n \"colorSchema\": \"Green to Red\",\n \"colorsRange\": [\n {\n \"from\": 0,\n \"to\": 100\n }\n ],\n \"gaugeColorMode\": \"None\",\n \"gaugeStyle\": \"Full\",\n \"gaugeType\": \"Metric\",\n \"invertColors\": false,\n \"labels\": {\n \"color\": \"black\",\n \"show\": true\n },\n \"orientation\": \"vertical\",\n \"percentageMode\": false,\n \"scale\": {\n \"color\": \"#333\",\n \"labels\": false,\n \"show\": false,\n \"width\": 2\n },\n \"style\": {\n \"bgColor\": false,\n \"bgFill\": \"#000\",\n \"fontSize\": 60,\n \"labelColor\": false,\n \"subText\": \"\"\n },\n \"type\": \"simple\",\n \"useRange\": false,\n \"verticalSplit\":false\n },\n \"type\": \"gauge\"\n },\n \"aggs\": [\n {\n \"id\": \"1\",\n \"enabled\": true,\n \"type\": \"cardinality\",\n \"schema\": \"metric\",\n \"params\": {\n \"field\": \"system.process.pid\",\n \"customLabel\": \"Processes\"\n }\n }\n ],\n \"listeners\": {}\n}"}}]}
❯ curl 'http://nas.fritz.box:5601/api/saved_objects/bulk_get' \
> -XPOST \
> -H 'Referer: http://nas.fritz.box:5601/app/kibana' \
> -H 'Content-Type: application/json;charset=UTF-8' \
> -H 'Origin: http://nas.fritz.box:5601' \
> -H 'Host: nas.fritz.box:5601' \
> -H 'Accept: application/json, text/plain, */*' \
> -H 'Connection: keep-alive' \
> -H 'Content-Length: 46' \
> -H 'kbn-version: 6.0.0' \
> --data-binary '[{"id":"metricbeat-*","type":"index-pattern"}]'
{"saved_objects":[{"id":"metricbeat-*","type":"index-pattern","error":{"statusCode":404,"message":"Not found"}}]}
I don't get why it doesn't see the index-pattern that the other visualizations are happy with???
And last but not least there is also:
GET /api/_search?q=*
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "api",
"_type": "saved_objects",
"_id": "bulk_get",
"_score": 1,
"_source": {
"id": "metricbeat-*",
"type": "index-pattern"
}
}
]
}
}