Remoting API Documentation

Discussion in 'Developers' Forum' started by joecoder, Apr 18, 2011.

  1. joecoder

    joecoder New Member

    Is there documentation for the remoting API? I have found the examples folder with about 40-so examples and can successfully login and create a client.

    Next, I would like to create a site. I browsed the source and found interface/lib/classes/remoting.inc.php and found sites_web_domain_add. I don't know if this is the function or how to call it because I don't know what to fill in for the $params array.

    Where can I find documentation for the remoting API?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    There is no documentation for the remote API available. But you
    can find examples in the remote_client/examples/ subfolder
    of the ispconfig tar.gz file. A full list of all available functions
    can be found in the file /usr/local/ispconfig/interface/lib/classes/remoting.inc.php

    The variables in the $params array are named like the columns in the corresponding database table. You can find also some examples and discussions here in the dev forum about that.
     
  3. joecoder

    joecoder New Member

    Is sites_web_domain_add the correct function for adding a new site? It looks like it's just for adding a domain to an existing site, but it's the closest I could find in remoting.inc.php
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Thats the correct function.
     
  5. joecoder

    joecoder New Member

    How do I know what values to fill in for system_user, system_group, and php_open_basedir?

    I see these values filled in for other sites I've created manually in the admin, but they seem to be generated based on the users and directories that ISPConfig creates for the site?
     
  6. joecoder

    joecoder New Member

    If I fill in those values with some from another row, I get the error,
    "Fatal error: Uncaught SoapFault exception: [data_processing_error] documentroot_error_empty"
     
  7. otacon

    otacon New Member

    Example of creating a site through API


    PHP:
    $params_website = array('server_id' => 1
                                
    'ip_address' => '*'
                                
    'domain' => $myusername.'.remcycle.net'
                                
    'type' => 'vhost'
                                
    'parent_domain_id' => ''
                                
    'vhost_type' => 'name'
                                
    'hd_quota' => 999999
                                
    'traffic_quota' => '1000'
                                
    'cgi' =>'y'
                                
    'ssi' =>'y'
                                
    'suexec' =>'y'
                                
    'errordocs' =>'1'
                                
    'subdomain' =>'www'
                                
    'ssl' =>'n'
                                
    'php' =>"mod"
                                
    'ruby' =>'y'
                                
    'active' =>'y'
                                
    'redirect_type' =>'no'
                                
    'redirect_path' =>''
                                
    'ssl_state' =>''
                                
    'ssl_organisation' =>''
                                
    'ssl_organisation_unit' =>''
                                
    'ssl_country' =>''
                                
    'ssl_domain' => $myusername.'.remcycle.net'
                                
    'ssl_request' =>''
                                
    'ssl_cert' =>''
                                
    'ssl_bundle' =>''
                                
    'ssl_action' =>''
                                
    //'stats_password' =>$mypassword, 
                                
    'stats_password' =>''
                                
    'stats_type' =>'webalizer'
                                
    'backup_interval' =>'daily'
                                
    'backup_copies' =>'7'
                                
    'document_root' =>'/var/www/clients/client'.$client_id.'/web'.$domain_id
                                
    'system_user' =>'web'.$domain_id
                                
    'system_group' =>'client'.$client_id
                                
    'allow_override' =>'All'
                                
    'php_open_basedir' =>'/var/www/clients/client'.$client_id.'/web'.$domain_id.'/web:/var/www/clients/client'.$client_id.'/web'.$domain_id.'/tmp:/var/www/'.                            $myusername.'.remcycle.net/web:/srv/www/'.$myusername.'.remcycle.net/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin'
                                
    'custom_php_ini' =>'',  
                                
    'apache_directives' => '<Directory />
                                            Options FollowSymLinks
                                            AllowOverride All
                                            Order allow,deny
                                            Allow from all
                                            </Directory>'

                                
    'client_group_id' =>$client_id +1
                                
    ); 
        
        
    $website_id $client->sites_web_domain_add($session_id$client_id$params_website); 
     
  8. Ryein

    Ryein New Member

    Awesome! Thanks ... I am going to try this out!!
     
  9. vaio1

    vaio1 Member


    Hi how do you get the domain_id index value?
    thanks
     

Share This Page