1. 新建workspace
kibana
curl
curl --location --request POST 'http://localhost:5601/api/spaces/space' \
--header 'kbn-xsrf: true' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "test",
"id": "test",
"description": "测试",
"disabledFeatures": [
"discover",
"visualize",
"dev_tools",
"advancedSettings",
"indexPatterns",
"savedObjectsManagement",
"graph",
"monitoring",
"ml",
"apm",
"maps",
"canvas",
"infrastructure",
"logs",
"siem",
"uptime"
]
}'
其中disabledFeatures即在该工作区不显示功能。
2. 新建角色
kibana
curl
curl --location --request PUT 'http://localhost:5601/api/security/role/test' \
--header 'kbn-xsrf: true' \
--header 'Content-Type: application/json' \
--data-raw '{
"elasticsearch": {
"cluster": [
"all"
],
"indices": [
{
"names": [
"*"
],
"privileges": [
"read"
],
"field_security": {
"grant": [
"*"
],
"except": []
}
}
],
"run_as": []
},
"kibana": [
{
"spaces": [
"test"
],
"base": [],
"feature": {
"dashboard": [
"read"
]
}
}
]
}'
3. 新建用户
kibana
curl
curl --location --request POST 'http://localhost:5601/internal/security/users/test' \
--header 'kbn-xsrf: true' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "",
"username": "test",
"full_name": "测试",
"roles": [
"frontend"
],
"enabled": true,
"password": "testtest"
}'
导入dashboard
kibana
curl
POST http://localhoat:5601/s/frontend/api/saved_objects/_import?overwrite=true