mirror of
https://github.com/grafana/grafana.git
synced 2025-01-14 02:32:29 -06:00
LBAC for datasources: Docs update HTTP API (#95392)
This commit is contained in:
parent
94bbc081c8
commit
cc1976693b
@ -47,6 +47,31 @@ Content-Type: application/json
|
|||||||
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Example response:**
|
||||||
|
|
||||||
|
```http
|
||||||
|
HTTP/1.1 200 OK
|
||||||
|
Content-Type: application/json; charset=UTF-8
|
||||||
|
Content-Length: 131
|
||||||
|
|
||||||
|
{
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"teamId": "1",
|
||||||
|
"rules": [
|
||||||
|
"{ service_name=\"bigquery-sync-mysql\" }"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"teamId": "2",
|
||||||
|
"rules": [
|
||||||
|
"{ service_name=\"api\" }"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Update LBAC rules for a data source
|
## Update LBAC rules for a data source
|
||||||
|
|
||||||
`PUT /api/datasources/:uid/lbac/teams`
|
`PUT /api/datasources/:uid/lbac/teams`
|
||||||
@ -72,11 +97,18 @@ Content-Type: application/json
|
|||||||
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
||||||
|
|
||||||
{
|
{
|
||||||
"teamId": 1,
|
|
||||||
"rules": [
|
"rules": [
|
||||||
{
|
{
|
||||||
"header": "X-Prom-Label-Policy",
|
"teamId": "1",
|
||||||
"value": "18042:{ foo=\"bar\" }"
|
"rules": [
|
||||||
|
"{ service_name=\"bigquery-sync-mysql\" }"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"teamId": "2",
|
||||||
|
"rules": [
|
||||||
|
"{ service_name=\"api\" }"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -90,20 +122,23 @@ Content-Type: application/json; charset=UTF-8
|
|||||||
Content-Length: 35
|
Content-Length: 35
|
||||||
|
|
||||||
{
|
{
|
||||||
"message": "Data source LBAC rules updated",
|
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"uid": "my_datasource",
|
"message": "Data source LBAC rules updated",
|
||||||
"name": "My Data Source",
|
"name": "loki",
|
||||||
"lbacRules": [
|
"rules": [
|
||||||
{
|
{
|
||||||
"teamId": 1,
|
"teamId": "1",
|
||||||
"rules": [
|
"rules": [
|
||||||
{
|
"{ service_name=\"bigquery-sync-mysql\" }"
|
||||||
"header": "X-Prom-Label-Policy",
|
]
|
||||||
"value": "18042:{ foo=\"bar\" }"
|
},
|
||||||
}
|
{
|
||||||
|
"teamId": "2",
|
||||||
|
"rules": [
|
||||||
|
"{ service_name=\"api\" }"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"uid": "ee1nm1t7spog0e",
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -10392,15 +10392,18 @@
|
|||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int64"
|
"format": "int64"
|
||||||
},
|
},
|
||||||
"lbacRules": {
|
|
||||||
"$ref": "#/definitions/TeamLBACRules"
|
|
||||||
},
|
|
||||||
"message": {
|
"message": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"rules": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/TeamLBACRule"
|
||||||
|
}
|
||||||
|
},
|
||||||
"uid": {
|
"uid": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
@ -24741,15 +24741,18 @@
|
|||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int64"
|
"format": "int64"
|
||||||
},
|
},
|
||||||
"lbacRules": {
|
|
||||||
"$ref": "#/definitions/TeamLBACRules"
|
|
||||||
},
|
|
||||||
"message": {
|
"message": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"rules": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/TeamLBACRule"
|
||||||
|
}
|
||||||
|
},
|
||||||
"uid": {
|
"uid": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
@ -2112,15 +2112,18 @@
|
|||||||
"format": "int64",
|
"format": "int64",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"lbacRules": {
|
|
||||||
"$ref": "#/components/schemas/TeamLBACRules"
|
|
||||||
},
|
|
||||||
"message": {
|
"message": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"rules": {
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/TeamLBACRule"
|
||||||
|
},
|
||||||
|
"type": "array"
|
||||||
|
},
|
||||||
"uid": {
|
"uid": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user