是否有 kibana rest API 来获取和设置 space 的默认路由?
Is there a kibana rest API to get and set default-route of a space?
我需要以编程方式检索和设置 kibana 的默认路由 space。在 Kibana 应用程序上,这可以在 堆栈管理 -> 高级设置 页面进行设置。我查看了 elasticsearch REST documentation,但找不到合适的 API。感谢任何帮助。
不确定您指的是哪个版本。但是原post中的文档link指向7.13。以下建议(来自 https://discuss.elastic.co/t/kibana-7-5-server-defaultroute-parameter/212191/4)适用于 7.13:
these advanced settings are stored as a Saved Object of type config
. So you can update them using the Saved Object APIs
所以这就是我如何使用 API 到 'set' 和 'retrieve' 进出我的 space:
的 defaultRoute
$ curl --user elastic:******* -X PUT "localhost:${ES_KB_PORT}/s/${my_space}/api/saved_objects/config/7.13.2" -H "kbn-xsrf: true" -H "Content-Type: application/json" -d '{"attributes": {"defaultRoute": "/app/dashboards#/view/285828e0-b713-11eb-aba9-211e5623385d"}}'
{"id":"7.13.2","type":"config","updated_at":"2021-08-02T08:53:19.824Z","version":"WzEzOTksMl0=","namespaces":["mz81"],"attributes":{"defaultRoute":"/app/dashboards#/view/285828e0-b713-11eb-aba9-211e5623385d"}}
$ curl --user elastic:******* -X POST "localhost:${ES_KB_PORT}/s/${my_space}/api/saved_objects/_export" -H "kbn-xsrf: true" -H "Content-Type: application/json" -d '{"type": "config"}'
{"attributes":{"buildNum":40943,"defaultRoute":"/app/dashboards#/view/285828e0-b713-11eb-aba9-211e5623385d"},"coreMigrationVersion":"7.13.2","id":"7.13.2","migrationVersion":{"config":"7.13.0"},"references":[],"sort":[1627896123137,107],"type":"config","updated_at":"2021-08-02T09:22:03.137Z","version":"WzE0MDYsMl0="}
{"exportedCount":1,"missingRefCount":0,"missingReferences":[]}
我需要以编程方式检索和设置 kibana 的默认路由 space。在 Kibana 应用程序上,这可以在 堆栈管理 -> 高级设置 页面进行设置。我查看了 elasticsearch REST documentation,但找不到合适的 API。感谢任何帮助。
不确定您指的是哪个版本。但是原post中的文档link指向7.13。以下建议(来自 https://discuss.elastic.co/t/kibana-7-5-server-defaultroute-parameter/212191/4)适用于 7.13:
these advanced settings are stored as a Saved Object of type
config
. So you can update them using the Saved Object APIs
所以这就是我如何使用 API 到 'set' 和 'retrieve' 进出我的 space:
的 defaultRoute$ curl --user elastic:******* -X PUT "localhost:${ES_KB_PORT}/s/${my_space}/api/saved_objects/config/7.13.2" -H "kbn-xsrf: true" -H "Content-Type: application/json" -d '{"attributes": {"defaultRoute": "/app/dashboards#/view/285828e0-b713-11eb-aba9-211e5623385d"}}'
{"id":"7.13.2","type":"config","updated_at":"2021-08-02T08:53:19.824Z","version":"WzEzOTksMl0=","namespaces":["mz81"],"attributes":{"defaultRoute":"/app/dashboards#/view/285828e0-b713-11eb-aba9-211e5623385d"}}
$ curl --user elastic:******* -X POST "localhost:${ES_KB_PORT}/s/${my_space}/api/saved_objects/_export" -H "kbn-xsrf: true" -H "Content-Type: application/json" -d '{"type": "config"}'
{"attributes":{"buildNum":40943,"defaultRoute":"/app/dashboards#/view/285828e0-b713-11eb-aba9-211e5623385d"},"coreMigrationVersion":"7.13.2","id":"7.13.2","migrationVersion":{"config":"7.13.0"},"references":[],"sort":[1627896123137,107],"type":"config","updated_at":"2021-08-02T09:22:03.137Z","version":"WzE0MDYsMl0="}
{"exportedCount":1,"missingRefCount":0,"missingReferences":[]}