R1Soft License Pool API

Search Support and Licensing Documentation
Searching Support and Licensing Documentation
Support and Licensing Documentation

R1Soft License Pool API

This document provide you with scripts for passing needed variables when issuing CDP Server key.

Script 1

The script shows how to retrieve information about a pooled license.

Note
It will require you to put in the '$accOwner', '$accPass', '$licPool'.
<?php
require_once('xmlrpc.inc');
$accOwner = '';
$accPass = '';
$licPool = '';
$client = new xmlrpc_client('https://api.r1soft.com/xmlrpc');
$client->setCredentials($accOwner, $accPass);
#$client->debug = true;
$xmlrpc_msg = new xmlrpcmsg('licensing.getLicense', array(
        new xmlrpcval($licPool, 'string')
));
$reply = $client->send($xmlrpc_msg);
if (!$reply) {
    print "<p>Could not connect to HTTP server.</p>";
} elseif ($reply->faultCode()) {
    print "XML-RPC Fault #" . $reply->faultCode() . ": " .
        $reply->faultString();
} else  {
$val = $reply->value();
$arr = php_xmlrpc_decode($val);
print_r($arr);
}
?>

Ouput:

[root@devtest html]# php testLicApi.php
Array
(
    [Enabled] => 1
    [Archiving Add-ons Capacity] => 100
    [Archiving Add-ons Available] => 91
    [Service Provider API Add-on] => 1
    [CDP for MySQL Add-ons Available] => 89
    [CDP for Control Panels Add-on] => 1
    [Windows Agents Available] => 79
    [Windows Agents Capacity] => 100
    [Linux Agents Capacity] => 125
    [CDP for MySQL Add-ons Capacity] => 102
    [ID] => 5c3dc847-5dbd-454a-9a5c-1545a02e68ee
    [Linux Agents Available] => 104
)



Script 2

The following script is used to generate a new license key from the License Pool. Required variables are:

  • # Linux Agents
  • # Windows Agents
  • # Archive Add-on modules
  • # MySQL Add-on modules
  • API Utility: True/False
  • Control Panel Utility: True/False
    Note
    You will be required to put in the '$accOwner', '$accPass', '$licPool'.
    <?php
    
    require_once('xmlrpc.inc');
    
    $accOwner = '';
    $accPass = '';
    $licPool = '';
    $licType = 'CDP Server Stand Alone (Linux)';
    $client = new xmlrpc_client('https://api.r1soft.com/xmlrpc');
    $client->setCredentials($accOwner, $accPass);
    #$client->debug = true;
    // License properties
    $linAgents = '5';
    $winAgents = '5';
    $cpAddOn = '1';
    $mysqlAddOn = '3';
    $apiAddOn = '1';
    $archiveAddOn = '2';
    $pooledLicense = '1';
    // end license properties
    
    $xmlrpc_msg = new xmlrpcmsg('licensing.createPooledLicense', array(
            new xmlrpcval($licPool, "string"),
            new xmlrpcval($licType, "string"),
            new xmlrpcval(
            array(
            "Linux Agents" =>  new xmlrpcval($linAgents, "int"),
            "Windows Agents"  => new xmlrpcval($winAgents, "int"),
            "CDP for Control Panels Add-on" =>  new xmlrpcval($cpAddOn, "boolean"),
            "CDP for MySQL Add-ons" => new xmlrpcval($mysqlAddOn, "int"),
            "Service Provider API Add-on"  => new xmlrpcval($apiAddOn, "boolean"),
            "Archiving Add-ons" => new xmlrpcval($archiveAddOn, "int"),
            "Pooled License"  => new xmlrpcval($pooledLicense, "boolean")
            ), "struct"),
      ),"array"
      );
    
    $reply = $client->send($xmlrpc_msg);
    if (!$reply) {
        print "<p>Could not connect to HTTP server.</p>";
    } elseif ($reply->faultCode()) {
        print "XML-RPC Fault #" . $reply->faultCode() . ": " .
            $reply->faultString();
    } else  {
    
    $val = $reply->value();
    $arr = php_xmlrpc_decode($val);
    print_r($arr);
    }
    ?>

    Output:

    [root@devtest html]# php licenseAdd.php
    Array
    (
        [Enabled] => 1
        [Product] => CDP Server Stand Alone (Linux)
        [Windows Agents] => 5
        [Type] => Pooled License
        [CDP for MySQL Add-ons] => 3
        [Linux Agents] => 5
        [License Pool ID] => 5c3dc847-5dbd-454a-9a5c-1545a02e68ee
        [Archiving Add-ons] => 2
        [ID] => 60486d4e-24f4-4a8d-8d24-46abeb4eb0f1
        [Installed] =>
    )
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.