The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XML API Callback's for bandwidth and disk quota exceeded/warning it will exceed

Discussion in 'cPanel Developers' started by jordan120, Oct 17, 2009.

  1. jordan120

    jordan120 Registered
    PartnerNOC

    Joined:
    Jan 6, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
  2. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    At the present time we do not provide functionality that is like what you've described. The end goal might still be possible but it is dependent upon creating a custom script that performs the requested functions, including checking for the desired information and passing it on (in a "call-back"); a cron entry could be used to automate the process of having the custom script perform its checks at predefined intervals.
     
  3. jdelsman

    jdelsman Registered

    Joined:
    Nov 11, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    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?
     
  4. MattDees

    MattDees cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    At this point, this feature is not on our roadmap, we agree that a feature like this may be useful, however there are some ways to get (some) of the information that you are talking about. Please open a feature request in the feature request forum so that other users can comment on this idea and we can see the demand/public discussion of a feature like this.

    If you look at our functionhooks feature it does something very similiar to this, however this only exists for the cPanel interface and not the WHM interface.

    For some of the actions you are talking about, script hooks do exist (please review ScriptHooks < DevHooks < TWiki )

    These can be used to create a callback like what you are describing.

    As for things like bandwidth notifications, nothing is able to hook into that system at this time, I am adding a feature request (for review by our development to decide of feasibility, roadmap, etc) to add in hooks for bandwidth & diskspace processing.
     
Loading...

Share This Page