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.

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:
    1
    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 cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    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.
     
Loading...

Share This Page