AccessControl: Document new permissions restricting data source access. (#39091)
* Add data sources roles and permissions to docs Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
This commit is contained in:
@@ -7,10 +7,23 @@ aliases = ["/docs/grafana/latest/http_api/datasource/"]
|
||||
|
||||
# Data source API
|
||||
|
||||
> If you are running Grafana Enterprise and have [Fine-grained access control]({{< relref "../enterprise/access-control/_index.md" >}}) enabled, for some endpoints you would need to have relevant permissions.
|
||||
> Refer to specific resources to understand what permissions are required.
|
||||
|
||||
## Get all data sources
|
||||
|
||||
`GET /api/datasources`
|
||||
|
||||
### Required permissions
|
||||
|
||||
See note in the [introduction]({{< ref "#data-source-api" >}}) for an explanation.
|
||||
|
||||
| Action | Scope |
|
||||
| ---------------- | -------------- |
|
||||
| datasources:read | datasources:\* |
|
||||
|
||||
### Examples
|
||||
|
||||
**Example Request**:
|
||||
|
||||
```http
|
||||
@@ -57,6 +70,16 @@ Content-Type: application/json
|
||||
|
||||
`GET /api/datasources/:datasourceId`
|
||||
|
||||
### Required permissions
|
||||
|
||||
See note in the [introduction]({{< ref "#data-source-api" >}}) for an explanation.
|
||||
|
||||
| Action | Scope |
|
||||
| ---------------- | ---------------------------------------------------------------------------- |
|
||||
| datasources:read | datasources:\*<br>datasources:id:\*<br>datasources:id:1 (single data source) |
|
||||
|
||||
### Examples
|
||||
|
||||
**Example Request**:
|
||||
|
||||
```http
|
||||
@@ -103,6 +126,16 @@ Content-Type: application/json
|
||||
|
||||
`GET /api/datasources/uid/:uid`
|
||||
|
||||
### Required permissions
|
||||
|
||||
See note in the [introduction]({{< ref "#data-source-api" >}}) for an explanation.
|
||||
|
||||
| Action | Scope |
|
||||
| ---------------- | -------------------------------------------------------------------------------------- |
|
||||
| datasources:read | datasources:\*<br>datasources:uid:\*<br>datasources:uid:kLtEtcRGk (single data source) |
|
||||
|
||||
### Examples
|
||||
|
||||
**Example request:**
|
||||
|
||||
```http
|
||||
@@ -149,6 +182,16 @@ Content-Type: application/json
|
||||
|
||||
`GET /api/datasources/name/:name`
|
||||
|
||||
### Required permissions
|
||||
|
||||
See note in the [introduction]({{< ref "#data-source-api" >}}) for an explanation.
|
||||
|
||||
| Action | Scope |
|
||||
| ---------------- | ---------------------------------------------------------------------------------------------- |
|
||||
| datasources:read | datasources:\*<br>datasources:name:\*<br>datasources:name:test_datasource (single data source) |
|
||||
|
||||
### Examples
|
||||
|
||||
**Example Request**:
|
||||
|
||||
```http
|
||||
@@ -195,6 +238,16 @@ Content-Type: application/json
|
||||
|
||||
`GET /api/datasources/id/:name`
|
||||
|
||||
### Required permissions
|
||||
|
||||
See note in the [introduction]({{< ref "#data-source-api" >}}) for an explanation.
|
||||
|
||||
| Action | Scope |
|
||||
| ------------------- | ---------------------------------------------------------------------------------------------- |
|
||||
| datasources:id:read | datasources:\*<br>datasources:name:\*<br>datasources:name:test_datasource (single data source) |
|
||||
|
||||
### Examples
|
||||
|
||||
**Example Request**:
|
||||
|
||||
```http
|
||||
@@ -219,6 +272,16 @@ Content-Type: application/json
|
||||
|
||||
`POST /api/datasources`
|
||||
|
||||
### Required permissions
|
||||
|
||||
See note in the [introduction]({{< ref "#data-source-api" >}}) for an explanation.
|
||||
|
||||
| Action | Scope |
|
||||
| ------------------ | ----- |
|
||||
| datasources:create | n/a |
|
||||
|
||||
### Examples
|
||||
|
||||
**Example Graphite Request**:
|
||||
|
||||
```http
|
||||
@@ -357,6 +420,16 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
||||
|
||||
`PUT /api/datasources/:datasourceId`
|
||||
|
||||
### Required permissions
|
||||
|
||||
See note in the [introduction]({{< ref "#data-source-api" >}}) for an explanation.
|
||||
|
||||
| Action | Scope |
|
||||
| ----------------- | ---------------------------------------------------------------------------- |
|
||||
| datasources:write | datasources:\*<br>datasources:id:\*<br>datasources:id:1 (single data source) |
|
||||
|
||||
### Examples
|
||||
|
||||
**Example Request**:
|
||||
|
||||
```http
|
||||
@@ -427,6 +500,16 @@ Content-Type: application/json
|
||||
|
||||
`DELETE /api/datasources/:datasourceId`
|
||||
|
||||
### Required permissions
|
||||
|
||||
See note in the [introduction]({{< ref "#data-source-api" >}}) for an explanation.
|
||||
|
||||
| Action | Scope |
|
||||
| ------------------ | ---------------------------------------------------------------------------- |
|
||||
| datasources:delete | datasources:\*<br>datasources:id:\*<br>datasources:id:1 (single data source) |
|
||||
|
||||
### Examples
|
||||
|
||||
**Example Request**:
|
||||
|
||||
```http
|
||||
@@ -449,6 +532,16 @@ Content-Type: application/json
|
||||
|
||||
`DELETE /api/datasources/uid/:uid`
|
||||
|
||||
### Required permissions
|
||||
|
||||
See note in the [introduction]({{< ref "#data-source-api" >}}) for an explanation.
|
||||
|
||||
| Action | Scope |
|
||||
| ------------------ | -------------------------------------------------------------------------------------- |
|
||||
| datasources:delete | datasources:\*<br>datasources:uid:\*<br>datasources:uid:kLtEtcRGk (single data source) |
|
||||
|
||||
### Examples
|
||||
|
||||
**Example request:**
|
||||
|
||||
```http
|
||||
@@ -471,6 +564,16 @@ Content-Type: application/json
|
||||
|
||||
`DELETE /api/datasources/name/:datasourceName`
|
||||
|
||||
### Required permissions
|
||||
|
||||
See note in the [introduction]({{< ref "#data-source-api" >}}) for an explanation.
|
||||
|
||||
| Action | Scope |
|
||||
| ------------------ | ---------------------------------------------------------------------------------------------- |
|
||||
| datasources:delete | datasources:\*<br>datasources:name:\*<br>datasources:name:test_datasource (single data source) |
|
||||
|
||||
### Examples
|
||||
|
||||
**Example Request**:
|
||||
|
||||
```http
|
||||
|
||||
Reference in New Issue
Block a user