Add Licenses — XMLlicenseAdd.cgi
This Manage2 function allows you to add a new license.
Variables
Input
- ip (string) — The IP address to which you wish to add the license. This variable is required.
- packageid (integer) — The identification number of the package assigned to the new license. Use XMLpackageInfo.cgi to list possible values for this variable.
- groupid (integer) — The identification number of the group to which the new license will be assigned. Use XMLgroupInfo.cgi to list possible values for this variable. The main group identification number is used if there is no value provided for the variable.
- force (boolean) — Forces the license to be added to the IP addresses specified. This variable is optional.
-
1 — Results in a forced licensing.
-
0 — The new license will not be forced upon the specified IP address.
-
Note: It is no longer necessary to combine the force, billme, and reactivateok options together to force an activation. The only variable required is force. The reactivateok and billme functions are deprecated.
- dryrun (boolean) — Shows error messages and price information without activating the license.
-
1 — Show the error messages and price information, without activating the license
-
0 — Activates the license. If force is required, the license will not activate.
Output
- licenseid (integer) — The ID of the new license.
- promoinfo (string) — Describes whether or not the new license was given any promotional deal.
- *yearly (boolean) — Describes whether the license that has been added is a yearly license.
-
1 — The license that has been added is a yearly license.
-
0 — The license that has been added is not a yearly license.
- *price (string) — The price billed immediately after activating. The price shown is for yearly licenses. The price may be different if the license was deactivated within 48 hours of billing.
- monthly_price (string) — The price that will be added to the customer's monthly bill for this license.
- reason (string) — Information about the activation.
- Example:
Activated TESTCOMPANY-INTERNAL license on 127.0.0.1 in the 'foo' group.
- status (boolean) — Describes whether the new license has been successfully added to your account.
-
1 — The license has been successfully added.
-
0 — The license has not been added.
Examples
Using HTTP (direct API call)
Calling
https://manage2.cpanel.net/XMLlicenseAdd.cgi?ip=127.0.0.1&packageid=8&groupid=13 in a web browser would produce XML output similar to the following:
<XMLlicenseAdd
licenseid="6793969" monthly_price="21.34" price="0.00" promoinfo=""
reason="Activated TESTCOMPANY-INTERNAL license
on 127.0.0.1 in the 'foo' group." status="1" yearly="0"/>
Calling the function using the URL above will return XML data by default. To change the output format that will be returned, use either of the following URLs:
- JSON —
http://manage2.cpanel.net/XMLlicenseAdd.cgi?output=json&ip=127.0.0.1&packageid=8&groupid=13
- YAML —
http://manage2.cpanel.net/XMLlicenseAdd.cgi?output=yaml&ip=127.0.0.1&packageid=8&groupid=13
For more information about each of these output types, visit our
Choosing an Output Type documentation.
Using a Perl module
The following is an example of a Perl module that will call
XMLlicenseAdd.cgi. You can use this module to pass input variables to a Manage2 API function. You will need to edit the example below to suit your needs.
use cPanelLicensing;
my $cpl = cPanelLicensing->new(user => $user, pass => $pass);
$cpl-> activateLicense(
groupid=>$groupid
packageid=>$packageid
ip=>$ip
force=>$force
)
In the example above:
-
$ip — The IP address of the server being provisioned a new license.
-
$groupid — The ID of the group to which the new license will belong.
-
$packageid — The ID of the package that the new license will use.
-
$force — Specifies whether the creation of the new account should be forced.
-
Note: $force is an optional variable.
Remember: $user and
$pass represent the username and password for your Manage2 account.
Learn more about using a Perl module to call API functions.
Using a PHP class
The following is an example showing how to call the cPanelLicensing PHP class. You can use this class to pass input variables to the Manage2 API using a few short calls.
<?php
include("cpl.inc.php");
$cpl = new cPanelLicensing($user,$pass);
$license = $cpl->activateLicense(array(
"ip" => $ip,
"groupid" => $groupid,
"package" => $packageid,
)
);
?>
In the example above:
-
$ip — The IP address of the server being provisioned a new license.
-
$groupid — The ID of the group to which the new license will belong.
-
$packageid — The ID of the package that the new license will use.
Remember: $user and
$pass represent the username and password for your Manage2 account.
Learn more about using a PHP class to call API functions.
Topic revision: r22 - 21 Feb 2013 - 18:27:27 - Main.ColinShannon
ManageTwo.XMLAddLicense moved from Sandbox.XMLAddLicense on 21 Jul 2009 - 19:12 by Main.JustinSchaefer -
put it back