I have actually been told by two separate cPanel staff that this is being looked into. Is this actually in the roadmap, or not? If not, can this be entered as a feature request? I think I can clarify what Jordan is asking a bit better...
Ideally, I envision an area in cPanel where an administrator could enter a callback URL, let's say http://remote.application/callbacks/cpanel.json, with which cPanel would send a POST request on a few configurable actions. A couple that come to mind are:
- When a user goes over their bandwidth limit
- When a user is suspended
- When a user is unsuspended
- When a user is terminated
- etc.
Basically, it is hard for developers to build software applications which need to call to cPanel every hour or more to get this type of information, or build a separate cron task for every server... not to mention costly in terms of load required to perform the actions. The alternative, which is what I am proposing, would send a simple XML/JSON string in a POST request letting the remote application know that something happened. Here is an example:
Code:
<cpanel>
<notification>
<type>suspension</type>
<created-at>Sun Oct 18 00:22:23 BST 2009</created-at>
<attributes>
<username>seeddata09</username>
<reason>Bandwidth overage</reason>
...
</attributes>
</notification>
</cpanel>
Attributes pertaining specifically to the notification would go inside the attributes node. This would be a much less resource intensive way to gather data from a server when events occur, it would make tonnes of developers ecstatic, and I have a feeling it would not be that hard to implement.
What do you guys think?