prometheus - Grafana:更改现有用户的角色
问题描述
我使用curl
命令创建了几个 Grafana 用户。这是我使用的命令。
curl -XPOST -H "Content-Type: application/json" -d '{
"name":"user1@graf.com",
"email":"user1@graf.com",
"password":"userpassword",
"role": "Admin"
}' http://admin:admin@grafana01.default.svc.cluster.local:3000/api/admin/users
现在我想将角色从 更改Admin
为Viewer
。我怎样才能做到这一点?。还有其他方法可以尝试吗?任何帮助表示赞赏?
解决方案
例如,要将角色更新为查看器,您可以执行以下操作:
curl -XPATCH -H "Content-Type: application/json" -d '{
"role":"Viewer"
}' http://admin:admin@grafana01.default.svc.cluster.local:3000/api/orgs/:orgId/users/:userId
请务必使用正确的 orgId 和 userId
看看 https://github.com/grafana/grafana/issues/11945
编辑:我编辑了我以前的(和错误的)答案。
推荐阅读
- python-3.x - 无法使用 TensorFlow 数据集拆分疟疾数据集
- javascript - 使用 tsconfig.json 从 node_modules 导入外部类型定义
- android - 这个广告倒计时方法是如何通过 jadx 从 apk 工作的?
- api - RAML 文件中的命名空间
- python - Python 分类器
- python-3.x - pyspark 是否会更改优化指令的顺序?
- amazon-web-services - Spring Boot Tomcat 访问 Cloudwatch Docker 日志
- reactjs - 为什么组件渲染器在useEffect中调度动作时执行3次
- php - 如何使用条件获取 sql php 或使用条件合并获取?
- mysql - 如何在存储过程中获取多个选择语句的输出