To manage license, execute requests using the "licenses: API method (determine administrator token before executing the request):
Activate license:
curl -v -X POST "<IP address or DNS server name>/api/v2/licenses/" –header "accept: application/json" -H "Authorization: Bearer <administrator token>" -F 'file=@<absolute path to license file>/<license file name>.prm'
The example of response:
{
"id": 3,
"max_devices": 5,
"max_users": 5,
"max_devices_per_user": 5,
"requests_per_minute": -1,
"end_time": "2022-12-31",
"system_id": "64329645253",
"license_id": "e8e3647f-04a8-4696-920c-c72bb34a7ad8",
"data_sources": null
}
Get information about licenses:
curl -v '<IP address or DNS server name>/api/v2/licenses/' --header 'Content-Type: application/json' -H 'Authorization: Bearer <administrator token>'
The example of response:
{
"results": [
{
"id": 1,
"max_devices": 5,
"max_users": 5,
"max_devices_per_user": 5,
"requests_per_minute": -1,
"end_time": "2022-12-31",
"system_id": "64329645253",
"license_id": "e8e3647f-04a8-4696-920c-c72bb34a7ad8",
"data_sources": null
},
{
"id": 2,
"max_devices": 7,
"max_users": 7,
"max_devices_per_user": 7,
"requests_per_minute": -1,
"end_time": "2022-12-31",
"system_id": "64329645253",
"license_id": "be91a026-9edc-4782-a8d4-2653d8ac2a66",
"data_sources": [
"FAP_WEB",
"POSTGRES"
]
}
]
}
Values of parameters contain the following information about license:
id. License identifier in the list of existing licenses.
max_devices. Maximum number of active devices.
max_users. Maximum number of active API users.
max_devices_per_user. Maximum number of devices per user.
requests_per_minute. Maximum number of requests per minute. If the parameter is set to -1, the limit on the number of requests is not set.
end_time. License period.
system_id. Installation identifier.
license_id. Unique license identifier.
data_sources. Available data sources. If the parameter is set to null, all data sources are available.
Change settings of notifications about exceeded limits specified in the license:
curl -X POST -v '<IP address or DNS server name>/api/v2/licenses/notifications-settings/' --header 'Content-Type: application/json' -H 'Authorization: Bearer <administrator token>' -d '{
"use_email": <notification method (0-to logs or 1-via e-mail and to logs)>,
"days_before": <action days left>,
"period": <repetition in days>,
"device_rate": <devices left in percentage>,
"user_rate": <users left in percentage>
}'
The example of response:
{
"use_email": 1,
"days_before": 2,
"period": 3,
"device_rate": 15,
"user_rate": 15,
"last_run_at": null,
"license_error_status": "{}"
}
Get settings of notifications about exceeded limits specified in license:
curl -v '<IP address or DNS server name>/api/v2/licenses/notifications-settings/' --header 'Content-Type: application/json' -H 'Authorization: Bearer <administrator token>'
The example of response:
{
"use_email": 0,
"days_before": 5,
"period": 5,
"device_rate": 10,
"user_rate": 10,
"last_run_at": null,
"license_error_status": "{}"
}
Delete license:
curl -X DELETE -v '<IP address or DNS server name>/api/v2/licenses/<identifier or requested license>/' --header 'Content-Type: application/json' -H 'Authorization: Bearer <administrator token>'
In the <requested license identifier> substitution use value of the id parameter returned on getting information about licenses.
The example of response:
204
See also: