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 Uptime endpoint delivers license usage metrics specific to license server status for the currently selected license server during any period the server status was monitored. 

Obtaining information about license server status

You can easily fetch metrics about license server status history by sending the following HTTP request

License Statistics API lets you generate data from the Denials report. This report shows how many license checkout requests were denied and how often the denials took place.

Obtaining information about checkout denials

If you want to retrieve information about denials for username and hostname, we recommend that you use the following URL request template.

Code Block
languagejs
firstline1linenumberstrue
GET /api/v1/report/uptime/denialsserver/${featureIdlicenseServerId}/${returnType}json?sd=${startDateYYYY-MM-DD}&ed=${endDate}&(additional parameters, as needed) 

where:

YYYY-MM-DD}

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

ParameterRequiredTypeDescription
${
featureId
licenseServerId}Yesinteger
Specifies id

Internal License Statistics identification of the

feature which will be the subject of the report.
${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.

license server for which you want to view status information.  

sdYesstring
Specifies starting

Start date

from

for 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

End date

from

for 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.fieldsVisibility Nojson/string

Specifies field visibility settings, for example:

Code Block
languagejs
firstline1
linenumberstrue
{"un": "1", "hn": "1", "ldt": "1", "ldtc":"1"}

where number "1" indicates that a specific field is visible.
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.

rnNostringSpecifies 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": "${un | hn | ldt}",
		"value": "${value}"
	}
]
To filter by numeric column, use the following format: 
Code Block
languagejs
firstline1
[
	{ 
		"type": "numeric", 
		"comparison": "${gt | lt | eq}", 
		"field": "ldtc",
		"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: un, hn, ldt, ldtc.

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: [{
        "un": ${userName},
        "hn": ${hostName},
        "ldt": ${licenseDenialTime},
        "ldtc": ${licenseDenialTotalCount}
      }],
	  "code": ${errorCode},
	  "totalCount": ${totalCount}
  }

where the response fields can be explained as follows:

...

un

...

string

...

Username.

...

hn

...

string

...

Hostname.

...

ldt

...

string

...

License Denial Time in YYYY-MM-DD format

...

ldtc

...

string

...

License Denial Total Count

...

msg

...

string

...

Error message returned on failure.

...

success

...

boolean

...

Indicates if the API request was successfully processed. 

...

For example, say you would like to view denials for feature 3 over some period of time. To generate such data, enter a command that is similar to the following:

Code Block
languagejs
firstline1
linenumberstrue
curl --data "sd=2015-01-01" --data "ed=2015-01-02" -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
languagejs
firstline1
linenumberstrue
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
languagejs
firstline1
linenumberstrue
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/json"

...

the report.

This report supports only JSON format.

This report does not support standard options (filtering, limiting or ordering).

Response

On success, this report will contain one row for each event, such as query failure, server being disabled, successful query after period of failures, etc. See license server status descriptions for further details.

Each row consists of the following columns.

ColumnFull nameTypeDescription

lsucd

Timedate and time

Time when the event occurred.

lssid

Status Id

integer

Numeric value of license server status. See license server status descriptions for further details.

errmsg

Message

string

Optional message describing what went wrong.


Example

The following example shows a command that obtains information about the uptime of license server "1" in January 2017.

Code Block
languagejs
firstline1
linenumberstrue
curl -H "X-Auth-token: token" "http://yourdomain/api/v1/report/denials/3/json?limit=100&offset=0&sd=2014-12-01&ed=2015-01-02"

Obtaining information about grouped checkout denials 

If you want to retrieve information about denials for username and hostname, we recommend that you use the following URL request template. 

Code Block
languagejs
firstline1
linenumberstrue
GET /api/v1/report/denials/grouped/${featureId}/${returnType}?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: 

...

Specifies id of the feature which will be the subject of the report.

...

Yes

...

  • Quarter - 2
  • Month - 3
  • Week - 4
  • Day - 5
  • Hour - 6

...

Specifies field visibility settings, for example:

Code Block
languagejs
firstline1
linenumberstrue
{"ldt": "1", "ldtc":"1"}

where number "1" indicates that a specific field is visible.
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.

...

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": "ldt",
		"value": "${value}"
	}
]
To filter by numeric column, use the following format: 
Code Block
languagejs
firstline1
[
	{ 
		"type": "numeric", 
		"comparison": "${gt | lt | eq}", 
		"field": "ldtc",
		"value": "${value}" 
	}
]

...

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.

...

Code Block
languagejs
firstline1
linenumberstrue
  {
      success: ${success},
      msg: ${message},
      data: [{
        "ldt": ${licenseDenialTime},
        "ldtc": ${licenseDenialTotalCount}
      }]
  }

where the response fields can be explained as follows:

...

ldt

...

string

...

Indicates 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.

...

For example, say you would like to view denials for feature 3 grouped by month. To generate such data, enter a command that is similar to the following:

Code Block
languagejs
firstline1
linenumberstrue
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
languagejs
firstline1
linenumberstrue
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
languagejs
firstline1
linenumberstrue
curl --data "limit=100" --data "offset=0" --data "sd=20132017-01-01" --data "ed=20152017-01-02" --data "grat=631" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/denialsuptime/groupedserver/31/json"

Similarly as in the case of checkout denials, you You can also put parameters directly in into the URL, f.e for an equivalent of the above:. For the above example, the command would look like the following.

Code Block
languagejs
firstline1
linenumberstrue
curl -H "X-Auth-token: token" "http://yourdomain/api/v1/report/denialsuptime/groupedserver/31/json?limit=5&offset=2&sd=20132017-01-01&ed=20152017-01-02&grat=631"