Raw Lookup — XMLRawlookup.cgi

This Manage2 function allows you to retrieve information about the license associated with a specified IP address.

Variables

Input

The following variable is required:

  • ip (string) — The IP address of the license you wish to retrieve.

The following variables are optional:

  • packageid (integer) — The package that corresponds to the license whose information you wish to retrieve.
  • all (boolean) — Whether to return all licenses currently associated with the specified IP address. (This parameter is intended for use with systems that have multiple licenses on a single IP address.)
    • 1 — yes
    • 0 — no (returns the first active license on the IP address)

Output

  • license (string, or list if all=1 ) — A list of licenses with the following attributes:
    • adddate (integer) — The date the license was added, in Unix time.
    • company (string) — The name of the company to which the license belongs.
    • distro (string) — The operating system distribution.
    • envtype (string) — The virtualization 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 ID of the group 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 that has been looked up.
    • os (string) — The operating system of the license's server.
    • osver (string) — The operating system's version.
    • packageid (string) — The ID of the package to which the license has been assigned.
    • reason (string) — Information about the license lookup operation.
    • status (boolean) — Describes whether or not the license's information has been returned successfully.
      • 1 — The information was returned successfully.
      • 0 — The license does not exist.
      • -1 — The request failed due to an error.
    • updateexpiretime (integer) — The date after which the license will no longer receive updates.
    • valid (boolean) — Describes whether the license is valid or not.
      • 1 — The license is valid.
      • 0 — The license does is not valid.
    • version (float) — Internal information used by the Manage2 API.

Examples

Using HTTP (direct API call)

Calling http://manage2.cpanel.net/XMLRawlookup.cgi?ip=127.0.0.1;all=1 in a web browser will produce XML output similar to the following:

<XMLRawlookup reason="OK" status="1">
      <license adddate="0" company="Testing Company" distro="" envtype=""
          expiredon="" expirereason="" groupid="218370" hostname=""
          ip="127.0.0.1" isenkompass="0" lastrequest="" lastrequest_unixtime=""
          licenseid="5388377" maxusers="" os="" osver="" package="148"
          packageqty="1" status="1" updateexpiretime="" valid="1" version=""/>
      <license adddate="0" company="Testing Company" distro="" envtype=""
          expiredon="" expirereason="" groupid="218370" hostname=""
          ip="127.0.0.1" isenkompass="0" lastrequest="" lastrequest_unixtime=""
          licenseid="5388378" maxusers="0" os="" osver="" package="6140"
          packageqty="1" status="1" updateexpiretime="" valid="1" version=""/>
  </XMLRawlookup>

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/XMLRawlookup.cgi?output=json&ip=127.0.0.1
  • YAMLhttp://manage2.cpanel.net/XMLRawlookup.cgi?output=yaml&ip=127.0.0.1
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 XMLRawlookup.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);
  my $result = $cpl->fetchLicenseRaw(ip => $ip);

In this example:

  • $ip is meant to stand for the IP address that corresponds to the license whose information you wish to retrieve.
  • $user and $pass are meant to stand for your Manage2 account credentials.

You can 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);
  $result = $cpl->fetchLicenseRaw(array("ip" => $ip));
  ?>

In this example:

  • $ip is meant to stand for the IP address that corresponds to the license whose information you wish to retrieve.
  • $user and $pass are meant to stand for your Manage2 account credentials.

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

Topic revision: r20 - 21 Feb 2013 - 19:58:01 - Main.ColinShannon
ManageTwo.XMLRawLookup moved from Sandbox.XMLRawLookup on 21 Jul 2009 - 19:12 by Main.JustinSchaefer - put it back