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

Compare with Current View Page History

« Previous Version 10 Next »

The License Server Current Usage endpoint delivers license usage metrics specific to the License Server Current Usage, 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 about current usage for a single license server by sending the following HTTP request.

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

To fetch metrics for a license server group, send the following HTTP request.

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

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, XLSX, 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 XLSX. 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 XLSX types. If provided, it cannot be left empty.
filterNojson/string

Applies filtering license usage data on all fields.

To filter by a 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.
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, fu, fbrwd, frvd, ft, futil, fexp, flu

(See this section for more field-specific information.)

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

Response

The following code block shows an example result of a successful request.

{
    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 reserved licenses or "N/A" string if License Reservations are not supported by the license server.
ftintegerTotal licenses for a feature or "Unlimited" string in case of unlimited license.
futilintegerPercentage of feature utilization.
fexpstringFeature expiration date in YYYY-MM-DD format; for example 2017-05-20.

flu

stringFeature last update time in YYYY-MM-DD hh:mm:ss format; for example 2017-05-20 10:15:45.

fiexp

booleanIndicates whether the feature has expired.

msg

stringError message returned on failure.

success

booleanIndicates whether your API request was successfully processed. 
codeintegerError code for unsuccessful request.
totalCountintegerTotal rows.

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

The following example shows a command that downloads data about current usage for license server "7" in XLSX format.

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

Example 2

The following example shows a command that obtains information about features with current usage higher than 90% for license server "13."

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

The following example shows a command that downloads data about current usage for license server group "1" in CSV format.

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