519. Monitoring license usage
Users can monitor license usage in real-time through direct queries to the license server from Foretify Manager. This feature provides visibility into current license consumption, helping users analyze usage patterns, identify availability issues, and take corrective action when needed.
The License Usage Report feature allows any authenticated user to view:
- Total licenses issued per feature
- Licenses currently in use
- Available (free) licenses
- Details of active license checkouts (username, hostname, start time)
This is useful for monitoring and troubleshooting license consumption.
519.1 Access control to license usage reports
Any authenticated user can access this API, including users with the FMANAGER_DATA_UPLOADER role who do not check out a license when logging in.
To enable access:
- Create a user with
FMANAGER_DATA_UPLOADERrole using thecreate_userSDK utility. - Generate an access token for it using the
generate_access_tokenutility. - Use the access token when calling the API.
519.2 Licence Usage Report API
Endpoint
GET /api/licenses/report
Authentication
Bearer token authentication is required.
Response
Returns a LicenseSummary object:
{
"summaryByFeature": [
{
"info": {
"name": "FTX_DEVELOPER",
"issued": 100,
"used": 25,
"free": 75
},
"checkouts": [
{
"username": "john.doe",
"hostname": "workstation-123",
"startTime": "Mon 1/20 10:30",
"serverInfo": "license02.foretellix.local/30001 48856"
}
],
"valid": true
}
],
"valid": true
}
519.2.1 Example request (curl)
curl -X GET "http://fmanager.foretellix.com/api/licenses/report" \
-H "Authorization: Bearer <your-token>" \
-H "Accept: application/json"
519.3 Python SDK for License Usage Report
Usage
from ftx.shell import client
# Connect to FManager
client.login(hostname="fmanager.foretellix.com", username="user", access_token="access_token")
# Get license usage report
report = client.get().licenses().report()
# Access the data
for feature in report.get("summaryByFeature", []):
info = feature["info"]
print(f"{info['name']}: {info['used']}/{info['issued']} in use ({info['free']} free)")
for checkout in feature.get("checkouts", []):
print(f" - {checkout['username']}@{checkout['hostname']} since {checkout['startTime']}")
Example output
FTX_DEVELOPER: 25/100 in use (75 free)
- john.doe@workstation-123 since Mon 1/20 10:30
- jane.smith@dev-machine since Mon 1/20 11:45
shared_runtime_pool: 0/10000 in use (10000 free)
519.3.1 Data Validation for License Usage Report
The service validates the returned license data for internal consistency using the following checks:
- The number of active checkouts matches the reported
usedcount - The
freecounts equalsissued - used - The
issuedandusedvalues are non-negative
If validation fails, the valid field is set to false. Data is still returned to allow inspection. Always check the valid field at both the report level and the per-feature level to detect inconsistencies.