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.

List all Domains

Discussion in 'General Discussion' started by binaer, Oct 22, 2008.

  1. binaer

    binaer Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    6
    Hi

    For a new Project, I've to list all Domains (inlcuding Main/Parked and Addon Domain) of all Accounts from one Server. How can I get this List using API2? Or is there a way using XML-Api? (API2 preferred).

    I know that I can listaccts and then in a while-loop, but is there an easier way, maybe a direct function? Haven't found something about this.
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Keep in mind, just as cPanel and WHM do different things, so do the XML-API (a WHM API) and API2 (a cPanel API).

    You can use the XML-API to list accounts (listaccts), then call API2 via the XML-API to loop through each account and execute these API2 functions for each account:

    Park::listparkeddomains
    Park::listaddondomains

    If you are familiar with API2, you can view this last function in use in /usr/local/cpanel/base/frontend/x3/addon/index.html
     
  3. binaer

    binaer Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    6
    Hi

    thank's for response.

    How should I connect to API2 from outside? Is there any way? I know that this API is inside cPanel, but I need the script to be executed from outside...

    I found now this Function:
    http://www.cpanel.net/plugins/xmlapi/listzones.html
    which helps me... but we've not yet updated our Servers.

    Is it possible to become this function without an Update?
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    API2 functions can be called from outside scripts via the XML API as documented at:

    http://cpanel.net/plugins/xmlapi/cpanel.html

    No, that is not possible. Note that 11.24 is currently only in EDGE so this functionality has not yet propagated to production worthy builds such as CURRENT, RELEASE and STABLE.
     
Loading...

Share This Page