Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

With License Statistics API lets , you generate data from the License Server Uptime report. This report shows can easily generate information about license server uptime, i.e. statistics about license server status for any license server during any period the server status was monitored.

Obtaining information about license server status

...

- $ indicates a variable value that you can replace with an appropriate a proper value, as neededaccording to your needs

- the possible parameters are as follows:

ParameterRequiredTypeDescription
${licenseServerId}Yesinteger

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

Specifies ID of the license server for which you want to view the status information.

sdYesstring

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.

Specifies starting date from which you want to generate the report. The date and time format is YYYY-MM-DD; for example, 2017-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.

Specifies end date from which you want to generate the report. The date and time format is YYYY-MM-DD; for example, 2017-01-20. The date is inclusive, meaning that all data from a particular day will be included in the report.

If your request is successful, you should see a response similar to the following: 

Code Block
languagejs
firstline1
linenumberstrue
  {
      success: ${success},
      msg: ${message},
      data: [{  
         "lsucd":${licenseServerUptimeCheckDateTime},
         "lssid":${licenseServerStatusId},
         "errid":${errorLogId}
      }],
	  "code": ${errorCode},
	  "totalCount": ${totalCount}
  }

...

FieldTypeDescription
success

boolean

Indicates if whether the 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 ID of license server status. Can , which can be one of the following:

IdIDStatus
1UNKNOWN
2UP
3DOWN
4INTERNAL ERROR
5VERIFYING
6DISABLED

errid

integer

Id of error log .

ID of the entry in the License Statistics error log.

codeinteger

Error code if success == false

 

Error code for unsuccessful request.?

totalCountinteger

Count of all matching results.

Total number of all matching results.


Example

For example, say Say you would like to view information about uptime of license server 1 in January of 2015. To generate such data, enter a command that is command similar to the following:

Code Block
languagejs
firstline1
linenumberstrue
curl --data "sd=2015-01-01" --data "ed=2015-01-31" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/uptime/server/1/json"

Keep in mind that you can also put parameters directly in the URL, e.g. for an equivalent of the above:

Keep in mind that you can also put parameters directly into the URL, e.g. to generate data for the above example, the command would look like this:

Code Block
languagejs
firstline1
linenumberstrue
curl -H "X-Auth-token: token" "http://yourdomain/api/v1/report/uptime/server/1/json?sd=2015-01-01&ed=2015-01-31"

Obtaining information about error messages

If you want to retrieve information about error message of any given log, we recommend that you use the following URL request template. 

...

- $ indicates a variable value that you can replace with an appropriate a proper value, as neededaccording to your needs

- possible parameters are as follows: 

ParameterRequiredTypeDescription
${errorId}Yesinteger

Specifies id ID of the error log, for which the error message should be retrieved.

 ??   Do you plan to add anything in this row?


If your request is successful, you should see a response similar to the following:    

Code Block
languagejs
firstline1
linenumberstrue
 {
      success: ${success},
      msg: ${message},
      data: {
        "errmsg": ${errorMessage}
      },
      code: ${code}
 }

where the response fields can be explained as follows:

FieldTypeDescription
success

boolean

Indicates if whether the API request was successfully processed.

msg

string

License Statistics error message returned on failure.

errmsg

string

Requested message for the error log.

The message you want to generate for a specific error log.?

codeinteger

Error code if success == false

Error code for unsuccessful request.?


Example

For example, say you would like to know what was message of error 1. To generate such data, enter a command that is similar to the following:

Code Block
languagejs
firstline1
linenumberstrue
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:

Code Block
languagejs
firstline1
linenumberstrue
curl -H "X-Auth-token: token" "http://yourdomain/api/v1/report/uptime/error/json?errid=1"