Change a License's IP Address — XMLtransfer.cgi

This Manage2 function allows you to transfer an existing license from one IP address to another.

Variables

Input

  • oldip (string) — The original IP address of the license.
    • Example: 127.0.0.0
  • packageid (string) — The package ID of the license you wish to transfer.
    • note Note: This variable is optional if there is only one package on the old IP address.
    • Example: 0001
  • newip (string) — The new IP address of the license.
    • Example: 127.0.0.1

Output

  • newip (string) — The license's new IP address.
  • oldip (string) — The license's old IP address.
  • reason (string) — Describes, in English, the result of the request.
    • Example: OK
  • status (integer) — The status of the license transfer.
    • 1 — The license has been successfully transferred.
    • 0 — The request has failed.
    • -1 — The license has not been transferred.
  • version (float) — Internal information used by the Manage2 API.

Examples

Using HTTP (direct API call)

Show Hide

Calling http://manage2.cpanel.net/XMLtransfer.cgi?packageid=2301;oldip=127.0.0.0;newip=127.0.0.1 in a web browser will produce XML output similar to the following:

<XMLtransfer linkname="Verify License Information"
linkurl="http://verify.cpanel.net/?ip=127.0.0.1" newip="127.0.0.1"
oldip="127.0.0.0" reason="Transferred ONE-YEAR-ENKOMPASS license 127.0.0.0 to
127.0.0.1 by testinguser" status="1" version="0.1" />

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:

  • JSONhttp://manage2.cpanel.net/XMLtransfer.cgi?output=json&packageid=2301;oldip=127.0.0.0;newip=127.0.0.1
  • YAMLhttp://manage2.cpanel.net/XMLtransfer.cgi?output=yaml&packageid=2301;oldip=127.0.0.0;newip=127.0.0.1
For more information about each of these output types, visit our Choosing an Output Type documentation.

Using a Perl module

Show Hide

The following is an example of a Perl module that will call XMLtransfer.cgi. You can use this module to pass input variables to a Manage2 API function.

use cPanelLicensing;
    my $cpl = cPanelLicensing->new(user => $user, pass => $pass);
    $cpl->changeip(
        packageid => 2301,
        oldip => "127.0.0.0",
        newip => "127.0.0.1");

You can learn more about using a Perl module to call API functions.

Using a PHP class

Show Hide

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);
    $cpl->changeip(array(
        "packageid" => 2301,
        "oldip" => "127.0.0.0",
        "newip" => "127.0.0.1"));
    ?>

You can learn more about using a PHP class to call API functions.

Topic revision: r14 - 20 Apr 2011 - 15:22:05 - Main.MelanieSeibert
ManageTwo.XMLTransferIP moved from Sandbox.XMLTransferIP on 21 Jul 2009 - 19:12 by Main.JustinSchaefer - put it back
 

Copyright © cPanel 2000–2011.