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.

CpanelAppz.com WHM/cpanel API

Discussion in 'cPanel Developers' started by anand, Sep 22, 2004.

  1. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    We have been working on a cpanel api from sometime now. The api is under beta release and is undergoing internal testing before its released. Many functions have already been developed and are tested working perfect.

    The api is targeted towards developers who want to access whm functions however can't because of lack of api / documentation. The api tries to fill that gap.

    All functions are accompanied with working demos so they can be used out of the box to plugin inside scripts.

    The present functions working are:

    Service Status : This function returns your server's service's status.
    Server Information : This function returns complete server information.
    Account List : Allows you to get accounts listing on the server. Has many multiple options, allows to show only certain details about a domain. Developer has the choice to choose which all details he wants as output/
    Create Account : Create account inside cpanel
    Terminate an account : Terminate account, allows the developer to terminate account using a user name / domain name. Has configurable choices.
    Terminate multiple accounts : Terminate multiple accounts, works just like the terminate accounts except supports multiple accounts/
    Modify Password : Modify password for a account, supports password change using a username / domain.
    Suspend/Unsuspend an Account : Suspend/ unsuspend an account based on username, domain
    List Suspended Accounts : Get a list of all suspended accounts
    List Packages : Get a list of all packages on the server
    View Bandwidth : Get bandwidth usage for a domain
    List Parked Domain : View list of parked domains.

    Reseller functions are being built as we speak.

    ETA for launch : 10-15 days.

    More information with demos will be posted soon. Next week we should be posting up a live server with the API running for any one to test it functionality.
     
  2. brentp

    brentp Well-Known Member

    Joined:
    Mar 11, 2004
    Messages:
    324
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Ayr, North Queensland, Australia
    Status API

    Anand:

    cPanel already has a status api for perl ;). You could also use it in php as well, theres a function laying around for that. Anyway, its in /usr/local/cpanel/Cpanel/. I also made a script with it if you didnt already know, (CGI ServUP). Available at http://brentpickup.info/servup.tar.gz. If you want to incorporate it into your scripts final release, feel free.

    Regards,
    Brent
     
  3. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Thx for the info Brent. I wasn't aware of it :)

    However i already have that part done.

    Take a look at Accounting.php.inc, it hasn't been updated with anything new in quite sometime.

    I would understand that i haven't covered many functions from whm in the above listing, but once this api is released there would be a lot of functions and lot more choices to work with.
     
  4. __DoPe_ShOw__

    __DoPe_ShOw__ Well-Known Member

    Joined:
    Mar 8, 2003
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Louisiana
    A few questions to anand...

    1. How much will this API cost?
    2. How much longer you think it'll take?
    3. Can someone get a customized version?

    Thanks.
     
  5. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    1. The cost will be disclosed once its ready to be launched, which is approx 2 weeks from now.
    2. Two weeks from now.
    3. We thought about it, but then decided to scrap the idea, the API would be available as a complete functions list, you are free to use what ever you want for your application.
     
  6. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Updates, more features have been added

    Complete Packages Management with Add,List,Edit,Delete Packages
    Complete Feature Manager with Add, List, Edit Delete
    Get cpanel/whm version
    Get Hostname of the server running cpanel
    Quota List : Get the complete list of accounts with their quota usage (allows custom fields and results)
    Edit Quota : Edit quota for any user account based on their domain name / user
    Add / Edit/ Delete Reseller (still in progress)
     
  7. big

    big Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    224
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Earth
    released yet ? :)
     
  8. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Nope, but more functions have been added. Just gearing up to finish the v1.0 functions list. I would say another week before things are released. Sorry about the mis leading release date mentioned earlier.

    More functions added:

    Add/Edit/ Delete Reseller completed
    Suspend/ Unsuspend all reseller accounts
    Park a domain
    Change ownership of an account
    Kill all reseller accounts
    Reseller Stats (allows you to see how many accounts a reseller has, disk, bandwidth usage etc)
    Restart Services : Covers named, exim, imap, proftpd, mysql, openssh, apache, cppop, interchange. Work for tomcat restart is in progress
    Change an account's IP address (in progress)

    By the weekend all the functions which will be released under the v1.0 will be finalised, next week is gonna be the licensing system setup and by the next weekend i expect to release this out.
     
  9. netlook

    netlook Well-Known Member
    PartnerNOC

    Joined:
    Mar 25, 2004
    Messages:
    335
    Likes Received:
    0
    Trophy Points:
    16
    Is it released?
     
  10. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    The API is done yes, the package distribution is taking much longer than we accepted.

    Anyways whatever happens this weekend our new installer is coming out, and by 27-28th the complete API with specs and examples will be released.

    If you like you can PM me your contact information, we will send you a detailed mail once its launched and a link to check it out in real action.
     
  11. ThunderHostingDotCom

    ThunderHostingDotCom Well-Known Member

    Joined:
    Nov 18, 2002
    Messages:
    450
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    All over!
    What will this API do that WHM does not? Is it a stand alone program that can be run from the desktop?
     
  12. MrHits

    MrHits Well-Known Member

    Joined:
    Oct 31, 2001
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    6
    What is the release status?
     
  13. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider

    It will allow any developer to develop scripts which can interact with almost all functions of cpanel/whm. For Example, you want to have a small interface where you can display all your server status from whm in a single screen. At present this functionality is not available via any methods. The API allows you to do so.

    This is only a small example, there are several functions in the api which can be used for multiple purposes.
     
  14. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Sorry, i forgot that part ;) Its already launched. We gave few people 14 day trial licenses, however we found we code make more improvements in the core engine of the api so we stopped any further licenses and started to work on it.

    As of now the updates on the core will be completed by tommorow and then we should be ready to roll out the new trial licenses for people to check out. This time i will keep this thread updated.
     
  15. perlchild

    perlchild Well-Known Member

    Joined:
    Sep 1, 2002
    Messages:
    279
    Likes Received:
    0
    Trophy Points:
    16
    Any way you could add to the api things that aren't really done by cpanel for now? like adding ips etc..?
    I'm thinking such an api would be really helpful for automating larger transfers(a must if you are managing larger numbers of machines, and one or more needs to be deloaded on short notice)
     
  16. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    We also thought about the ips move problem people face and its covered inside the api. The api allows users to move all their domains under the shared ip (so they can remove old ips and load new ips). Once new ips have been loaded either using the api or whm you can move accounts to individual ips.

    Do let me know if you have something better in mind, we can surely work on it. The idea is to have an api which will try to cover almost all possible functions and help developers develop new applications/ scripts for cpanel/whm.
     
  17. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Just so for everyone to know.

    The new api core has been completed. Its now much faster than the earlier version (the earlier version was released only to a few testing environments). We would be packaging the new api with examples and it should be up for distribution today itself.

    I will keep this thread posted.
     
  18. Edizon

    Edizon Well-Known Member

    Joined:
    Feb 18, 2003
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    AZ
    This may be in fact what I am looking for. Where can I get a free trial?
     
  19. perlchild

    perlchild Well-Known Member

    Joined:
    Sep 1, 2002
    Messages:
    279
    Likes Received:
    0
    Trophy Points:
    16
    What I had in mind was quite simple.
    I often have to move accounts between two boxes under the control of the same isp, both boxes have ips from the same router and pool.
    Having an api I can call that will take one ip on one box, and repopulate it on the other would be nice. Then I'll just need to automate the restore from cpmove, the change ip(there seems to be no way to make sure a restore from cpmove will pick up the old ip), and the killacct on the old box.
    I wonder if I shouldn't just ask cpanel for a cmd line add-ip, remove-ip pair of scripts. I bet that would cover my most basic need in the immediate term.
    I don't find your solution to be optimal since it involves a dns change, which can propagate(erroneously), and because I'm erasing the original account anyways, and what I want to automate is the ip transfer itself.
     
    #19 perlchild, Nov 12, 2004
    Last edited: Nov 12, 2004
  20. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    The new and improved version of whmapi is out. The api is now available for anytime to download and take a 21 days free no obligation license.

    You can access information at http://whmapi.cpanelappz.com

    Please post any questions here / email to admin [AT] cpanelappz.com and we will try our best to solve them for you.

    The distribution comes with enough examples to make you understand the working of the API. More functions will be added in future and core engine will be improved further.

    Just open the package and read the readme.txt file to start.
     
Loading...

Share This Page