Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

API2: addaddondomain

Discussion in 'cPanel Developers' started by DrGonzo, Oct 26, 2010.

  1. DrGonzo

    DrGonzo Registered
    PartnerNOC

    Joined:
    Jun 21, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    51
    Hi.

    I'm using Cpanel/WHM version 11.26.20.

    After reading this documentaion i tried to use addaddondomain.

    Here's description of call:
    API Version: 2
    Description: Create an addon domain. This function will also create a subdomain and an associated FTP account.

    Here's the query:

    Code:
    https://hostname:2087/xml-api/cpanel?user=user123&xmlin=<cpanelaction><module>AddonDomain</module><apiversion>2</apiversion><func>addaddondomain</func><args><dir>domain</dir><newdomain>domain.ru</newdomain><pass>111</pass><subdomain>domain</subdomain></args></cpanelaction>
    Subdomain, addon domain setuped successfully, but no associated FTP account created.

    Logs with turned on EventHandler:

    Code:
    addondomain:addaddondomain
    $apiv = 2
    $type = pre
    -----
    $cfgref
    
    $VAR1 = { 
              'dir' => 'domain',
              'subdomain' => 'domain',
              'pass' => 1131,
              'newdomain' => 'domain.ru'
            };
    
    
    --------------------
    [2010-10-26 12:57:00 +0000] info [dnsadmin-ssl] safecopy for /etc/namedb/domain.ru.db -> /var/named/etc/namedb/domain.ru.db skipped. Target exists and has same size and inode number.
    [2010-10-26 12:57:04 +0000] info [dnsadmin-ssl] safecopy for /etc/namedb/named.conf -> /var/named/etc/namedb/named.conf skipped. Target exists and has same size and inode number.
    [2010-10-26 12:57:04 +0000] info [dnsadmin-ssl] safecopy for /etc/namedb/domain.ru.db -> /var/named/etc/namedb/domain.ru.db skipped. Target exists and has same size and inode number.
    addondomain:addaddondomain
    $apiv = 2
    $type = post
    -----
    $cfgref
    
    $VAR1 = { 
              'dir' => 'domain',
              'subdomain' => 'domain',
              'pass' => 1131,
              'newdomain' => 'domain.ru'
            };
    
    -----
    $dataref
    
    $VAR1 = [ 
              { 
                'result' => 1,
                'reason' => 'domain.ru was successfully parked on top of domain.domain.ru'
              }
            ];
    
    --------------------
    -- RESTART MARKER (PID 31206 at 1288097834)--
    

    Hmm.. Where's creation of "associated FTP account"? :) Should i create ftp account manual after addaddondomain with help of hooks?
     
  2. MattDees

    MattDees Well-Known Member

    Joined:
    Apr 29, 2005
    Messages:
    416
    Likes Received:
    1
    Trophy Points:
    243
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    This is an error in the API Docs. You will need to create an FTP account manually.

    I have gone ahead and removed the part mentioning the FTP account.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice