Make remote API more REST-like
The remote API is a really valuable addition to (or part of) ISPconfig since it allows to control ISPconfig from your own custom(er) interface. So my sincere wish would be that it were complete. For almost all objects, there are Create, Get, Update and Delete actions. But there are no consistent implementations of "Get all" actions that depend on a parent. And some "Get" actions require client_id, others on various sys_*ids, etc.
It should be possible for a remote API user, given sufficient access, to walk through every object in the ISPconfig database, without requiring any external information (such as user IDs, system IDs, etc).
Please make the API more consistent and add a search function for each object so that we have e.g.
-
mail_user_get($id)
-
mail_user_get_all($params)
# if$params==[]
, return all. Otherwise use $params to filter -
e.g.
mail_user_get_all(['email' => 'searchuser@domain.co'])
ormail_user_get_all(['autoresponder' => 'y'])
-
client_get($id)
-
client_get_all($params)
# search, e.g.params==['login' => 'myClient']
API 'get' calls should always allow 'get_all' calls to "child objects" in the hierarchy, e.g.
-
servers
- functions
-
users
- DNS zones
- websites
- aliases
- forwards
- email accounts
- spamfilter settings
- email forwards
- DBs
- DB users
- FTP paths
- FTP users
etc.
Would you be interested in a cleaner API design? I can go through the functions and add the missing pieces (at least as stubs).