Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


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 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.

Code Block
languagejs
firstline1
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 are as follows:described below.

Parameter
Required
Type
Description
${returnType}Yesstring
Specifies the format in which the data should be returned. The format can be one of the following: json, csv, xls or pdf.fieldsVisibility Nojson/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","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.

rnNostringSpecifies 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 Anchorfilter deffilter defNojson/string

Applies filtering license usage data on all fields.

To filter by a string column, use the following format:

 

Code Block
[
    {
        "type": "string",
        "field": ""${un | hn | fns | fv | ftype | lsn | lco}",
        "value": "${value}"
    }
]

To filter by a numeric column, use the following format: 

Code Block
[
    {
        "type": "numeric",
        "comparison": "${gt | lt | eq}",
        "field": "${fid | lsid | lus }",
        "value": "${value}"
    }
]
limitNointegerDetermines the maximum number of data records that can be returned. The value must be greater than zero.offsetNointegerSpecifies the offset of the first row to return.orderByNostring

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.)

orderDirectionNostringDetermines 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:

 

Code Block
languagejs
firstline1
linenumberstrue
{
    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}
}

...

Standard format option. See Making an API request page for details.
standard report optionsNovarious

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.

...

Field
Type
Description
fidintegerFeature ID.fnsstringFeature Name.ftypestringFeature type.fvstringFeature version.lsidintegerLicense Server ID.lsnstringLicense Server name.uidintegerUser 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

Column
Full name
Type
DescriptionVisible by default in export
uidUser IdintegerInternal License Statistics identification of user that checked out licenses.(tick)Yes

un

User

string

Name of user that checked out licenses.(tick)Yes

hn

Host

string

Host on which licenses were checked out.(tick)Yes
fidFeature IdintegerInternal License Statistics identification of the used feature.(tick)Yes
fnsFeature NamestringName of the used feature.(tick)Yes
fvFeature VersionstringVersion of the used feature.(tick)Yes
ftypeFeature TypeenumerationType of the used feature. See feature type descriptions for further details.(tick)Yes

lus

Used

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. 

codeinteger

Error code for unsuccessful request.

totalCountintegerTotal number of all matching results
(tick)Yes

lco

Checked Out

date and time

Time when licenses were checked out.(tick)Yes
lsid

License Server Id

integerInternal License Statistics identification of server hosting the used feature.(tick)Yes
lsnLicense ServerstringName of server hosting the used feature.(tick)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

...

Code Block
languagejs
firstline1
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:

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
Code Block
languagejs
{
    "success": ${success}true,
    "msg": ${message}null,
    "data": [
        {          
            "hu": 1,           
            "tucurrent": ${usersWithLicensesCount}
        },
        {          
            "hu": 0,           
      current},
      "tulicenseUsage": ${usersWithoutLicensesCount}
        }
    ]licenseUsage},
    "codelicenseLimit": ${codelicensedUsers},
    "totalCount": 2}
}

where the response fields can be explained as follows:


Field
Type
Description
success
current
booleanIndicates whether your API request was successfully processed.
integer
Number of users or user-hosts that are currently using any license on any currently monitored license server.
licenseUsage
msgstringError message returned on failure.hustring"1" in record with usage. "0" for record without usage.
tu
integerNumber of users
with/without usage.codeinteger

Error code if success equals false, null otherwise.

totalCountintegerTotal 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.

...

languagejs
firstline1
linenumberstrue

...

or user-hosts that are counted for license usage. This value depends on the licensing model.
licenseLimitintegerNumber of users or users-hosts that this license server is licensed for.

Obtaining information about highest license usage

You can easily list the 10 users that are using the highest number of licenses by sending the following HTTP request.

Code Block
languagejs
firstline1
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:

Code Block
{
    "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

...

Error code if success equals false, null otherwise.

...

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.

...

languagejs
firstline1
linenumberstrue

...

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
unUserstringUser name.
lusUsedintegerNumber of all licenses used by the user.