License management API
NOTE: Requests to the license API require you to authenticate with a Sensu access token or API key.
The code examples in this document use the environment variable $SENSU_API_KEY
to represent a valid API key in API requests.
For more information about commercial features designed for enterprises, see Get started with commercial features.
Get the active license configuration
The /license
API endpoint provides HTTP GET access to the active license configuration.
Example
The following example demonstrates a request to the /license
API endpoint, resulting in a JSON array that contains the license definition.
curl -X GET \
http://127.0.0.1:8080/api/core/v2/namespaces/default/license \
-H "Authorization: Key $SENSU_API_KEY" \
-H 'Content-Type: application/json'
HTTP/1.1 200 OK
{
"type": "LicenseFile",
"api_version": "licensing/v2",
"metadata": {
"labels": {
"sensu.io/entity-count": "10",
"sensu.io/entity-limit": "100"
}
},
"spec": {
"license": {
"version": 1,
"issuer": "Sensu, Inc.",
"accountName": "my_account",
"accountID": 1234567,
"issued": "2019-01-01T13:40:25-08:00",
"validUntil": "2020-01-01T13:40:25-08:00",
"plan": "managed",
"features": [
"all"
],
"signature": {
"algorithm": "PSS",
"hashAlgorithm": "SHA256",
"saltLength": 20
}
},
"signature": "XXXXXXXXXX",
"metadata": {}
}
}
API Specification
/license (GET) | |
---|---|
description | Returns the active commercial license configuration. To download your license, log in to your Sensu account or contact the Sensu sales team for a free trial. |
example url | http://hostname:8080/api/enterprise/licensing/v2/license |
response type | Map |
response codes |
|
output |
|
Activate a commercial license
The /license
API endpoint provides HTTP PUT access to activate a commercial license.
Example
In the following example, an HTTP PUT request is submitted to the /license
API endpoint to create the license definition.
The request returns a successful HTTP 201 Created
response.
curl -X PUT \
-H "Authorization: Key $SENSU_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"type": "LicenseFile",
"api_version": "licensing/v2",
"metadata": {
"labels": {
"sensu.io/entity-count": "10",
"sensu.io/entity-limit": "100"
}
},
"spec": {
"license": {
"version": 1,
"issuer": "Sensu, Inc.",
"accountName": "my_account",
"accountID": 1234567,
"issued": "2019-01-01T13:40:25-08:00",
"validUntil": "2020-01-01T13:40:25-08:00",
"plan": "managed",
"features": [
"all"
],
"signature": {
"algorithm": "PSS",
"hashAlgorithm": "SHA256",
"saltLength": 20
}
},
"signature": "XXXXXXXXXX",
"metadata": {}
}
}' \
http://127.0.0.1:8080/api/core/v2/namespaces/default/license
HTTP/1.1 201 Created
API Specification
/license (PUT) | |
---|---|
description | Activates a commercial license or updates an existing license configuration. To download your license, log in to your Sensu account or contact the Sensu sales team for a free trial. |
example url | http://hostname:8080/api/enterprise/licensing/v2/license |
payload |
|
response codes |
|
Delete a commercial license
The /license
API endpoint provides HTTP DELETE access to remove a commercial license.
Example
The following example shows a request to the /license
API endpoint to delete the commercial license, resulting in a successful HTTP 204 No Content
response.
curl -X DELETE \
http://127.0.0.1:8080/api/enterprise/licensing/v2/license \
-H "Authorization: Key $SENSU_API_KEY"
HTTP/1.1 204 No Content
API Specification
/license (DELETE) | |
---|---|
description | Removes the commercial license. |
example url | http://hostname:8080/api/enterprise/licensing/v2/license |
response codes |
|