Revert "[v9.4.x] [feat] docs; update admonition syntax" (#68982)

Revert "[v9.4.x] [feat] docs; update admonition syntax (#68855)"

This reverts commit 048de5d09a.
This commit is contained in:
Jack Baldry
2023-05-24 14:53:21 +01:00
committed by GitHub
parent 136cb16a52
commit 7daa240753
144 changed files with 1241 additions and 3890 deletions
+2 -6
View File
@@ -192,9 +192,7 @@ Content-Type: application/json
`PUT /api/admin/settings`
{{% admonition type="note" %}}
Available in Grafana Enterprise v8.0+.
{{% /admonition %}}
> **Note:** Available in Grafana Enterprise v8.0+.
Updates / removes and reloads database settings. You must provide either `updates`, `removals` or both.
@@ -473,9 +471,7 @@ Content-Type: application/json
`POST /api/admin/pause-all-alerts`
{{% admonition type="note" %}}
This API is relevant for the [legacy dashboard alerts](https://grafana.com/docs/grafana/v8.5/alerting/old-alerting/) only. For default alerting, use silences to stop alerts from being delivered.
{{% /admonition %}}
> **Note:** This API is relevant for the [legacy dashboard alerts](https://grafana.com/docs/grafana/v8.5/alerting/old-alerting/) only. For default alerting, use silences to stop alerts from being delivered.
Only works with Basic Authentication (username and password). See [introduction](http://docs.grafana.org/http_api/admin/#admin-api) for an explanation.
+1 -3
View File
@@ -15,9 +15,7 @@ title: 'Alerting HTTP API '
# Legacy Alerting API
{{% admonition type="note" %}}
Starting with v9.0, the Legacy Alerting HTTP API is deprecated. It will be removed in a future release.
{{% /admonition %}}
> **Note:** Starting with v9.0, the Legacy Alerting HTTP API is deprecated. It will be removed in a future release.
This topic is relevant for the [legacy dashboard alerts](https://grafana.com/docs/grafana/v8.5/alerting/old-alerting/) only.
@@ -16,9 +16,7 @@ title: 'Alerting Notification Channels HTTP API '
# Legacy Alerting Notification Channels API
{{% admonition type="note" %}}
Starting with v9.0, the Legacy Alerting Notification Channels API is deprecated. It will be removed in a future release.
{{% /admonition %}}
> **Note:** Starting with v9.0, the Legacy Alerting Notification Channels API is deprecated. It will be removed in a future release.
This page documents the Alerting Notification Channels API.
@@ -176,9 +176,7 @@ Status Codes:
## Get permissions for a dashboard by id
{{% admonition type="warning" %}}
This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [new dashboard permissions API](#get-permissions-for-a-dashboard).
{{% /admonition %}}
> **Warning:** This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [new dashboard permissions API](#get-permissions-for-a-dashboard).
`GET /api/dashboards/id/:dashboardId/permissions`
@@ -259,9 +257,7 @@ Status Codes:
## Update permissions for a dashboard by id
{{% admonition type="warning" %}}
This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [new dashboard permissions API](#update-permissions-for-a-dashboard).
{{% /admonition %}}
> **Warning:** This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [new dashboard permissions API](#update-permissions-for-a-dashboard).
`POST /api/dashboards/id/:dashboardId/permissions`
@@ -18,9 +18,7 @@ title: 'Dashboard Versions HTTP API '
## Get all dashboard versions
{{% admonition type="warning" %}}
This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [new dashboard versions API](#get-all-dashboard-versions-by-dashboard-uid).
{{% /admonition %}}
> **Warning:** This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [new dashboard versions API](#get-all-dashboard-versions-by-dashboard-uid).
Query parameters:
@@ -140,9 +138,7 @@ Status Codes:
## Get dashboard version
{{% admonition type="warning" %}}
This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [new get dashboard version API](#get-dashboard-version-by-dashboard-uid).
{{% /admonition %}}
> **Warning:** This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [new get dashboard version API](#get-dashboard-version-by-dashboard-uid).
`GET /api/dashboards/id/:dashboardId/versions/:version`
@@ -367,9 +363,7 @@ Status Codes:
## Restore dashboard
{{% admonition type="warning" %}}
This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [new restore dashboard API](#restore-dashboard-by-dashboard-uid).
{{% /admonition %}}
> **Warning:** This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [new restore dashboard API](#restore-dashboard-by-dashboard-uid).
`POST /api/dashboards/id/:dashboardId/restore`
@@ -77,9 +77,7 @@ Content-Type: application/json
`GET /api/datasources/:datasourceId`
{{% admonition type="warning" %}}
This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [API for getting a single data source by UID](#get-a-single-data-source-by-uid) or to the [API for getting a single data source by its name](#get-a-single-data-source-by-name).
{{% /admonition %}}
> **Warning:** This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [API for getting a single data source by UID](#get-a-single-data-source-by-uid) or to the [API for getting a single data source by its name](#get-a-single-data-source-by-name).
**Required permissions**
@@ -344,9 +342,7 @@ Content-Type: application/json
}
```
{{% admonition type="note" %}}
By defining `password` and `basicAuthPassword` under `secureJsonData` Grafana encrypts them securely as an encrypted blob in the database. The response then lists the encrypted fields under `secureJsonFields`.
{{% /admonition %}}
> **Note:** By defining `password` and `basicAuthPassword` under `secureJsonData` Grafana encrypts them securely as an encrypted blob in the database. The response then lists the encrypted fields under `secureJsonFields`.
**Example Graphite Request with basic auth enabled**:
@@ -433,9 +429,7 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
`PUT /api/datasources/:datasourceId`
{{% admonition type="warning" %}}
This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [new data source update API](#update-an-existing-data-source).
{{% /admonition %}}
> **Warning:** This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [new data source update API](#update-an-existing-data-source).
**Required permissions**
@@ -512,9 +506,7 @@ Content-Type: application/json
}
```
{{% admonition type="note" %}}
Similar to [creating a data source](#create-a-data-source), `password` and `basicAuthPassword` should be defined under `secureJsonData` in order to be stored securely as an encrypted blob in the database. Then, the encrypted fields are listed under `secureJsonFields` section in the response.
{{% /admonition %}}
> **Note:** Similar to [creating a data source](#create-a-data-source), `password` and `basicAuthPassword` should be defined under `secureJsonData` in order to be stored securely as an encrypted blob in the database. Then, the encrypted fields are listed under `secureJsonFields` section in the response.
## Update an existing data source
@@ -596,17 +588,13 @@ Content-Type: application/json
}
```
{{% admonition type="note" %}}
Similar to [creating a data source](#create-a-data-source), `password` and `basicAuthPassword` should be defined under `secureJsonData` in order to be stored securely as an encrypted blob in the database. Then, the encrypted fields are listed under `secureJsonFields` section in the response.## Update an existing data source by id
{{% /admonition %}}
> **Note:** Similar to [creating a data source](#create-a-data-source), `password` and `basicAuthPassword` should be defined under `secureJsonData` in order to be stored securely as an encrypted blob in the database. Then, the encrypted fields are listed under `secureJsonFields` section in the response.## Update an existing data source by id
## Delete an existing data source by id
`DELETE /api/datasources/:datasourceId`
{{% admonition type="warning" %}}
This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [API for deleting an existing data source by UID](#delete-an-existing-data-source-by-uid) or to the [API for deleting an existing data source by its name](#delete-an-existing-data-source-by-name)
{{% /admonition %}}
> **Warning:** This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [API for deleting an existing data source by UID](#delete-an-existing-data-source-by-uid) or to the [API for deleting an existing data source by its name](#delete-an-existing-data-source-by-name)
**Required permissions**
@@ -708,9 +696,7 @@ Content-Type: application/json
## Data source proxy calls by id
{{% admonition type="warning" %}}
This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [new data source API for proxying requests](#data-source-proxy-calls).
{{% /admonition %}}
> **Warning:** This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [new data source API for proxying requests](#data-source-proxy-calls).
`GET /api/datasources/proxy/:datasourceId/*`
@@ -784,9 +770,7 @@ Content-Type: application/json
## Fetch data source resources by id
{{% admonition type="warning" %}}
This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [new data source resources API](#fetch-data-source-resources).
{{% /admonition %}}
> **Warning:** This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [new data source resources API](#fetch-data-source-resources).
`GET /api/datasources/:datasourceId/resources/*`
@@ -886,9 +870,7 @@ Queries a data source having a backend implementation.
`POST /api/ds/query`
{{% admonition type="note" %}}
Grafana's built-in data sources usually have a backend implementation.
{{% /admonition %}}
> **Note:** Grafana's built-in data sources usually have a backend implementation.
**Example request for the Test data source**:
@@ -437,9 +437,7 @@ Status Codes:
Deletes an existing library element as specified by the UID. This operation cannot be reverted.
{{% admonition type="note" %}}
You cannot delete a library element that is connected. This operation cannot be reverted.
{{% /admonition %}}
> **Note:** You cannot delete a library element that is connected. This operation cannot be reverted.
**Example Request**:
@@ -61,9 +61,7 @@ Status codes:
## Add license
{{% admonition type="note" %}}
Available in Grafana Enterprise v7.4+.
{{% /admonition %}}
> **Note:** Available in Grafana Enterprise v7.4+.
`POST /api/licensing/token`
@@ -123,9 +121,7 @@ Status Codes:
## Manually force license refresh
{{% admonition type="note" %}}
Available in Grafana Enterprise v7.4+.
{{% /admonition %}}
> **Note:** Available in Grafana Enterprise v7.4+.
`POST /api/licensing/token/renew`
@@ -184,9 +180,7 @@ Status Codes:
## Remove license from database
{{% admonition type="note" %}}
Available in Grafana Enterprise v7.4+.
{{% /admonition %}}
> **Note:** Available in Grafana Enterprise v7.4+.
`DELETE /api/licensing/token`
@@ -1,297 +0,0 @@
---
aliases:
- ../../http_api/query_caching/
- ../../http_api/resource_caching/
- ../../http_api/caching/
canonical: /docs/grafana/latest/developers/http_api/query_and_resource_caching/
description: Grafana Enterprise Query and Resource Caching HTTP API
keywords:
- grafana
- http
- documentation
- api
- caching
- query caching
- resource caching
- data source
title: Query and Resource Caching HTTP API
---
# Query and resource caching API
{{% admonition type="note" %}}
If you are running Grafana Enterprise, for some endpoints you'll need to have specific permissions. Refer to [Role-based access control permissions]({{< relref "/docs/grafana/latest/administration/roles-and-permissions/access-control/custom-role-actions-scopes" >}}) for more information.
{{% /admonition %}}
## Enable caching for a data source
`POST /api/datasources/:dataSourceUID/cache/enable`
**Required permissions**
See note in the [introduction]({{< ref "#query-and-resource-caching-api" >}}) for an explanation.
| Action | Scope |
| ------------------------- | -------------- |
| datasources.caching:write | datasources:\* |
### Examples
**Example Request**:
```http
POST /api/datasources/jZrmlLCGka/cache/enable HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
**Example Response**:
```http
HTTP/1.1 200
Content-Type: application/json
{
"message": "Data source cache enabled",
"dataSourceID": 1,
"dataSourceUID": "jZrmlLCGka",
"enabled": true,
"ttlQueriesMs": 300000,
"ttlResourcesMs": 300000,
"useDefaultTTL": true,
"defaultTTLMs": 300000,
"created": "2023-04-21T11:49:22-04:00",
"updated": "2023-04-24T16:30:29-04:00"
}
```
#### Status codes
| Code | Description |
| ---- | ------------------------------------------------------------------------ |
| 200 | Cache was successfully enabled for the data source |
| 500 | Unexpected error. Refer to the body and/or server logs for more details. |
## Disable caching for a data source
`POST /api/datasources/:dataSourceUID/cache/disable`
**Required permissions**
See note in the [introduction]({{< ref "#query-and-resource-caching-api" >}}) for an explanation.
| Action | Scope |
| ------------------------- | -------------- |
| datasources.caching:write | datasources:\* |
### Examples
**Example Request**:
```http
POST /api/datasources/jZrmlLCGka/cache/disable HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
**Example Response**:
```http
HTTP/1.1 200
Content-Type: application/json
{
"message": "Data source cache disabled",
"dataSourceID": 1,
"dataSourceUID": "jZrmlLCGka",
"enabled": false,
"ttlQueriesMs": 300000,
"ttlResourcesMs": 300000,
"useDefaultTTL": true,
"defaultTTLMs": 0,
"created": "2023-04-21T11:49:22-04:00",
"updated": "2023-04-24T16:30:31-04:00"
}
```
#### Status codes
| Code | Description |
| ---- | ------------------------------------------------------------------------ |
| 200 | Cache was successfully enabled for the data source |
| 500 | Unexpected error. Refer to the body and/or server logs for more details. |
## Clean cache for all data sources
`POST /api/datasources/:dataSourceUID/cache/clean`
Will clean cached data for _all_ data sources with caching enabled. The `dataSourceUID` specified will only be used to return the configuration for that data source.
**Required permissions**
See note in the [introduction]({{< ref "#query-and-resource-caching-api" >}}) for an explanation.
| Action | Scope |
| ------------------------- | -------------- |
| datasources.caching:write | datasources:\* |
### Examples
**Example Request**:
```http
POST /api/datasources/jZrmlLCGka/cache/clean HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
**Example Response**:
```http
HTTP/1.1 200
Content-Type: application/json
{
"message": "Data source cache cleaned",
"dataSourceID": 1,
"dataSourceUID": "jZrmlLCGka",
"enabled": false,
"ttlQueriesMs": 300000,
"ttlResourcesMs": 300000,
"useDefaultTTL": true,
"defaultTTLMs": 0,
"created": "2023-04-21T11:49:22-04:00",
"updated": "2023-04-24T16:30:31-04:00"
}
```
#### Status codes
| Code | Description |
| ---- | ------------------------------------------------------------------------ |
| 200 | Cache was successfully enabled for the data source |
| 500 | Unexpected error. Refer to the body and/or server logs for more details. |
## Update cache configuration for a data source
`POST /api/datasources/:dataSourceUID/cache`
**Required permissions**
See note in the [introduction]({{< ref "#query-and-resource-caching-api" >}}) for an explanation.
| Action | Scope |
| ------------------------- | -------------- |
| datasources.caching:write | datasources:\* |
### Examples
**Example Request**:
```http
POST /api/datasources/jZrmlLCGka/cache HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
{
"dataSourceID": 1,
"dataSourceUID": "jZrmlLCGka",
"enabled": true,
"useDefaultTTL": false,
"ttlQueriesMs": 60000,
"ttlResourcesMs": 300000,
}
```
#### JSON Body Schema
| Field name | Data type | Description |
| -------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| dataSourceID | number | The ID of the data source to configure. |
| dataSourceUID | string | The UID of the data source to configure. |
| enabled | boolean | Whether or not to enable caching for this data source. |
| useDefaultTTL | boolean | Whether the configured default TTL (Time-To-Live) should be used for both query and resource caching, instead of the user-specified values. |
| ttlQueriesMs | number | The TTL to use for query caching, in milliseconds. |
| ttlResourcesMs | number | The TTL to use for resource caching, in milliseconds. |
**Example Response**:
```http
HTTP/1.1 200
Content-Type: application/json
{
"message": "Data source cache settings updated",
"dataSourceID": 1,
"dataSourceUID": "jZrmlLCGka",
"enabled": true,
"useDefaultTTL": false,
"ttlQueriesMs": 60000,
"ttlResourcesMs": 300000,
"defaultTTLMs": 300000,
"created": "2023-04-21T11:49:22-04:00",
"updated": "2023-04-24T17:03:40-04:00"
}
```
#### Status codes
| Code | Description |
| ---- | ------------------------------------------------------------------------ |
| 200 | Cache was successfully enabled for the data source |
| 400 | Request errors (invalid json, missing or invalid fields, etc) |
| 500 | Unexpected error. Refer to the body and/or server logs for more details. |
## Get cache configuration for a data source
`GET /api/datasources/:dataSourceUID/cache`
**Required permissions**
See note in the [introduction]({{< ref "#query-and-resource-caching-api" >}}) for an explanation.
| Action | Scope |
| ------------------------ | -------------- |
| datasources.caching:read | datasources:\* |
### Examples
**Example Request**:
```http
GET /api/datasources/jZrmlLCGka/cache HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
**Example Response**:
```http
HTTP/1.1 200
Content-Type: application/json
{
"message": "Data source cache settings loaded",
"dataSourceID": 1,
"dataSourceUID": "jZrmlLCGka",
"enabled": true,
"useDefaultTTL": false,
"ttlQueriesMs": 60000,
"ttlResourcesMs": 300000,
"defaultTTLMs": 300000,
"created": "2023-04-21T11:49:22-04:00",
"updated": "2023-04-24T17:03:40-04:00"
}
```
#### Status codes
| Code | Description |
| ---- | ------------------------------------------------------------------------ |
| 200 | Cache was successfully enabled for the data source |
| 500 | Unexpected error. Refer to the body and/or server logs for more details. |
+1 -3
View File
@@ -65,9 +65,7 @@ JSON Body schema:
- **key** - Optional. Define the unique key. Required if **external** is `true`.
- **deleteKey** - Optional. Unique key used to delete the snapshot. It is different from the **key** so that only the creator can delete the snapshot. Required if **external** is `true`.
{{% admonition type="note" %}}
When creating a snapshot using the API, you have to provide the full dashboard payload including the snapshot data. This endpoint is designed for the Grafana UI.
{{% /admonition %}}
> **Note:** When creating a snapshot using the API, you have to provide the full dashboard payload including the snapshot data. This endpoint is designed for the Grafana UI.
**Example Response**: