mirror of
https://github.com/grafana/grafana.git
synced 2025-09-20 07:06:08 +08:00
Docs: RBAC GA (#49062)
This commit is contained in:
@ -7,14 +7,13 @@ title = "Data source HTTP API "
|
||||
|
||||
# Data source API
|
||||
|
||||
> If you are running Grafana Enterprise and have [Role-based 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.
|
||||
> If you are running Grafana Enterprise, for some endpoints you'll need to have specific permissions. Refer to [Role-based access control permissions]({{< relref "../../enterprise/access-control/custom-role-actions-scopes" >}}) for more information.
|
||||
|
||||
## Get all data sources
|
||||
|
||||
`GET /api/datasources`
|
||||
|
||||
### Required permissions
|
||||
**Required permissions**
|
||||
|
||||
See note in the [introduction]({{< ref "#data-source-api" >}}) for an explanation.
|
||||
|
||||
@ -70,7 +69,7 @@ Content-Type: application/json
|
||||
HTTP/1.1 200
|
||||
Content-Type: application/json
|
||||
|
||||
```
|
||||
```
|
||||
|
||||
## Get a single data source by UID
|
||||
|
||||
@ -126,7 +125,7 @@ Content-Type: application/json
|
||||
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
||||
```
|
||||
|
||||
**Example Response**:
|
||||
**Example Response**:
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
@ -182,7 +181,7 @@ Content-Type: application/json
|
||||
**Example Graphite Request**:
|
||||
|
||||
```http
|
||||
POST /api/datasources HTTP/1.1
|
||||
POST /api/datasources HTTP/1.1
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
||||
@ -238,7 +237,7 @@ Content-Type: application/json
|
||||
| Action | Scope |
|
||||
| ----------------- | ---------------------------------------------------------------------------- |
|
||||
| datasources:write | datasources:\*<br>datasources:id:\*<br>datasources:id:1 (single data source) |
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
**Example Request**:
|
||||
@ -272,7 +271,7 @@ Content-Type: application/json
|
||||
| Action | Scope |
|
||||
| ------------------ | ---------------------------------------------------------------------------- |
|
||||
| datasources:delete | datasources:\*<br>datasources:id:\*<br>datasources:id:1 (single data source) |
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
**Example Request**:
|
||||
@ -420,7 +419,7 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
||||
|
||||
Makes a call to the resources endpoint of data source identified by the given `dashboardId`.
|
||||
|
||||
### Examples
|
||||
### Examples
|
||||
|
||||
**Example Request**:
|
||||
|
||||
@ -500,7 +499,7 @@ Content-Type: application/json
|
||||
"results": {
|
||||
"A": {
|
||||
"frames": [
|
||||
{
|
||||
{
|
||||
"schema": {
|
||||
"refId": "A",
|
||||
"fields": [
|
||||
@ -532,7 +531,7 @@ Content-Type: application/json
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
#### Status codes
|
||||
|
||||
@ -567,7 +566,7 @@ Content-Type: application/json
|
||||
|
||||
```
|
||||
|
||||
JSON Body schema:
|
||||
JSON Body schema:
|
||||
|
||||
- **from/to** – Specifies the time range for the queries. The time can be either epoch timestamps in milliseconds or relative using Grafana time units. For example, `now-5m`.
|
||||
- **queries.refId** – Specifies an identifier of the query. Defaults to "A".
|
||||
|
Reference in New Issue
Block a user