Post Group: Elite Member
Posts: 437
Status: 
|
Hi,
after testing around with the new API it turns out that it has some usability weakness.
Currently you need to direct the API calls to the server ip/host which you want to query. This should be replaced by an API, that only calls the Master.
Here is why:
If you use the WHMCS module for example, you direct your calls for vm creation to the master only and you setup only one server (the master) in WHMCS, regardless how many slaves you have.
The master (or your settings...) decides on which server the vm will be created.
If you now try to gather usage data you will face a problem.... At the time the data is requested by the whmcs server modules "UsageUpdate" function, it ask (of course) the only server known to whmcs, the master. And you... you have no clue, on which server the vm resides and thus... which server to query.
But the main reason for this suggetion is another one:
If I need to query each server seperately, I need to handle a lot of api keys also. These need to be stored somewhere, New keys need to be added, when new servers are added and the whole logic of retrieving API results needs to be rewritten.
On the other side, if the API calls are directed only to Master, only ONE API key needs to be handled, careless of how many server will be added/removed in the future. The target server could be specified with a param.
Edited by wolke : January 8, 2018, 5:53 pm |