Manage2 API Function - Change a License IP Address


Last modified: March 12, 2021

Description

This function transfers an existing license.

Examples

XML

https://manage2.cpanel.net/XMLtransfer.cgi?oldip=192.0.2.0;newip=198.51.100.0;packageid=008;force=1;dryrun=0

JSON

https://manage2.cpanel.net/XMLtransfer.cgi?output=json&oldip=192.0.2.0;newip=198.51.100.0;packageid=008;force=1;dryrun=0

YAML

https://manage2.cpanel.net/XMLtransfer.cgi?output=yaml&oldip=192.0.2.0;newip=198.51.100.0;packageid=008;force=1;dryrun=0

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
<?php
    include("cpl.inc.php");
    $cpl = new cPanelLicensing("username@example.com", "123456luggage");
    $response = (array)$cpl->changeip(array(
        "oldip" => "192.0.2.0",
        "newip" => "198.51.100.0",
        "packageid" => "008",
        "force" => "1",
        "dryrun" => "0"
        )
    );
?>

1
2
3
4
5
6
7
8
9
use cPanelLicensing;
my $licenseManager = new cPanelLicensing(user => 'username\@example.com', pass => '123456luggage');
$licenseManager->changeip(
    'oldip'         => '192.0.2.0',
    'newip'         => '198.51.100.0',
    'packageid'     => '008',
    'force'         => '1',
    'dryrun         => '0',
);

<XMLtransfer oldip="192.0.2.0" newip="192.168.0.20" status="1" reason="Transferred EXAMPLECOMPANY license 6794006 in the 'Test Group*' group on 192.0.2.0 to 198.51.100.0."/>

1
2
3
4
5
6
{
    "status": 0,
    "reason": "Transferred EXAMPLECOMPANY license 6794006 in the 'Test Group*' group on 192.0.2.0 to 198.51.100.0.",
    "oldip": "192.0.2.0",
    "newip": "198.51.100.0"
}

1
2
3
4
5
---
status: 0
reason: Transferred EXAMPLECOMPANY license 6794006 in the 'Test Group*' group on 192.0.2.0 to 198.51.100.0.
oldip: 192.0.2.0
newip: 198.51.100.0

Parameters

This function accepts the following parameters:

Parameter Type Description Example
oldip string Required
The license’s current IP address.
192.0.2.0
newip string Required
The license’s new IP address.
198.51.100.0
packageid string Required
The license’s package ID. The Manage2 List Package Information function returns a list of possible values.
Note:
This parameter is optional if the current IP address only possesses one package ID.
If you do not use this parameter, the function transfers all of the licenses on the current IP address.
008
force Boolean Whether to force a license transfer if the transfer adds a charge to a deactivated IP address:
  • 1 — Force a transfer.
  • 0 — Do not force a transfer.
This parameter defaults to 0.
1
dryrun Boolean Whether to show license information but not transfer the license.
  • 1 — Show the license information but do not transfer the license.
  • 0 — Transfer the license.
This parameter defaults to 0.
0

Returns

This function returns the following values:

Return Type Description Example
oldip string The license’s old IP address. 192.0.2.0
newip string The license’s new IP address. 198.51.100.0
reason string Whether the function transferred the existing license. Transferred EXAMPLECOMPANY license 6794006 in the 'Test Group*' group on 192.0.2.0 to 198.51.100.0.
status Boolean Whether the function succeeded:
  • 1 — Success.
  • 0 — Failure.
1

Additional Documentation