List License Information — XMLlicenseInfo.cgi

This Manage2 function allows you to retrieve a list of all of the licenses associated with your Manage2 account.

Variables

Input

  • expired (boolean) — Optional variable that will force only expired licenses to be displayed.

Output

  • reason (string) — Information about the license information retrieval.
  • status (boolean) — Describes whether the call was completed successfully.
    • 1 — The information was successfully returned.
    • 0 — The information was not returned.
  • version (float) — Internal information used by the Manage2 API.
  • licenses (hash) — This variable contains all of the information about the licenses you have just looked up. This information includes:
    • name (string) — The license's ID.
    • adddate (integer) — The date the license was added, in Unix time.
    • distro (string) — The operating system distribution.
    • envtype (string) — The vritualization platform, if one exists.
    • expiredon (integer) — The date on which the license expired (in Unix time), if it has been expired.
      • If the license is not expired, this variable will not be assigned a value.
    • expirereason (string) — The reason the license has been expired, if it is expired.
      • If the license is not expired, this variable will not be assigned a value.
    • groupid (string) — The group ID associated with the license.
    • *hostname (string) — The hostname of the server to which the license belongs.
      • This will be a fully qualified domain name.
      • Example: host.example.com
    • ip (string) — The IP address associated with the license.
    • licenseid (string) — The ID of the license.
    • os (string) — The operating system of the license's server.
    • osver (string) — The operating system version.
    • packageid (string) — The package ID associated with the license.
    • status (boolean) — Describes whether or not the license's information has been returned successfully.
      • 1 — The information was returned successfully.
      • 0 — The information was not returned.
    • updateexpiretime (integer) —
    • version (float) — Internal information used by the Manage2 API.

Examples

Using HTTP (direct API call)

Show Hide

Calling http://manage2.cpanel.net/XMLlicenseInfo.cgi in a browser should produce output similar to the following:

<XMLlicenseInfo reason="OK" status="1" version="0.5">
     <licenses name="L0001" adddate="1246989023" distro="" 
     envtype="" expiredon="" expirereason="" groupid="000001" 
     hostname="" ip="127.0.0.1" os="" osver="" packageid="123" 
     status="1" updateexpiretime="0" version=""/>
</XMLlicenseInfo>

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/XMLlicenseInfo.cgi?output=json&
  • YAMLhttp://manage2.cpanel.net/XMLlicenseInfo.cgi?output=yaml&
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 XMLlicenseInfo.cgi. You are able to 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->fetchLicenses()

PICK Remember: This function does not take any input variables.

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("__USERNAME__","__PASSWORD__");
$lisc = $cpl->fetchLicenses();

?>

PICK Remember: This function does not take any input variables.

PICK Remember: __USERNAME__ and __PASSWORD__ are meant to represent the username and password for your Manage2 account.

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

Topic revision: r19 - 21 Feb 2013 - 19:44:19 - Main.ColinShannon
ManageTwo.XMLLicenseInfo moved from Sandbox.XMLLicenseInfo on 21 Jul 2009 - 19:11 by Main.JustinSchaefer - put it back