NAME
cPanel::PublicAPI::WHM::API - Legacy interface for querying the xml-api.
NOTE: This module is provided for legacy purposes, cPanel::PublicAPI should be used instead
DESCRIPTION
This module provides legacy compatibility support between cPanel::PublicAPI and Cpanel::Accounting (distributed with cPanel). This should never be used unless there is a very good reason to use it (such as having a script that uses Cpanel::Accounting).
Every method contained within this object can be queried using cPanel::publicAPI::whm_api() instead.
For more information on the calls within the methods contained here and what the parameter names mean, please read the documentation at: http://docs.cpanel.net/twiki/bin/view/AllDocumentation/AutomationIntegration/XmlApi
functions
api_listaccts()
Used to list the accounts on a server.
Syntax:
$pubapi->api_listaccts( $search, $searchtype );
api_createacct()
Create a new cPanel account.
Syntax:
$pubapi->api_createacct( $username, $domain, $password, $plan );
api_removeacct()
Terminate an account.
Syntax:
$pubapi->api_removeacct( $user );
api_showversion()
Get the version of cPanel running on the server.
Syntax:
$pubapi->api_showversion( );
api_version()
Get the version of cPanel running on the server (as as showversion)
Syntax:
$pubapi->api_version( );
api_applist()
List out the available xml-api calls.
Syntax:
$pubapi->api_applist( );
api_generatessl()
Generate an ssl certificate.
Syntax:
$pubapi->api_generatessl( $host, $pass, $country, $state, $city, $co, $cod, $email, $xemail );
api_generatessl_noemail()
Generate an SSL certificate without an email.
Syntax:
$pubapi->api_generatessl_noemail( $noemail=1 );
api_listcrts()
List out the certificates that exist on the server.
Syntax:
$pubapi->api_listcrts( );
api_setresellerlimits()
Set the limits for a single reseller account.
Syntax:
$pubapi->api_setresellerlimits( );
api_setresellerpackagelimit()
Set which packages a reseller account can use.
Syntax:
$pubapi->api_setresellerpackagelimit( $user, $package, $allowerd, $number, $no_limit );
api_setresellermainip()
Set a reseller's main IP.
Syntax:
$pubapi->api_setresellermainip( $user, $ip );
api_setresellerips()
Set the IP that a reseller has available to it.
Syntax:
$pubapi->api_setresellerips( $user, $delegate, $ips );
api_setresellernameservers()
Set the nameservers that a reseller uses by default.
Syntax:
$pubapi->api_setresellernameservers( $user, $nameservers );
api_suspendreseller()
Suspend a reseller and all of their accounts.
Syntax:
$pubapi->api_suspendreseller( $user, $reason, $disallow );
api_unsuspendreseller()
Unsuspend a reseller and all of their accounts.
Syntax:
$pubapi->api_unsuspendreseller( $user );
api_addzonerecord()
Add a record to a zone.
Syntax:
$pubapi->api_addzonerecord( @args );
api_editzonerecord()
Edit a zone record.
Syntax:
$pubapi->api_editzonerecord(@args );
api_removezonerecord()
Remove a line from a zone.
Syntax:
$pubapi->api_removezonerecord( $domain, $Line );
api_getzonerecord()
Get a record from a zone.
Syntax:
$pubapi->api_getzonerecord( $domain, $Line );
api_servicestatus()
Get the status of various services running on a system.
Syntax:
$pubapi->api_servicestatus( $service );
api_configureservice()
Enable/Disable various services.
Syntax:
$pubapi->api_configureservice( $service, $enabled, $monitored );
api_acctcounts()
Get the number of accounts on a system/that belong to a reseller.
Syntax:
$pubapi->api_acctcounts( $user );
api_domainuserdata()
Get the information about a specific domain's virtualhost.
Syntax:
$pubapi->api_domainuserdata( $domain );
api_editquota()
Edit a user's quota.
Syntax:
$pubapi->api_editquota( $user, $quota );
api_nvget()
Get non-volatile data.
Syntax:
$pubapi->api_nvget( $key );
api_nvset()
Set non-volatile data.
Syntax:
$pubapi->api_nvset( $key, $value );
api_myprivs()
See what privileges are available to your user.
Syntax:
$pubapi->api_myprivs( );
api_listzones()
List all the zones available to a user.
Syntax:
$pubapi->api_listzones( );
api_sethostname()
Set the hostname of a system.
Syntax:
$pubapi->api_sethostname( $hostname );
api_setresolvers()
Set the resolvers a system uses.
Syntax:
$pubapi->api_setresolvers( $nameserver1, $nameserver2, $nameserver3 );
api_addip()
Add a new IP to a server.
Syntax:
$pubapi->api_addip( $ip, $netmask );
api_delip()
Remove an IP from a server.
Syntax:
$pubapi->api_delip( $ip, $ethernetdev, $skipifshutdown );
api_listips()
List the IPs on a server.
Syntax:
$pubapi->api_listips( );
api_dumpzone()
Get the contents of a zone file.
Syntax:
$pubapi->api_dumpzone( $domain );
api_listpkgs()
List the packages available to your user.
Syntax:
$pubapi->api_listpkgs( );
api_limitbw()
Limit the amount of bandwidth available to an account.
Syntax:
$pubapi->api_limitbw( $user, $bwlimit );
api_showbw()
Show the amount of BW used by an account.
Syntax:
$pubapi->api_showbw( $month, $year, $showres, $search, $searchtype );
api_killdns()
Remove a DNS zone.
Syntax:
$pubapi->api_killdns( $domain );
api_adddns()
Add a dns zone.
Syntax:
$pubapi->api_adddns( $domain, $ip, $trueowner );
api_changepackage()
Change an Account's Package.
Syntax:
$pubapi->api_changepackage( $user, $pkg );
api_modifyacct()
Modify an Account's limits.
Syntax:
$pubapi->api_modifyacct( $user, $domain, $HASCGI, $CPTHEME, $LANG, $MAXPOP, $MAXFTP, $MAXLST, $MAXSUB, $MAXPARK, $MAXADDON, $MAXSQL, $shell );
api_suspendacct()
Suspend an account.
Syntax:
$pubapi->api_suspendacct( $user, $reason );
api_unsuspendacct()
Unsuspend an account.
Syntax:
$pubapi->api_unsuspendacct( $user );
api_listsuspended()
List the suspended accounts on a server.
Syntax:
$pubapi->api_listsuspended( );
api_addpkg()
Add a new package.
Syntax:
$pubapi->api_addpkg( $pkgname, $quota, $ip, $cgi, $frontpage, $cpmod, $maxftp, $maxsql, $maxpop, $maxlst, $maxsub, $maxpark, $maxaddon, $featurelist, $hasshell, $bwlimit );
api_killpkg()
Remove a package.
Syntax:
$pubapi->api_killpkg( $pkg );
api_editpkg()
Edit a package.
Syntax:
$pubapi->api_editpkg( $pkgname, $quota, $ip, $cgi, $frontpage, $cpmod, $maxftp, $maxsql, $maxpop, $maxlst, $maxsub, $maxpark, $maxaddon, $featurelist, $hasshell, $bwlimit );
api_setacls()
Change features available to a reseller.
Syntax:
$pubapi->api_setacls( $reseller, $acllist );
api_terminatereseller()
Remove a reseller.
Syntax:
$pubapi->api_terminatereseller( $reseller, $verify );
api_resellerstats()
Get statistics on a specific reseller.
Syntax:
$pubapi->api_resellerstats( $reseller );
api_setupreseller()
Make a cPanel account a Reseller account.
Syntax:
$pubapi->api_setupreseller( $user, $makeowner );
api_lookupnsip()
Get the IP for a nameserver.
Syntax:
$pubapi->api_lookupnsip( $nameserver );
api_listresellers()
List all the resellers on a system.
Syntax:
$pubapi->api_listresellers( );
api_listacls()
List all of the ACL lists available.
Syntax:
$pubapi->api_listacls( );
api_saveacllist()
Save a new ACL list.
Syntax:
$pubapi->api_saveacllist( $acllist );
api_unsetupreseller()
Remove reseller permissions from an account.
Syntax:
$pubapi->api_unsetupreseller( $user );
api_gethostname()
Get the hostname of the server currently being queried.
Syntax:
$pubapi->api_gethostname( );
api_fetchsslinfo()
Get information on a specific SSL certificate.
Syntax:
$pubapi->api_fetchsslinfo( $domain, $crtdata );
api_installssl()
Install a new SSL certificate.
Syntax:
$pubapi->api_installssl( $domain, $user, $cert, $key, $cab, $ip );
api_passwd()
Change an account's password.
Syntax:
$pubapi->api_passwd( $user, $pass );
api_getlanglist()
Get a list of languages available on a system.
Syntax:
$pubapi->api_getlanglist( );
api_reboot()
Reboot the server.
Syntax:
$pubapi->api_reboot( $force );
api_accountsummary_user()
Get a summary of an account.
Syntax:
$pubapi->api_accountsummary_user( $user );
api_accountsummary_domain()
Get the summary of an account by specifying the domain.
Syntax:
$pubapi->api_accountsummary_domain( $domain );
api_loadavg()
Get the loadavg on the system.
Syntax:
$pubapi->api_loadavg( );
api_restartservice()
Restart a service.
Syntax:
$pubapi->api_restartservice( $service );
api_setsiteip_user()
Set the IP for a specific user.
Syntax:
$pubapi->api_setsiteip_user( $user, $ip );
api_setsiteip_domain()
Set the IP for a specific domain.
Syntax:
$pubapi->api_setsiteip_domain( $domain, $ip );
Bugs
see http://rt.cpan.org to report and view bugs
License
Copyright (c) 2015, cPanel, Inc. All rights reserved. http://cpanel.net
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of cPanel, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.