You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

License Statistics API allows you to generate data about license server current usage.

Obtaining information about license server or license server group current usage

If you want to retrieve information about current usage of single license server, use following URL request template.

GET /api/v1/report/license-server/${lsid}/current-usage/${returnType}

If you want to retrieve the information for license server group, use the following one.

GET /api/v1/report/license-server-group/${lsgid}/current-usage/${returnType}

The possible parameters are as follows:

ParameterRequiredTypeDescription
${lsid}YesintegerLicense Server ID.
${lsgid}YesintegerLicense Server Group ID.
${returnType}YesstringSpecifies 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:

{
  "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:

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

 

[
    {
        "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:

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

 

FieldTypeDescription
fidintegerFeature ID.
fnsstringFeature name.
fvstringFeature version.
ftypestringFeature type.
fuintegerNumber of used licenses.
fbrwdintegerNumber of borrowed licenses.
frvdintegerNumber of licenses reservations or string "N/A" if not supported by server.
ftintegerFeature total or string "Unlimited" if so.
futilintegerFeature utilization in percent.
fexpstringFeature expiration date in format YYYY-MM-DD

flu

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

fiexp

booleanWhether feature is expired.

msg

stringError message returned on failure.

success

booleanIndicates if the API request was successfully processed. 
codeintegerError code for unsuccessful request.
totalCountintegerTotal number of rows.

 

Data returned for license server group consists of summary of all features of all license server in the group, including hidden ones. See documentation on license server groups

Example 1

 

To download current usage for license server 7 as an XSL file, enter a command similar to the following:

curl -H "X-Auth-token: token" "http://yourdomain/api/v1/report/license-server/7/current-usage/xsl"

Example 2

To get features of license server 13 which have current usage higher than 90%, enter a command similar to the following:

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

To download current usage for license server group 1 as an CSV file, enter a command similar to the following:

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



  • No labels