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?
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.
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.
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. :\