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 Feature Usage endpoint delivers license usage metrics specific to the Current Feature Usage,License Statistics API allows you to obtain information about Current Feature Usage. The report consists of two parts: Current Feature Usage grid that shows usage at current moment, and Feature Usage chart, that shows how usage was shaped during the day allowing you to monitor statistics for the currently selected feature on the license server of your choosing.

Obtaining information about current feature usage

To get data You can easily fetch metrics about current feature usage use following URL template:for a given feature by sending the following HTTP request.

Code Block
languagejs
firstline1linenumberstrue
GET /api/v1/report/feature/${featureId}/current-usage/${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.

Applies filtering license usage data on all fields.

To filter by string column, use the following format: 

Parameter
Required
Type
Description
${featureId}Yesinteger/stringId Internal LicStat identification of the feature for which you want to get dataview current usage.
${returnType}YesstringSpecifies 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
languagejs
firstline1
{ "uid": "1", "un": "1", "hn": "1", "lus": "1", "lco": "1", "tu": "1", "lbe": "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.
filterNojson/string
Code Block
languagejs
firstline1
[
    {
        "type": "string",
        "field": "${un | hn | lco | lbe}",
        "value": "${value}"
    }
]

To filter by numeric column, use the following format: 

Code Block
[
    {
        "type": "numeric",
        "comparison": "${gt | lt | eq}",
        "field": "${uid, 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: un, hn, lus, lco, tu, lbe.

orderDirectionNostringDetermines whether the sorting results will be displayed in an ascending (ASC) or a descending (DESC) order.

 If your request is successful, you should see a response similar to the following: 

Code Block
languagejs
firstline1
linenumberstrue
{
    success: ${success},
    msg: ${message},
    data: [{
        "uid": ${userId},
        "un": ${userName},
        "hn": ${hostName},
        "lus": ${licensesUsed},
        "lco": ${checkoutTime},
        "tu": ${licensesUsed},
        "lbe": ${borrowExpire},
        "uil": ${ldapUser}
    }],
    "code": ${errorCode},
    "totalCount": ${totalCount}
}

where the response fields can be explained as follows: 

Standard format option. See Making an API request for details.
standard report options Novarious

See Making an API request for details.

Response

On success, the report will contain one row for each license session for a specified feature. Each row consists of the following columns.


Column
Full name
Type
Description
Visible by default in export

uid

User Id

integer

Internal License Statistics identification of user that checked out licenses.

(minus)No

un

User

string

Name of user that checked out licenses.

(tick)Yes

hn

Host

string

Name of host where licenses were checked out to.

(tick)Yes

lus

Used
Field
Type
Description
uidintegerUser ID.
un
stringUsername.
hn
stringHostname.lus

integer

Total number of licenses used by user on host.

(tick)Yes

lco

Checked Out

date and time

string

Date when

license was checked out, in 'YYYY-MM-DD HH:MM' format.

licenses were checked out.

(tick)Yes
tuTime Usedstring

How long the licenses have been in use. Note that you cannot filter on this field.

(tick)Yes

lbe

Borrow Expiration

date and time

Borrow expiration date. Returns an empty string if not applicable.

(tick)Yes

uil

User is from LDAP

lbe

string

Borrow expiration date, in 'YYYY-MM-DD HH:MM' format.

uil

boolean

Indicates whether user details have been imported from an LDAP directory. Note that you cannot filter and order data by this field.

msg

string

Error message returned on failure.

success

boolean

Indicates whether the API request was successfully processed. 

codeinteger

Error code for unsuccessful request.

totalCountinteger

Total number of all matching results.

(error) Unavailable

Note that the order in the table is the default order of the columns in the exported file.

 Example

Say you would like to download data in a CSV file  If you want to obtain information about current feature usage for feature 1 in CSV format"1". To generate this data set, enter a command similar to this one: the following.

Code Block
linenumberstrue
curl -H "X-Auth-token: token" "http://yourdomain/api/v1/report/feature/1/current-usage/csv"

Obtaining information about feature usage during given day

To get data You can easily fetch metrics about feature usage during selected day use following URL template:a given day by sending the following HTTP request.

Code Block
languagejs
firstline1
linenumberstrue
GET /api/v1/report/feature/${featureId}/usage/chart/json?day=${dayYYYY-MM-DD}

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
${featureId}YesintegerId Internal License Statistics identification of the feature for which you want to get data.
${day} NostringdateIndicates day for which you want to gather Date in format 'YYYY-MM-DD'. States for which day we want to get the data. If not provided, it defaults to today

 

If your request is successful, you should see a response similar to the following: 

 

Code Block
languagejs
firstline1
linenumberstrue
{
    success: ${success},
    msg: ${message},
    data: [{
        "fid": ${featureId},
        "lud": ${dateAndTime},
        "ltc": ${totalCount},
        "lumax": ${licenseUsageMax},
        "lbmax": ${licensesBorrowedMax}
    }],
    "code": ${errorCode},
    "totalCount": ${totalCount}
}

where the response fields can be explained as follows:

.

This report supports only JSON format.

Response

On success, this report will contain one row for each 5-minute-long period with usage statistic for the specified feature throughout the period.

Periods are from midnight, each 5 minutes (00:00-00:05, 00:05-00:10, 00:10-0:15, ...).

Each row consists of the following columns: 


Column
Full name
Type
Description
fidFeature IDintegerReturn specified feature ID from request.
ludPeriod Startdate and timeBeginning of the period.
ltcTotalintegerTotal number of licenses available for feature in the period.
lumaxMax Used
Field
Type
Description
fidintegerFeature ID.ludstringDate and time (adjusted to 5 minute intervals).ltcintegerLicense total count.lumax
integerMaximum amount of used licenses during the period.
lbmaxMax BorrowedintegerMaximum amount of borrowed licenses
.

msg

string

Error message returned on failure.

success

boolean

Indicates whether the API request was successfully processed. 

codeinteger

Error code for unsuccessful request.

totalCountintegerTotal number of all matching results
during the period.