The License Server Uptime endpoint delivers metrics that License Statistics collects from the monitored license server. This endpoint is used to fetch license usage metrics specific to license server status for the currently selected license server during any period the server status was monitored.
...
You can easily fetch metrics about license server status history by calling this sending the following HTTP GET request:.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
GET /api/v1/report/uptime/server/${licenseServerId}/json?sd=${startDate}&ed=${endDate} |
where $ indicates a variable value that you can replace with a value that best suits your needs and the possible parameters are can be explained as follows:
Parameter | Required | Type | Description |
---|---|---|---|
${licenseServerId} | Yes | integer | Specifies ID of the license server for which you want to view the status information. |
sd | Yes | string | Specifies starting date from which you want to generate the report. The date is in YYYY-MM-DD format; for example, 2017-05-20. |
ed | Yes | string | Specifies Specifies end date from which you want to generate the report. The date is in YYYY-MM-DD format; for example, 2017-05-20. The date is inclusive, meaning that all data from a particular day will be included in the report. |
The following code block shows an example result of a successful request:.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{ success: ${success}, msg: ${message}, data: [{ "lsucd":${licenseServerUptimeCheckDateTime}, "lssid":${licenseServerStatusId}, "errid":${errorLogId} }], "code": ${errorCode}, "totalCount": ${totalCount} } |
where the response fields can be explained as follows:.
Field | Type | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
success | boolean | Indicates that whether your API request was successfully processed. | ||||||||||||||
msg | string | Error message returned on failure. | ||||||||||||||
lsucd | string | Date and time when License Statistics checked if license server was up. | ||||||||||||||
lssid | integer | ID of license server status, which can be one of the following:
| ||||||||||||||
errid | integer | ID of the entry in the License Statistics error log. | ||||||||||||||
code | integer | Error code for unsuccessful request. | ||||||||||||||
totalCount | integer | Total number of all matching results. |
Example
Say you would like to view obtain information about uptime of license server "1" in January 2017. To generate such this data set, enter a command similar to the following:.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl --data "sd=2017-01-01" --data "ed=2017-01-31" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/uptime/server/1/json" |
Please keep in mind that you can also put parameters directly into the URL, e.g. ;for example, to generate data for the above example, the command would look like this:.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl -H "X-Auth-token: token" "http://yourdomain/api/v1/report/uptime/server/1/json?sd=2017-01-01&ed=2017-01-31" |
...
You can easily list error messages of for any given log by calling this sending the following HTTP GET request:.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
GET /api/v1/report/uptime/error/json?errid=${errorId} |
where $ indicates a variable value that you can replace with a value that best suits your needs and the possible parameters are can be explained as follows:.
Parameter | Required | Type | Description |
---|---|---|---|
${errorId} | Yes | integer | Specifies ID of the error log for which the error message should be retrieved. |
The following code block shows an example result of a successful request:.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{ success: ${success}, msg: ${message}, data: { "errmsg": ${errorMessage} }, code: ${code} } |
...
Example
Say you would like to know what was message of error 1view the message for error "1". To generate such this data set, enter a command that is command similar to the following:.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl --data "errid=1" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/uptime/error/json" |
Similarly, as in the case of license server uptime, you can also put parameters directly in the URL, f.e for an equivalent of the above use the ; for example, to view the message for error "1", use a command similar to this one:the one you can see below.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl -H "X-Auth-token: token" "http://yourdomain/api/v1/report/uptime/error/json?errid=1" |