The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

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

xmlapi_listaccts()

Used to list the accounts on a server.

Syntax:

  $pubapi->xmlapi_listaccts( $search, $searchtype );

xmlapi_createacct()

Create a new cPanel account.

Syntax:

  $pubapi->xmlapi_createacct( $username, $domain, $password, $plan );

xmlapi_removeacct()

Terminate an account.

Syntax:

  $pubapi->xmlapi_removeacct( $user );

xmlapi_showversion()

Get the version of cPanel running on the server.

Syntax:

  $pubapi->xmlapi_showversion(  );

xmlapi_version()

Get the version of cPanel running on the server (as as showversion)

Syntax:

  $pubapi->xmlapi_version(  );

xmlapi_applist()

List out the available xml-api calls.

Syntax:

  $pubapi->xmlapi_applist(  );

xmlapi_generatessl()

Generate an ssl certificate.

Syntax:

  $pubapi->xmlapi_generatessl( $host, $pass, $country, $state, $city, $co, $cod, $email, $xemail );

xmlapi_generatessl_noemail()

Generate an SSL certificate without an email.

Syntax:

  $pubapi->xmlapi_generatessl_noemail( $noemail=1 );

xmlapi_listcrts()

List out the certificates that exist on the server.

Syntax:

  $pubapi->xmlapi_listcrts(  );

xmlapi_setresellerlimits()

Set the limits for a single reseller account.

Syntax:

  $pubapi->xmlapi_setresellerlimits(  );

xmlapi_setresellerpackagelimit()

Set which packages a reseller account can use.

Syntax:

  $pubapi->xmlapi_setresellerpackagelimit( $user, $package, $allowerd, $number, $no_limit );

xmlapi_setresellermainip()

Set a reseller's main IP.

Syntax:

  $pubapi->xmlapi_setresellermainip( $user, $ip );

xmlapi_setresellerips()

Set the IP that a reseller has available to it.

Syntax:

  $pubapi->xmlapi_setresellerips( $user, $delegate, $ips );

xmlapi_setresellernameservers()

Set the nameservers that a reseller uses by default.

Syntax:

  $pubapi->xmlapi_setresellernameservers( $user, $nameservers );

xmlapi_suspendreseller()

Suspend a reseller and all of their accounts.

Syntax:

  $pubapi->xmlapi_suspendreseller( $user, $reason, $disallow );

xmlapi_unsuspendreseller()

Unsuspend a reseller and all of their accounts.

Syntax:

  $pubapi->xmlapi_unsuspendreseller( $user );

xmlapi_addzonerecord()

Add a record to a zone.

Syntax:

  $pubapi->xmlapi_addzonerecord( @args );

xmlapi_editzonerecord()

Edit a zone record.

Syntax:

  $pubapi->xmlapi_editzonerecord(@args );

xmlapi_removezonerecord()

Remove a line from a zone.

Syntax:

  $pubapi->xmlapi_removezonerecord( $domain, $Line );

xmlapi_getzonerecord()

Get a record from a zone.

Syntax:

  $pubapi->xmlapi_getzonerecord( $domain, $Line );

xmlapi_servicestatus()

Get the status of various services running on a system.

Syntax:

  $pubapi->xmlapi_servicestatus( $service );

xmlapi_configureservice()

Enable/Disable various services.

Syntax:

  $pubapi->xmlapi_configureservice( $service, $enabled, $monitored );

xmlapi_acctcounts()

Get the number of accounts on a system/that belong to a reseller.

Syntax:

  $pubapi->xmlapi_acctcounts( $user );

xmlapi_domainuserdata()

Get the information about a specific domain's virtualhost.

Syntax:

  $pubapi->xmlapi_domainuserdata( $domain );

xmlapi_editquota()

Edit a user's quota.

Syntax:

  $pubapi->xmlapi_editquota( $user, $quota );

xmlapi_nvget()

Get non-volatile data.

Syntax:

  $pubapi->xmlapi_nvget( $key );

xmlapi_nvset()

Set non-volatile data.

Syntax:

  $pubapi->xmlapi_nvset( $key, $value );

xmlapi_myprivs()

See what privileges are available to your user.

Syntax:

  $pubapi->xmlapi_myprivs(  );

xmlapi_listzones()

List all the zones available to a user.

Syntax:

  $pubapi->xmlapi_listzones(  );

xmlapi_sethostname()

Set the hostname of a system.

Syntax:

  $pubapi->xmlapi_sethostname( $hostname );

xmlapi_setresolvers()

Set the resolvers a system uses.

Syntax:

  $pubapi->xmlapi_setresolvers( $nameserver1, $nameserver2, $nameserver3 );

xmlapi_addip()

Add a new IP to a server.

Syntax:

  $pubapi->xmlapi_addip( $ip, $netmask );

xmlapi_delip()

Remove an IP from a server.

Syntax:

  $pubapi->xmlapi_delip( $ip, $ethernetdev, $skipifshutdown );

xmlapi_listips()

List the IPs on a server.

Syntax:

  $pubapi->xmlapi_listips(  );

xmlapi_dumpzone()

Get the contents of a zone file.

Syntax:

  $pubapi->xmlapi_dumpzone( $domain );

xmlapi_listpkgs()

List the packages available to your user.

Syntax:

  $pubapi->xmlapi_listpkgs(  );

xmlapi_limitbw()

Limit the amount of bandwidth available to an account.

Syntax:

  $pubapi->xmlapi_limitbw( $user, $bwlimit );

xmlapi_showbw()

Show the amount of BW used by an account.

Syntax:

  $pubapi->xmlapi_showbw( $month, $year, $showres, $search, $searchtype );

xmlapi_killdns()

Remove a DNS zone.

Syntax:

  $pubapi->xmlapi_killdns( $domain );

xmlapi_adddns()

Add a dns zone.

Syntax:

  $pubapi->xmlapi_adddns( $domain, $ip, $trueowner );

xmlapi_changepackage()

Change an Account's Package.

Syntax:

  $pubapi->xmlapi_changepackage( $user, $pkg );

xmlapi_modifyacct()

Modify an Account's limits.

Syntax:

  $pubapi->xmlapi_modifyacct( $user, $domain, $HASCGI, $CPTHEME, $LANG, $MAXPOP, $MAXFTP, $MAXLST, $MAXSUB, $MAXPARK, $MAXADDON, $MAXSQL, $shell );

xmlapi_suspendacct()

Suspend an account.

Syntax:

  $pubapi->xmlapi_suspendacct( $user, $reason );

xmlapi_unsuspendacct()

Unsuspend an account.

Syntax:

  $pubapi->xmlapi_unsuspendacct( $user );

xmlapi_listsuspended()

List the suspended accounts on a server.

Syntax:

  $pubapi->xmlapi_listsuspended(  );

xmlapi_addpkg()

Add a new package.

Syntax:

  $pubapi->xmlapi_addpkg( $pkgname, $quota, $ip, $cgi, $frontpage, $cpmod, $maxftp, $maxsql, $maxpop, $maxlst, $maxsub, $maxpark, $maxaddon, $featurelist, $hasshell, $bwlimit );

xmlapi_killpkg()

Remove a package.

Syntax:

  $pubapi->xmlapi_killpkg( $pkg );

xmlapi_editpkg()

Edit a package.

Syntax:

  $pubapi->xmlapi_editpkg( $pkgname, $quota, $ip, $cgi, $frontpage, $cpmod, $maxftp, $maxsql, $maxpop, $maxlst, $maxsub, $maxpark, $maxaddon, $featurelist, $hasshell, $bwlimit );

xmlapi_setacls()

Change features available to a reseller.

Syntax:

  $pubapi->xmlapi_setacls( $reseller, $acllist );

xmlapi_terminatereseller()

Remove a reseller.

Syntax:

  $pubapi->xmlapi_terminatereseller( $reseller, $verify );

xmlapi_resellerstats()

Get statistics on a specific reseller.

Syntax:

  $pubapi->xmlapi_resellerstats( $reseller );

xmlapi_setupreseller()

Make a cPanel account a Reseller account.

Syntax:

  $pubapi->xmlapi_setupreseller( $user, $makeowner );

xmlapi_lookupnsip()

Get the IP for a nameserver.

Syntax:

  $pubapi->xmlapi_lookupnsip( $nameserver );

xmlapi_listresellers()

List all the resellers on a system.

Syntax:

  $pubapi->xmlapi_listresellers(  );

xmlapi_listacls()

List all of the ACL lists available.

Syntax:

  $pubapi->xmlapi_listacls(  );

xmlapi_saveacllist()

Save a new ACL list.

Syntax:

  $pubapi->xmlapi_saveacllist( $acllist );

xmlapi_unsetupreseller()

Remove reseller permissions from an account.

Syntax:

  $pubapi->xmlapi_unsetupreseller( $user );

xmlapi_gethostname()

Get the hostname of the server currently being queried.

Syntax:

  $pubapi->xmlapi_gethostname(  );

xmlapi_fetchsslinfo()

Get information on a specific SSL certificate.

Syntax:

  $pubapi->xmlapi_fetchsslinfo( $domain, $crtdata );

xmlapi_installssl()

Install a new SSL certificate.

Syntax:

  $pubapi->xmlapi_installssl( $domain, $user, $cert, $key, $cab, $ip );

xmlapi_passwd()

Change an account's password.

Syntax:

  $pubapi->xmlapi_passwd( $user, $pass );

xmlapi_getlanglist()

Get a list of languages available on a system.

Syntax:

  $pubapi->xmlapi_getlanglist(  );

xmlapi_reboot()

Reboot the server.

Syntax:

  $pubapi->xmlapi_reboot( $force );

xmlapi_accountsummary_user()

Get a summary of an account.

Syntax:

  $pubapi->xmlapi_accountsummary_user( $user );

xmlapi_accountsummary_domain()

Get the summary of an account by specifying the domain.

Syntax:

  $pubapi->xmlapi_accountsummary_domain( $domain );

xmlapi_loadavg()

Get the loadavg on the system.

Syntax:

  $pubapi->xmlapi_loadavg(  );

xmlapi_restartservice()

Restart a service.

Syntax:

  $pubapi->xmlapi_restartservice( $service );

xmlapi_setsiteip_user()

Set the IP for a specific user.

Syntax:

  $pubapi->xmlapi_setsiteip_user( $user, $ip );

xmlapi_setsiteip_domain()

Set the IP for a specific domain.

Syntax:

  $pubapi->xmlapi_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.