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 using
Obtaining information about current users
You can easily list users who are currently using at least one license by sending the following HTTP request.
GET /api/v1/report/users/current/${returnType}
where $ indicates a variable value that you can replace with a value that best suits your needs and the possible parameters can be explained as follows.
Parameter | Required | Type | Description |
---|---|---|---|
${returnType} | Yes | string | Specifies the format in which the data should be returned. The format can be one of the following: json, csv, xls or pdf. |
fieldsVisibility | No | json/string | Specifies field visibility settings, for example: { "fid": "1", "fns": "1", "fv": "1", "ftype": "1", "lsid": "1", "lsn": "1", "uid": "1", "un": "1", "hn": "1", "lco": "1","lus": "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. |
rn | No | string | Specifies the name of the report that will be displayed once the report has been exported to PDF or XLS. For CSV and JSON formats this parameter will be ignored. If you don't pass this parameter, it will be generated automatically for PDF and XLS types. If provided, it cannot be left empty. |
filter | No | json/string | Applies filtering license usage data on all fields. To filter by a string column, use the following format:
[ { "type": "string", "field": ""${un | hn | fns | fv | ftype | lsn | lco}", "value": "${value}" } ] To filter by a numeric column, use the following format: [ { "type": "numeric", "comparison": "${gt | lt | eq}", "field": "${fid | lsid | lus }", "value": "${value}" } ] |
limit | No | integer | Determines the maximum number of data records that can be returned. The value must be greater than zero. |
offset | No | integer | Specifies the offset of the first row to return. |
orderBy | No | string | 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, lus (See this section for more field-specific information.) |
orderDirection | No | string | Determines whether the sorting results will be displayed in an ascending (ASC) or a descending (DESC) order. |
The following code block shows an example result of a successful request.
{ 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}, "lus": ${licensesUsed} }], "code": ${errorCode}, "totalCount": ${totalCount} }
where the response fields can be explained as follows:
Field | Type | Description |
---|---|---|
fid | integer | Feature ID. |
fns | string | Feature Name. |
ftype | string | Feature type. |
fv | string | Feature version. |
lsid | integer | License Server ID. |
lsn | string | License Server name. |
uid | integer | User ID. |
un | string | Username. |
hn | string | Hostname. |
lco | string | Date when license was checked out. The date is in YYYY-MM-DD HH:MM:SS format; for example; 2017-05-20 10:55:15. |
lus | integer | Total number of licenses used by user on host. |
msg | string | Error message returned on failure. |
success | boolean | Indicates whether your API request was successfully processed. |
code | integer | Error code for unsuccessful request. |
totalCount | integer | Total number of all matching results. |
Obtaining information about current license usage
You can easily list users that are currently using at least one license by sending the following HTTP request.
GET /api/v1/report/users/license/current-usage/json
You can filter your data results using the filter parameter, as described above.
The following code block shows an example result of a successful request.
{ "success": ${success}, "msg": ${message}, "data": [ { "hu": 1, "tu": ${usersWithLicensesCount} }, { "hu": 0, "tu": ${usersWithoutLicensesCount} } ], "code": ${code}, "totalCount": 2 }
where the response fields can be explained as follows.
Field | Type | Description |
---|---|---|
success | boolean | Indicates whether your API request was successfully processed. |
msg | string | Error message returned on failure. |
hu | string | "1" in record with usage. "0" for record without usage. |
tu | integer | Number of users with/without usage. |
code | integer | Error code if success equals false, null otherwise. |
totalCount | integer | Total number of rows returned. Always 2. |
Example
Say you have many license servers, some of which are LM-X servers called 'lm-x 1', 'lm-x 2', etc. To find out how many users are using licenses (only) from those servers, enter a command similar to the following.
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"}]'
Obtaining information about highest license usage
You can easily list 10 users that are using the highest number of licenses by sending the following HTTP request.
GET /api/v1/report/users/license/highest-usage/json
You can filter your data results using the filter parameter, as described above.
The following code block shows an example result of a successful request.
{ "success": ${success}, "msg": ${message}, "data": [ { "un": ${userName}, "lus": ${usersWithLicensesCount} } ], "code": ${code}, "totalCount": ${totalCount} }
where the response fields can be explained as follows:
Field | Type | Description |
---|---|---|
success | boolean | Indicates whether your API request was successfully processed. |
msg | string | Error message returned on failure. |
un | string | Username. |
lus | integer | Number fo licenses used. |
code | integer | Error code if success equals false, null otherwise. |
totalCount | integer | Total number of rows returned. Up to 10. |
Example
Say you have a feature called 'super_feature' and you would like to obtain information about users that use this feature (in any version) most. To generate this data set, enter a command similar to the following.
curl --globoff -H "X-Auth-token: token" 'http://yourdomain/api/v1/report/users/license/highest-usage/json?filter=[{"type":"string","field":"fns","value":"super_feature"}]'