Warning |
---|
This page refers to functionality that has been removed from License Statistics. This information no longer applies to License Statistics v6.3 and newer. |
The Current Users endpoint delivers license usage metrics specific to the Current Users report, allowing you to see currently active users and the features they are usingLicense Statistics API allows you to obtain information about Current Users report. The report consists of three parts: current license usage, highest license usage and current users list.
Obtaining information about current users
To You can easily list users that who are currently using licenses, use following URL templateat least one license by sending the following HTTP request.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
GET /api/v1/report/users/current/${returnType} |
where :- $ $ indicates a variable value that you can replace with a proper value, according to your needs- the value that best suits your needs. The possible parameters are as follows:described below.
Parameter | Required | Type | Description |
---|---|---|---|
${returnType} | Yes | string |
Specifies field visibility settings, for example:
Code Block |
---|
{ "fid": "1", "fns": "1", "fv": "1", "ftype": "1", "lsid": "1", "lsn": "1", "uid": "1", "un": "1", "hn": "1", "lco": "1","fu": "1"} |
where number "1" indicates that a specific field is visible.
Note that the order of the settings you make is important – when exported, the fields will be visible in exactly the same order you specify here.
If you don't pass this parameter, it will be generated automatically for PDF and XLS types. If provided, it cannot be left empty.
Applies filtering license usage data on all fields.
To filter by string column, use the following format:
Code Block |
---|
[
{
"type": "string",
"field": ""${un | hn | fns | fv | ftype | lsn | lco}",
"value": "${value}"
}
] |
To filter by numeric column, use the following format:
Code Block |
---|
[
{
"type": "numeric",
"comparison": "${gt | lt | eq}",
"field": "${fid | lsid | uid | fu }",
"value": "${value}"
}
] |
Specifies the field by which you want to order your data records. The field name can be one of the following: fid, fns, fv, ftype, lsid, lsn, uid, un, hn, lco, fu.
If your request is successful, you should see a response similar to the following:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{
success: ${success},
msg: ${message},
data: [{
"fid": ${featureId},
"fns": ${featureName},
"ftype": ${featureType},
"fv": ${featureVersion},
"lsid": ${licenseServerId},
"lsn": ${licenseServerName},
"uid": ${userId},
"un": ${userName},
"hn": ${hostName},
"lco": ${licenseCheckedOut},
"fu": ${licensesUsed}
}],
"code": ${errorCode},
"totalCount": ${totalCount}
} |
where the response fields can be explained as follows:
Standard format option. See Making an API request page for details. | |||
standard report options | No | various | Refer to Making an API request page for details. |
Response
On success, this report will contain one row for each license session. Each row consists of the following columns.
un
string
Username.
hn
string
Hostname.
lco
string
Date when license was checked out, in 'YYYY-MM-DD HH:MM:SS' format.
fu
Column | Full name | Type | Description | Visible by default in export |
---|---|---|---|---|
uid | User Id | integer | Internal License Statistics identification of user that checked out licenses. | Yes |
un | User | string | Name of user that checked out licenses. | Yes |
hn | Host | string | Host on which licenses were checked out. | Yes |
fid | Feature Id | integer | Internal License Statistics identification of the used feature. | Yes |
fns | Feature Name | string | Name of the used feature. | Yes |
fv | Feature Version | string | Version of the used feature. | Yes |
ftype | Feature Type | enumeration | Type of the used feature. See feature type descriptions for further details. | Yes |
lus | Used |
integer | Total number of licenses used by user on host. |
msg
string
Error message returned on failure.
success
boolean
Indicates whether the API request was successfully processed.
Error code for unsuccessful request.
Yes | ||||
lco | Checked Out | date and time | Time when licenses were checked out. | Yes |
lsid | License Server Id | integer | Internal License Statistics identification of server hosting the used feature. | Yes |
lsn | License Server | string | Name of server hosting the used feature. | Yes |
Note that the order in the table is the default order of the columns in the exported file.
Obtaining information about current license usage
To obtain information about how many users are using licenses at the moment, use following URLYou can easily list users that are currently using at least one license by sending the following HTTP request.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
GET /api/v1/report/users/license/current-usage/json |
Data can be filtered in the same manner as current users report above.
If your request is successful, you should see a response similar to the following:
This report supports only JSON format.
This report does not support standard options (filtering, limiting or ordering).
Response
On success, the license server will return the following response.
Code Block | ||
---|---|---|
| ||
{
| ||
Code Block | ||
{ "success": ${success}true, "msg": ${message}null, "data": [ { "hu": 1, "tu""current": ${usersWithLicensesCount} }, { current}, "hu": 0, "tu""licenseUsage": ${usersWithoutLicensesCount} } ]licenseUsage}, "codelicenseLimit": ${codelicensedUsers}, "totalCount": 2} } |
...
where the response fields can be explained as follows:
Field | Type | Description |
---|
current |
Error code if success equals false, null otherwise.
Example
Say you have many license server. Among them several LM-X servers called 'lm-x 1', 'lm-x 2', and so on. To find out how many users are using licenses (only) from those servers, use:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl --globoff -H "X-Auth-token: token" 'http://yourdomain/api/v1/report/users/license/current-usage/json?filter=[{"type":"string","field":"lsn","value":"lm-x"}]' |
integer | Number of users or user-hosts that are currently using any license on any currently monitored license server. | |
licenseUsage | integer | Number of users or user-hosts that are counted for license usage. This value depends on the licensing model. |
licenseLimit | integer | Number of users or users-hosts that this license server is licensed for. |
Obtaining information about highest license usage
To get to know You can easily list the 10 users that used most licenses in last 13 days, use following URLare using the highest number of licenses by sending the following HTTP request.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
GET /api/v1/report/users/license/highest-usage/json |
Data can be filtered using parameter in the same manner as current users report above.
If your request is successful, you should see a response similar to the following:
Code Block |
---|
{
"success": ${success},
"msg": ${message},
"data": [
{
"un": ${userName},
"fu": ${usersWithLicensesCount}
},
... (9 similar objects)
],
"code": ${code},
"totalCount": 10
} |
where the response fields can be explained as follows:
...
...
...
...
Error code if success equals false, null otherwise.
...
Example
Say you have feature 'super_feature'. To find out which users use this feature (in any version) the most, use:
...
language | js |
---|---|
firstline | 1 |
linenumbers | true |
...
This report supports only JSON format.
This report does not support standard options (filtering, limiting or ordering).
Response
On success, this report will contain up to 10 rows of information about users with the highest number of checked out licenses. Each row consists of the following columns.
Field | Full name | Type | Description |
---|---|---|---|
un | User | string | User name. |
lus | Used | integer | Number of all licenses used by the user. |