mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 02:31:50 +08:00

* Use relative aliases for all non-current Grafana aliases Prevents non-latest documentation "stealing" the page away from latest and through permanent redirects for latest pages that no longer exist. The redirected pages are indexed by search engines but our robots.txt forbids them crawling the non-latest page. Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Remove aliases from shared pages Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Rewrite all current latest aliases to be next Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix typo in latest alias Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Remove all current page aliases find docs/sources -type f -name '*.md' -exec sed -z -i 's#\n *- /docs/grafana/next/[^\n]*\n#\n#' {} \; find docs/sources -type f -name '*.md' -exec sed -Ez -i 's#\n((aliases:\n *-)|aliases:\n)#\n\2#' {} \; Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Prettier Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
229 lines
4.7 KiB
Markdown
229 lines
4.7 KiB
Markdown
---
|
||
aliases:
|
||
- ../../http_api/licensing/
|
||
description: Enterprise Licensing HTTP API
|
||
keywords:
|
||
- grafana
|
||
- http
|
||
- documentation
|
||
- api
|
||
- licensing
|
||
- enterprise
|
||
title: Licensing HTTP API
|
||
---
|
||
|
||
# Enterprise License API
|
||
|
||
Licensing is only available in Grafana Enterprise. Read more about [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}).
|
||
|
||
> If you are running Grafana Enterprise, for some endpoints you'll need to have specific permissions. Refer to [Role-based access control permissions]({{< relref "../../administration/roles-and-permissions/access-control/custom-role-actions-scopes/" >}}) for more information.
|
||
|
||
## Check license availability
|
||
|
||
> **Note:** Available in Grafana Enterprise v7.4+.
|
||
|
||
`GET /api/licensing/check`
|
||
|
||
Checks if a valid license is available.
|
||
|
||
**Required permissions**
|
||
|
||
See note in the [introduction]({{< ref "#enterprise-license-api" >}}) for an explanation.
|
||
|
||
| Action | Scope |
|
||
| -------------- | ----- |
|
||
| licensing:read | n/a |
|
||
|
||
### Examples
|
||
|
||
**Example request:**
|
||
|
||
```http
|
||
GET /api/licensing/check
|
||
Accept: application/json
|
||
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
||
```
|
||
|
||
**Example response:**
|
||
|
||
```http
|
||
HTTP/1.1 200 OK
|
||
Content-Type: application/json
|
||
Content-Length: 4
|
||
|
||
```
|
||
|
||
Status codes:
|
||
|
||
- **200** - OK
|
||
|
||
## Add license
|
||
|
||
> **Note:** Available in Grafana Enterprise v7.4+.
|
||
|
||
`POST /api/licensing/token`
|
||
|
||
Applies a license to a Grafana instance.
|
||
|
||
**Required permissions**
|
||
|
||
See note in the [introduction]({{< ref "#enterprise-license-api" >}}) for an explanation.
|
||
|
||
| Action | Scope |
|
||
| --------------- | ----- |
|
||
| licensing:write | n/a |
|
||
|
||
### Examples
|
||
|
||
**Example request:**
|
||
|
||
```http
|
||
POST /licensing/token
|
||
Accept: application/json
|
||
Content-Type: application/json
|
||
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
||
|
||
{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aGlzIjoiaXMiLCJub3QiOiJhIiwidmFsaWQiOiJsaWNlbnNlIn0.bxDzxIoJlYMwiEYKYT_l2s42z0Y30tY-6KKoyz9RuLE"}
|
||
```
|
||
|
||
**Example response:**
|
||
|
||
```http
|
||
HTTP/1.1 200 OK
|
||
Content-Type: application/json
|
||
Content-Length: 357
|
||
|
||
```
|
||
|
||
The response is a JSON blob available for debugging purposes. The
|
||
available fields may change at any time without any prior notice.
|
||
|
||
Status Codes:
|
||
|
||
- **200** - OK
|
||
- **400** - Bad request
|
||
- **500** - Internal server error (refer to server logs for more details)
|
||
|
||
## Manually force license refresh
|
||
|
||
> **Note:** Available in Grafana Enterprise v7.4+.
|
||
|
||
`POST /api/licensing/token/renew`
|
||
|
||
Manually ask license issuer for a new token.
|
||
|
||
**Required permissions**
|
||
|
||
See note in the [introduction]({{< ref "#enterprise-license-api" >}}) for an explanation.
|
||
|
||
| Action | Scope |
|
||
| --------------- | ----- |
|
||
| licensing:write | n/a |
|
||
|
||
### Examples
|
||
|
||
**Example request:**
|
||
|
||
```http
|
||
POST /api/licensing/token/renew
|
||
Accept: application/json
|
||
Content-Type: application/json
|
||
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
||
|
||
{}
|
||
```
|
||
|
||
**Example response:**
|
||
|
||
```http
|
||
HTTP/1.1 200 OK
|
||
Content-Type: application/json
|
||
Content-Length: 357
|
||
|
||
```
|
||
|
||
The response is a JSON blob available for debugging purposes. The
|
||
available fields may change at any time without any prior notice.
|
||
|
||
Status Codes:
|
||
|
||
- **200** - OK
|
||
- **401** - Unauthorized
|
||
- **403** - Access denied
|
||
|
||
## Remove license from database
|
||
|
||
> **Note:** Available in Grafana Enterprise v7.4+.
|
||
|
||
`DELETE /api/licensing/token`
|
||
|
||
Removes the license stored in the Grafana database.
|
||
|
||
**Required permissions**
|
||
|
||
See note in the [introduction]({{< ref "#enterprise-license-api" >}}) for an explanation.
|
||
|
||
| Action | Scope |
|
||
| ---------------- | ----- |
|
||
| licensing:delete | n/a |
|
||
|
||
### Examples
|
||
|
||
**Example request:**
|
||
|
||
```http
|
||
DELETE /api/licensing/token
|
||
Accept: application/json
|
||
Content-Type: application/json
|
||
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
||
|
||
{"instance": "http://play.grafana.org/"}
|
||
```
|
||
|
||
JSON Body schema:
|
||
|
||
- **instance** – Root URL for the instance for which the license should be deleted. Required.
|
||
|
||
**Example response:**
|
||
|
||
```http
|
||
HTTP/1.1 202 Accepted
|
||
Content-Type: application/json
|
||
Content-Length: 2
|
||
|
||
```
|
||
|
||
Status codes:
|
||
|
||
- **202** - Accepted, license removed or did not exist.
|
||
- **401** - Unauthorized
|
||
- **403** - Access denied
|
||
- **422** - Unprocessable entity, incorrect instance name provided.
|