Starting with 8.9.7 we are also exposing a new ‘Get’API. This API would aim to get information from the tool.
General ‘Get’ API
The endpoint for all ‘Get’ requests will look like:
| Code Block |
|---|
|
$ curl "192.168.1.1:5555/?_object=MONyogAPI&_action=get&_details=<resource>&[optional Additional params]&_user=<sqldm user name>&_password=<sqldm user password>” |
_action: Should be ‘get’_details: the The value of this will determine what data to be fetched
...
getlicenseinfo
API to fetch license-related details:
| Code Block |
|---|
|
$ curl "[IP]/?_object=MONyogAPI&_action=get&_details=getlicenseinfo&_user=<sqldm user name>&_password=<sqldm user password>” |
_details=getlicenseinfo- The API will return:
RegNameExpiry date (time in seconds)Current versionMaxServerLimit
- If a non-admin users fetch the API, then the
ExpiryDate and MaxServerLimit will not be returned - Return format JSON
- For the trial build
Regname will be empty and no ExpiryDate and MaxServerLimit will be sent
...
Example
| Code Block |
|---|
|
$ curl"34.225.194.88:5555/?_object=MONyogAPI&_action=get&_details=getlicenseinfo&_user=admin" |
...
- {"STATUS": "SUCCESS", "RESPONSE": "{ "Version": "8.9.7", "RegName": "Ankush" , "ExpiryDate":1868745599, "MaxServerLimit": 400 }"} |
| Code Block |
|---|
|
$ curl "192.168.1.1:5555/?_object=MONyogAPI&_action=addserver&_user=admin
&_server=Production&_mysqlhost=127.0.0.1&_mysqluser=admin
&_mysqlport=3306&_mysqlpassword=adminpassword" |
...