Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    cPanel Verified Vendor This forum account has been confirmed by cPanel staff to represent a vendor.
    Join Date
    Sep 2007
    Posts
    96

    Default listdomains

    Is there any thought on making this function? Would be very beneficial. Currently I have no way of getting a list of subdomains or addon domains for an account through the API.


    I'm currently looking into if I can make my own api function. If someone could give me pointers on that instead that would be helpful as well

    Thoughts?

  2. #2
    cPanel Verified Vendor This forum account has been confirmed by cPanel staff to represent a vendor.
    Join Date
    Sep 2007
    Posts
    96

    Default

    so evidently this can be done through the cpanel api by specifying the username. So there's that. At any rate I've already pulled the data i needed via pyyaml from the userdata files.

    Just thought I'd update this thread in case anyone was curious in the future.

  3. #3
    cPanel Staff cPanelMatt's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default

    There are XML-API functions for doing this:

    AddonDomainRef < DeveloperResources/ApiRef < TWiki
    SubDomainRef < DeveloperResources/ApiRef < TWiki
    ParkRef < DeveloperResources/ApiRef < TWiki

    So, for clarities sake, the easiest way to do this is (per API call) doing something like:

    Code:
    $cpanel/xml-api/cpanel?
    cpanel_xmlapi_module=AddonDomains&
    cpanel_xmlapi_func=listaddondomains
    which will return an XML document full of the addon domains per account.

    This can also be done through whm, however you will need to add a $user argument in order for the cpanel call to work correctly.
    Matt Dees
    Integration Developer
    cPanel, Inc.
    cPanel Integration Blog

  4. #4
    cPanel Verified Vendor This forum account has been confirmed by cPanel staff to represent a vendor.
    Join Date
    Sep 2007
    Posts
    96

    Default

    Thanks Matt, ya that is what I was referring to as far as Cpanel API. I am new to this I didn't realize there were more functions I could access via the xml-api via xml-api/cpanel.

    Could you clarify something for me? I am going to do some more testing on it but I was under the impression I could hook into cpanel and run arbitrary commands on certain actions.

    I created /usr/local/cpanel/addondomain
    then created a file inside it /usr/local/cpanel/addondomain/deladdondomain

    It's a simple python script
    #!/usr/local/bin/python
    f=open('/root/test.txt', "w")
    f.write('This is a test\n')
    f.close

    I thought this should run any time I delete an addondomain but it doesn't appear to be. I've checked everything obvious permisisons, execute bit etc. Am I just not doing this right at all?
    I did forget to run registerhooks. I just did that though and not much more help. If I run the script manually it works fine. :\

Similar Threads & Tags
Similar threads
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube