.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "cPanel::PublicAPI::WHM 3" .TH cPanel::PublicAPI::WHM 3 "2019-03-06" "perl v5.16.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" cPanel::PublicAPI::WHM \- Legacy interface for querying WHM. .PP NOTE: This module is provided for legacy purposes, cPanel::PublicAPI should be used instead .SH "DESCRIPTION" .IX Header "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). .SH "functions" .IX Header "functions" .ie n .SS """simple_get_whmreq()""" .el .SS "\f(CWsimple_get_whmreq()\fP" .IX Subsection "simple_get_whmreq()" This function makes a \s-1HTTP GET\s0 query to \s-1WHM,\s0 an equivalent function within cPanel::PublicAPI is \f(CW\*(C`api_request()\*(C'\fR. This function uses two arrays to specify arguments to be passed to a specific \s-1URI.\s0 This means that you would need to ensure that they both have the key/pair values in the same place in each array, f.ex: .PP .Vb 2 \& $argref = [\*(Aqvalue1\*(Aq, \*(Aqvalue2\*(Aq, \*(Aqvalue3\*(Aq]; \& $argnameref = [\*(Aqkey1\*(Aq, \*(Aqkey2\*(Aq, \*(Aqkey3\*(Aq]; .Ve .PP would be be specifying: .PP .Vb 1 \& key1=value1&key2=value2&key3=value3 .Ve .PP to be passed to the specified \s-1URI.\s0 .PP Arguments .IP "\(bu" 4 \&\f(CW$uri\fR \- The \s-1URI\s0 you to be queried. .IP "\(bu" 4 \&\f(CW$argref\fR \- An array reference containing the values to be passed. .IP "\(bu" 4 \&\f(CW$argnameref\fR \- An array reference containing the keys to be passed. .IP "\(bu" 4 \&\f(CW$opts\fR \- An array reference containing strings like 'key1=value1' to be passed to the \s-1URI.\s0 .PP This will return a scalar reference of the data returned by cpsrvd. .ie n .SS """simple_post_whmreq()""" .el .SS "\f(CWsimple_post_whmreq()\fP" .IX Subsection "simple_post_whmreq()" This function makes a \s-1HTTP POST\s0 query to \s-1WHM,\s0 an equivalent function within cPanel::PublicAPI is \f(CW\*(C`api_request()\*(C'\fR. This function uses two arrays to specify arguments to be passed to a specific \s-1URI.\s0 This means that you would need to ensure that they both have the key/pair values in the same place in each array, f.ex: .PP .Vb 2 \& $argref = [\*(Aqvalue1\*(Aq, \*(Aqvalue2\*(Aq, \*(Aqvalue3\*(Aq]; \& $argnameref = [\*(Aqkey1\*(Aq, \*(Aqkey2\*(Aq, \*(Aqkey3\*(Aq]; .Ve .PP would be be specifying: .PP .Vb 1 \& key1=value1&key2=value2&key3=value3 .Ve .PP to be passed to the specified \s-1URI.\s0 .PP Arguments .IP "\(bu" 4 \&\f(CW$uri\fR \- The \s-1URI\s0 you to be queried. .IP "\(bu" 4 \&\f(CW$argref\fR \- An array reference containing the values to be passed. .IP "\(bu" 4 \&\f(CW$argnameref\fR \- An array reference containing the keys to be passed. .IP "\(bu" 4 \&\f(CW$opts\fR \- An array reference containing strings like 'key1=value1' to be passed to the \s-1URI.\s0 .PP This will return a scalar containing the data returned by cpsrvd. .ie n .SS """whmreq()""" .el .SS "\f(CWwhmreq()\fP" .IX Subsection "whmreq()" This function is used to querying \s-1WHM\s0 with either \s-1GET\s0 or \s-1POST\s0 data. .IP "\(bu" 4 \&\f(CW$uri\fR \- The \s-1URI\s0 to be queried. .IP "\(bu" 4 \&\f(CW$method\fR \- The method of querying the \s-1URI \s0(either \s-1GET\s0 or \s-1POST\s0). .IP "\(bu" 4 \&\f(CW$formdata\fR \- The data to be passed to the \s-1URI\s0 formatted as formdata (e.g. 'key1=value1&key2=value2'). .ie n .SS """api1()""" .el .SS "\f(CWapi1()\fP" .IX Subsection "api1()" This function is used to query cPanel's \s-1API1. \s0 This will return the \s-1XML\s0 response from the \s-1XML API\s0's cpanel call. .IP "\(bu" 4 \&\f(CW$user\fR \- The user to execute an \s-1API\s0 call for. .IP "\(bu" 4 \&\f(CW$module\fR \- The module of the \s-1API\s0 call to be executed. .IP "\(bu" 4 \&\f(CW$func\fR \- The name of the \s-1API\s0 call to be executed. .IP "\(bu" 4 \&\f(CW@params\fR \- An array containing the parameters for the \s-1API\s0 call. .ie n .SS """api2()""" .el .SS "\f(CWapi2()\fP" .IX Subsection "api2()" This function is used to query cPanel's \s-1API1. \s0 This will return the \s-1XML\s0 response from the \s-1XML API\s0's cpanel call. .IP "\(bu" 4 \&\f(CW$user\fR \- The user to execute an \s-1API\s0 call for. .IP "\(bu" 4 \&\f(CW$module\fR \- The module of the \s-1API\s0 call to be executed. .IP "\(bu" 4 \&\f(CW$func\fR \- The name of the \s-1API\s0 call to be executed. .IP "\(bu" 4 \&\f(CW%params\fR \- An hash containing the parameters for the \s-1API\s0 call. .SH "Bugs" .IX Header "Bugs" see http://rt.cpan.org to report and view bugs .SH "License" .IX Header "License" Copyright (c) 2015, cPanel, Inc. All rights reserved. http://cpanel.net .PP 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. .PP \&\s-1THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \*(L"AS IS\*(R" 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 \&\s0(\s-1INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES\s0; \&\s-1LOSS OF USE, DATA, OR PROFITS\s0; \s-1OR BUSINESS INTERRUPTION\s0) \s-1HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \&\s0(\s-1INCLUDING NEGLIGENCE OR OTHERWISE\s0) \s-1ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\s0