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 License Server Current Usage endpoint delivers license usage metrics specific to License Statistics API allows you to generate data from theLicense Server Current Usage page, which shows general information about the license server and its features, allowing you to monitor all the features for the currently selected license server.

Obtaining information about usage for a single license server or usage for a license server group

...

You can easily fetch metrics

...

If you want to retrieve information about current usage of a single license server, we recommend that you use the following URL request templateby sending one of the following HTTP requests.

Code Block
languagejs
titleCurrent usage for a single license server linenumberstrue
GET /api/v1/report/license-server/${lsid}/current-usage/${returnType}

...


Code Block
languagejs
titleCurrent usage for a license server grouplinenumberstrue
GET /api/v1/report/license-server-group/${lsgid}/current-usage/${returnType}

where $ indicates a variable value that you can replace with a value that best suits your needs. The possible parameters are as follows:described below.

ParameterRequiredTypeDescription
${lsid}Yesinteger
License Server ID
Internal License Statistics identification of license server to show usage on.
${lsgid}Yesinteger
License Server Group ID
Internal License Statistics identification of license server group to show usage on.
${returnType}Yesstring
Specifies the format in which license usage data should be returned. The format can be one of the following: json, csv, xls or pdf.fieldsVisibilityNojson/string

Specifies field visibility settings, for example:

Code Block
languagejs
firstline1
linenumberstrue
{
  "fid": "1",
  "fns": "1",
  "fv": "1",
  "ftype": "1",
  "fu": "1",
  "fbrwd": "1",
  "frvd": "1",
  "ft": "1",
  "futil": "1",
  "fexp": "1",
  "flu": "1"
}

where "1" indicates that a specific field is visible and ''0" indicates it is not.

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

NostringSpecifies 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

Applies filtering license usage data on all fields.

To filter by string column, use the following format:

Code Block
languagejs
firstline1
linenumberstrue
[
	{ 
		"type": "string",
		"field": "${ fns | fv | ftype | fexp | flu }",
		"value": "${value}"
	}
]
To filter by a numeric column, use the following format:

 

Code Block
languagejs
firstline1
linenumberstrue
[
    {
        "type": "numeric",
        "comparison": "${gt | lt | eq}",
        "field": "${ fu | fbrwd | frvd | ft | futil}",
        "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.orderByNostringSpecifies the field by which you want to order your data records. The field name can be one of the following:fid, fns, fv, ftype, fu, fbrwd, frvd, ft, futil, fexp, flu.orderDirectionNostringDetermines whether the sorting results will be displayed in ascending (ASC) or 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: [{
        "fid": "${featureId}",
        "fns": "${featureName}",
        "fv": "${featureVersion}",
        "ftype": "${featureType}",
        "fu": "${licensesUsed}",
        "fbrwd": "${licensesBorrowed}",
        "frvd": "${licensesReservations}",
        "ft": "${total}",
        "futil": "${licenseUtilization}",
        "fexp": "${expireDate}",
        "flu": "${lastUsageUpdateDate}",
        "fiexp": "${isExpired}"
    }],
    "code": ${errorCode},
    "totalCount": ${totalNumberOfRecords}
}

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, this report will contain one row for each feature hosted on the license server, or one of the license server groups, that currently has checked out licenses. Each row consists of the following columns.

ColumnFull nameTypeDescriptionVisible by default in export
fidFeature IdintegerInternal License Statistics identification of the feature.
(minus)No
fnsFeature NamestringFeature name.(tick)Yes
fvFeature VersionstringFeature version.(tick)Yes
ftypeFeature TypeenumerationSee feature type descriptions for details.(tick)Yes
fuUsed
FieldTypeDescriptionfidintegerFeature ID.fnsstringFeature name.fvstringFeature version.ftypestringFeature type.fu
integerNumber of used licenses.(tick)Yes
fbrwdBorrowedintegerNumber of borrowed licenses.(tick)Yes
frvdReservedinteger/stringNumber of reserved licenses, or "N/A"
string
  if License Reservations are not supported by the license server.(tick)Yes
ftTotalinteger/stringTotal licenses for a feature or "Unlimited"
string in case of
if an unlimited license.
(tick)Yes
futilUtilizationintegerPercentage of feature utilization.(tick)Yes
fexpFeature Expires
string
dateFeature expiration date
in YYYY-MM-DD format.

fiexp

.(tick)Yes

flu

stringFeature last update time in YYYY-MM-DD hh:mm:ss format.

Last Updatedate and timeTime of last update. For realtime, the time the feature was last seen on the license server.
(tick)Yes

fiexp

Expired
booleanIndicates whether the feature has expired.

msg

stringError message returned on failure.

success

booleanIndicates whether the API request was successfully processed. codeintegerError code for unsuccessful request.totalCountintegerTotal rows
(minus)No

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

Note: Data returned for a license server group consists of a summary of all features of all license servers in the group, including hidden ones. (See License server groups for more information.)

Example 1

Say you want to download statistics The following example shows a command that downloads data about current usage for license server 7 as an XSL file. To generate such data, enter a command similar to the following:"7" in XLSX format.

Code Block
linenumberstrue
curl -H "X-Auth-token: token" "http://yourdomain/api/v1/report/license-server/7/current-usage/xslxlsx"

Example 2

If you want to obtain information The following example shows a command that obtains information about features with current usage higher than 90% for license server 13, enter the following command:"13."

Code Block
linenumberstrue
curl -H "X-Auth-token: token" "http://yourdomain/api/v1/report/license-server/13/current-usage/json" --data-urlencode 'filters=[{"type":"numeric","comparison":"gt","field":"futil","value":"90"}]'

Example 3

Let's assume you want to download statistics The following example shows a command that downloads data about current usage for license server group "1in CSV format. To generate such data, enter a command similar to the following:

Code Block
linenumberstrue
curl -H "X-Auth-token: token" "http://yourdomain/api/v1/report/license-server-group/131/current-usage/csv"