Docs: Describe applying a license (#55078)

* Docs: Describe adding a license via API

* Add missing word
This commit is contained in:
Tania 2022-09-23 11:57:51 +02:00 committed by GitHub
parent 7114c51f9f
commit 96cb415497
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,6 +59,66 @@ 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
{
"jti":"2",
"iss":"https://grafana.com",
"sub":"https://play.grafana.org/"
"lid":"1",
"included_users":15,
"lic_exp_warn_days":30,
"tok_exp_warn_days":2,
"update_days":1,
"prod":["grafana-enterprise"],
"company":"Grafana Labs"
}
```
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+.
@ -100,8 +160,7 @@ Content-Length: 357
"iss":"https://grafana.com",
"sub":"https://play.grafana.org/"
"lid":"1",
"included_admins":5,
"included_viewers":10,
"included_users":15,
"lic_exp_warn_days":30,
"tok_exp_warn_days":2,
"update_days":1,