License Statistics API lets you generate data from the Expiring Features report. This report shows statistics for features expiring in the future.
Obtaining information about expiring features
If you want to retrieve information about expiring features, we recommend that you use the following URL request template.
GET /api/v1/report/expiry/server/${licenseServerId}/json?sd=${startDate}&ed=${endDate}$(additional parameters, as needed)
where
- $ indicates a variable value that you can replace with an appropriate value, as needed
- possible parameters are as follows:
Parameter | Required | Type | Description |
---|---|---|---|
${licenseServerId} | Yes | integer/string | Specifies id of license server for which we want to gather data about feature expirations. It can also be set to 'all' to gather data from all servers . |
${returnType} | Yes | string | Specifies the format in which license data will be returned. The format can be one of the following: json, csv, xls, xlsx or pdf. |
sd | No | string | Specifies the start date for which the report will be generated in YYYY-MM-DD format; for example, 2017-01-20. If not provided it defaults to today |
ed | No | string | Specifies the end date for which the report will be generated in YYYY-MM-DD format; for example, 2017-01-27. If not provided it defaults to [today + 12 months] |
rn | No | string | Specifies 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. |
filter | No | json/string | Applies filtering license usage data on all fields. To filter by string column, use the following format: [ { "type": "string", "field": "${fns | ftype | fexp | lsn | vn | fv}", "value": "${value}" } ] To filter by numeric column, use the following format: [ { "type": "numeric", "comparison": "${gt | lt | eq}", "field": "${fid | lsid}", "value": "${value}" } ] |
fieldsVisibility | No | json/string | Specifies field visibility settings, like this: { "fns": "1", "fv": "1", "ftype": "1", "vn": "1", "lsn": "1", "fexp": "1" } where "1" indicates that a specific field is visible and ''0" indicates that 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. |
limit | No | integer | Determines the maximum number of data records that can be returned. The value must be greater than zero. |
offset | No | integer | Specifies the offset of the first row to return. |
orderBy | No | string | Specifies the field by which you want to order your data records. The field name can be one of the following: fns | fv | ftype | vn | lsn | fexp |
orderDirection | No | string | Determines 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}, "ftype": ${featureType}, "fv": ${featureVersion}, "fexp": ${featureExpires}, "lsid": ${licenseServerId}, "lsn": ${licenseServerName}, "vn": ${licenseServerVendorName}, } ], "code": ${code}, "totalCount": ${count} }
where the response fields can be explained as follows:
Field | Type | Description |
---|---|---|
success | boolean | Indicates that your API request was successfully processed. |
msg | string | Error message returned on failure. |
fid | integer | Feature ID. |
fns | string | Feature Name. |
ftype | string | Feature Type. |
fv | string | Feature Version. |
fexp | string | Feature Expires (feature expiration date). |
lsid | integer | License Server Id. |
lsn | string | License Server Name. |
vn | string | License Server Vendor Name. |
code | integer | Error code if success equals false, null otherwise. |
totalCount | integer | Total number of rows returned. |
Example 1
For example, say you would like to view all features expiring in next 12 months on all of you license servers. To generate such data, enter a command that is similar to the following:
curl -H "X-Auth-token: token" "http://yourdomain/api/v1/report/expiry/server/all/json"
Example 2
For example, say you would like to view all features expiring in some period of time on one of your license servers that have licenseServerId=1. To generate such data, enter a command that is similar to the following:
curl --data "sd=2015-01-01" --data "ed=2015-03-01" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/expiry/server/1/json"
Obtaining information about expiring features amounts in some period of time
If you want to retrieve information about how many features expires in some period, we recommend that you use the following URL request template.
GET /api/v1/report/expiry/server/{licenseServerId}/count/grouped/json?sd=${startDate}&ed=${endDate}&granularity=${granularity}&filter=${filter}
Parameters are as follows
Parameter | Required | Type | Description |
---|---|---|---|
licenseServerId | Yes | array | Arrays of feature IDs in the following format: id1, id2, id3... for example fi=1,2,3,5. |
sd | No | string | Specifies the start date for which the report will be generated in YYYY-MM-DD format; for example, 2017-01-20. If not provided defaults to today. |
ed | No | string | Specifies the end date for which the report will be generated in YYYY-MM-DD format; for example, 2017-01-27. If not provided defaults to [today + 12 months] |
granularity | No | integer | Specifies granularity of the returned data, which can be one of the following (defaults to Month):
|
filter | No | string | Applies filtering license usage data on all fields. To filter by string column, use the following format: [ { "type": "string", "field": "${fns | ftype | fexp | lsn | vn | fv}", "value": "${value}" } ] To filter by numeric column, use the following format:
[ { "type": "numeric", "comparison": "${gt | lt | eq}", "field": "${fid | lsid}", "value": "${value}" } ] |
If your request is successful, you should see a response similar to the following:
{ "success": ${success}, "msg": ${message}, "data": [ { "fexpy": ${featureId}, "fexpm": ${featureName}, "fexpc": ${featureVersion}, "granularity": ${granularity} } ], "code": ${code}, "totalCount": ${count} }
where the response fields can be explained as follows:
Field | Type | Description |
---|---|---|
success | boolean | Indicates that your API request was successfully processed. |
msg | string | Error message returned on failure. |
fexpy | integer | Year |
fexpm | integer | Number of period |
fexpc | integer | Count of expiring features in period |
granularity | integer | Period granularity:
|
code | integer | Error code if success equals false, null otherwise. |
totalCount | integer | Total number of rows returned. |
Example 1
For example, say you would like to get count of features that expire every month in next 12 months on all your servers. To generate such data, enter a command that is similar to the following:
curl -H "X-Auth-token: token" "http://yourdomain/api/v1/report/expiry/server/all/count/grouped/json"
Example 2
For example, say you would like to get count of features that expire every week in some period of time on server with id 1. To generate such data, enter a command that is similar to the following:
curl --data "sd=2015-01-01" --data "ed=2015-03-01" --data "granularity=4" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/expiry/server/1/count/grouped/json"