License Statistics API lets you generate data from the DenialsLicense Server Uptime report. This report shows how many license checkout requests were denied and how often the denials took placeshows license server status for the currently selected license server during any period the server status was monitored.
Obtaining information about
...
license server status
If you want to retrieve information about denials for username and hostnamelicense server status history, we recommend that you use the following URL request template.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
GET /api/v1/report/denialsuptime/server/${featureIdlicenseServerId}/${returnType}json?sd=${startDate}&ed=${endDate}&(additional parameters, as needed) |
where:
- $ indicates a variable value that you can replace with an appropriate value, as needed
...
Parameter | Required | Type | Description | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
${featureIdlicenseServerId} | Yes | integer | string Specifies id of the feature which will be the subject of the report. | ${returnType} | Yes | Specifies the format in which license usage data should be returned. The format can be one of the following: json, csv, xls or pdf. | ||||||||||||||
sd | Yes | string | Specifies starting date from which you want to generate the report. The date and time format is as follows: YYYY-MM-DD, for example, 2015-01-20. | |||||||||||||||||
ed | Yes | string |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{"un": "1", "hn": "1", "ldt": "1", "ldtc":"1"} |
Note that the order of the settings you make is important – when exported, the fields will be visible
If
...
Applies filtering license usage data on all fields.
To filter by string column, use the following format:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
[
{
"type": "string",
"field": "${un | hn | ldt}",
"value": "${value}"
}
] |
Code Block | ||||
---|---|---|---|---|
| ||||
[
{
"type": "numeric",
"comparison": "${gt | lt | eq}",
"field": "ldtc",
"value": "${value}"
}
] |
...
your
...
If your request is successful, you should see a response similar to the following:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{ success: ${success}, msg: ${message}, data: [{ "un": ${userName}, "hnlsucd": ${hostNamelicenseServerUptimeCheckDateTime}, "ldtlssid": ${licenseDenialTimelicenseServerStatusId}, "ldtcerrid": ${licenseDenialTotalCounterrorLogId} }], "code": ${errorCode}, "totalCount": ${totalCount} } |
where the response fields can be explained as follows:
Field | Type | Description | un||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
success | string | Username. | boolean | Indicates if the API request was successfully processed. | ||||||||||||
msg | hnstring | HostnameError message returned on failure. | ||||||||||||||
ldtlsucd | string | License Denial Time in YYYY-MM-DD format | ||||||||||||||
ldtc | string | License Denial Total Count | ||||||||||||||
msg | string | Error message returned on failure. | ||||||||||||||
Date and time when License Statistics checked if license server was up. | ||||||||||||||||
lssid | integer | Id of license server status. Can be one of the following:
| ||||||||||||||
errid | integer | success | boolean | Indicates if the API request was successfully processed.Id of error log |
| |||||||||||
code | integer | Error code if success == false | ||||||||||||||
totalCount | integer | Count of all matching results. |
Example 1
For example, say you would like to view denials for feature 3 over some period of timeinformation about uptime of license server 1 in January of 2015. To generate such data, enter a command that is similar to the following:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl --data "sd=2015-01-01" --data "ed=2015-01-0231" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/denials/3/json" |
Example 2
Let's assume you want to see all denials for feature 3 ordered by username over a specific period of time. To do this, enter a command similar to the following:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl --data "orderBy=un" --data "orderDirection=ASC" --data "sd=2015-01-01" --data "ed=2015-01-02" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/denials/3/json" |
Example 3
Let's assume you're interested in viewing the first 100 denials for feature 3 over a specific period of time. To do this, enter a command that is similar to the following:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl --data "limit=100" --data "offset=0" --data "sd=2015-01-01" --data "ed=2015-01-02" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/denials/3/uptime/server/1/json" |
Keep in mind that you can also put parameters directly in the URL, fe.g. e for an equivalent of the above:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl -H "X-Auth-token: token" "http://yourdomain/api/v1/report/uptime/denialsserver/31/json?limit=100&offset=0&sd=20142015-1201-01&ed=2015-01-0231" |
Obtaining information about
...
error messages
If you want to retrieve information about denials for username and hostnameerror message of any given log, we recommend that you use the following URL request template.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
GET /api/v1/report/denialsuptime/grouped/${featureId}/${returnType}?sderror/json?errid=${startDate}&ed=${endDate}&(additional parameters, as needed) errorId} |
where:
- $ indicates a variable value that you can replace with an appropriate value, as needed
...
Parameter | Required | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
${featureIderrorId} | Yes | integer | Specifies id of the feature which will be the subject of the report. | |||||||||
${returnType} | Yes | string | Specifies the format in which license usage data should be returned. The format can be one of the following: json, csv, xls or pdf. | |||||||||
sd | Yes | string | Specifies starting date from which you want to generate the report. The date and time format is as follows: YYYY-MM-DD, for example, 2015-01-20. | |||||||||
ed | Yes | string | Specifies end date from which you want to generate the report. Date format as above. Date is inclusive, meaning all data from the particular day will be included in the report. | |||||||||
granularity | Yes | integer | Specifies granularity of the returned data, which can be one of the following:
| |||||||||
fieldsVisibility | No | json/string | Specifies field visibility settings, for example:
where number "1" indicates that a specific field is visible. | |||||||||
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. If you don't pass this parameter, it will be generated automatically for PDF and XLS types. If provided, it cannot be left empty. | filter | No | json/string |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
[
{
"type": "string",
"field": "ldt",
"value": "${value}"
}
] |
Code Block | ||||
---|---|---|---|---|
| ||||
[
{
"type": "numeric",
"comparison": "${gt | lt | eq}",
"field": "ldtc",
"value": "${value}"
}
] |
error log, for which message should be retrieved.
Specifies the field by which you want to order your data records. The field name can be one of the following: un, hn, ldt, ldtc.
If your request is successful, you should see a response similar to the following:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{ success: ${success}, msg: ${message}, data: [{ "ldterrmsg": ${licenseDenialTimeerrorMessage}, "ldtc": ${licenseDenialTotalCount}, code: ${code}] } |
where the response fields can be explained as follows:
Field | Type | Description | ldt | stringIndicates period of time for which usage information is generated, i.e. date and time for hourly usage and dates for the remaining granularity options. | |
---|---|---|---|---|---|
ldtc | string | License Denial Total Count | |||
msg | string | Error message returned on failure. | |||
success | boolean | Indicates if the API request was successfully processed. | |||
msg | string | Error message returned on failure. | |||
errmsg | string | Requested message for error log | |||
code | integer | Error code if success == false | totalCount | integer | Count of all matching results. |
Example 1
For example, say you would like to view denials for feature 3 grouped by monthknow what was message of error 1. To generate such data, enter a command that is similar to the following:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl --data "sd=2015-01-01" --data "ed=2015-01-02" --data "grat=3" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/denials/grouped/3/json" |
Example 2
Let's assume you want to see all denials for feature 3, grouped by quarter, ordered by total denial count from highest to lowest. To do this, enter a command similar to the following:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl --data "orderBy=ldtc" --data "orderDirection=DESC" --data "sd=2014-01-01" --data "ed=2015-01-01" --data "grat=2" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/denials/grouped/3/json" |
Example 3
Let's assume you're interested in viewing the first 100 denials for feature 3 over a specific period of time, grouped by hour. To do this, enter a command that is similar to the following:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl --data "limit=100" --data "offset=0" --data "sd=2013-01-01" --data "ed=2015-01-02" --data "grat=6"errid=1" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/denialsuptime/groupederror/3/json" |
Similarly as in the case of checkout denialslicense server uptime, you can also put parameters directly in the URL, f.e for an equivalent of the above:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl -H "X-Auth-token: token" "http://yourdomain/api/v1/report/denialsuptime/groupederror/3/json?limit=5&offset=2&sd=2013-01-01&ed=2015-01-02&grat=6errid=1" |