Child pages
  • Manage2 API Functions - Change a License Package
Skip to end of metadata
Go to start of metadata

Description


This function updates a license's package.

Examples 


 Browser-based Calls
XML
https://manage2.cpanel.net/XMLpackageUpdate.cgi?output=xml&ip=192.168.0.1&oldpackageid=P003&newpackageid=P002
JSON
https://manage2.cpanel.net/XMLpackageUpdate.cgi?output=json&ip=192.168.0.1&oldpackageid=P003&newpackageid=P002
YAML
https://manage2.cpanel.net/XMLpackageUpdate.cgi?output=yaml&ip=192.168.0.1;oldpackageid=P003;newpackageid=P002
 cPanel Licensing PHP Class
<?php
    include("cpl.inc.php");
    $cpl = new cPanelLicensing("barney@example.com", "12345luggage");
    $response = (array)$cpl->packageUpdate(array(
		"ip" 	       => "192.168.0.1", 
		"oldpackageid" => "P003", 
		"newpackageid" => "P002"));
?>
 cPanel Licensing Perl Module
use cPanelLicensing;
my $licenseManager = new cPanelLicensing(user => 'barney\@example.com', pass => '12345luggage');
$licenseManager->packageUpdate(
		'ip' 	       => '192.168.0.1', 
		'oldpackageid' => 'P003', 
		'newpackageid' => 'P002'
);
 Output (JSON)
{
  "status": 1,
  "reason": "Updated package on 192.168.0.1 from 15-DAY-TEST to COMPANY-INTERNAL-VPS."
}
 Output (XML)
<XMLpackageUpdate status="1" reason="Updated package on 192.168.0.1 from 15-DAY-TEST to COMPANY-INTERNAL-VPS."/>
 Output (YAML)
--- 
reason: Updated package on 192.168.0.1 from 15-DAY-TEST to COMPANY-INTERNAL-VPS.
status: 1

Parameters

ParameterTypeDescriptionPossible valuesExample
ipstring

Required

The license's current IP address.

Note:

If more than one license uses the supplied IP address, you must supply either the oldpackageid or oldpackage parameter.

A valid IP address on the server. 192.168.0.1
oldpackageidstring

The license's current package's ID.

Notes:

  • Use either the oldpackageid or oldpackage parameter, but not both.
  • If more than one license uses the supplied IP address, you must supply either the oldpackageid or oldpackage parameter.

If you do not use this parameter, the system attempts to determine the package for the supplied IP address.

A valid package ID.

The List Package Information function returns a list of possible values.

P003
oldpackagestring

The license's current package.

Notes:

  • Use either the oldpackageid or oldpackage parameter, but not both.
  • If more than one license uses the supplied IP address, you must supply either the oldpackageid or oldpackage parameter.

If you do not use this parameter, the system attempts to determine the package for the supplied IP address.

A valid package.

The List Package Information function returns a list of possible values.

15-DAY-TEST
newpackageidstring

The new package's ID.

Note:

You must include either the newpackageid or newpackage parameter, but not both. 

A valid package ID.

The List Package Information function returns a list of possible values.

P002
newpackagestring

The new package.

Note:

You must include either the newpackageid or newpackage parameter, but not both. 

A valid package.

The List Package Information function returns a list of possible values.

COMPANY-INTERNAL-VPS

Returns

ReturnTypeDescriptionPossible valuesExample
reasonstringWhether the function updated the package.A string value.
Updated package on 192.168.0.1 from 15-DAY-TEST to COMPANY-INTERNAL-VPS.       
statusBooleanWhether the function succeeded.
  • 1 — Success.

  • 0 — Failure.
1