NOC API

From Webuzo Wiki
Jump to: navigation, search

Overview

If you are a Webuzo NOC and want to automate Webuzo License management you can do that easily with the Webuzo NOC API.


Download

The Webuzo NOC API is available only to the NOCs and you can download it from the NOC Panel :
http://www.softaculous.com/noc?ca=download_api
There are many examples at the bottom of the API file to test.


Examples

Here are a few examples to manage Webuzo Licenses.
NOTE : You should include the NOC API file that you just downloaded. And initiate the Class using your NOCusername and NOCpassword or API KEY and API Pass

include_once 'noc_api.inc';
$noc = new SOFT_NOC('username', 'password');


Purchase/Renew Webuzo Licenses

$noc->webuzo_buy('188.188.188.188', '1M', 1, 'test@test.com', 1);
  • 1st Parameter : Your server's IP
  • 2nd Parameter : The period for which you wish to renew. 1M will extend by one months, 8M will extend by eight months, 1Y will extend by One year
  • 3rd Parameter : Server type 1 for Dedicated and 2 for VPS
  • 4th Parameter : Authorized email (You will get expiry notifications here)
  • 5th Parameter : Auto Renew 1 to enable auto renew and 2 to disable auto renew.


List Webuzo License Details

$noc->webuzo_licenses();
  • All Parameters are optional. If no parameter is passed it will list the details of all the licenses under your account.
  • 1st Parameter : License Key. This will search by License key.
  • 2nd Parameter : Server IP. This will search by Server IP.
  • 3rd Parameter : Expiry date. Possible values 1, 2, 3.
    • 1 - All Expired Licenses under your account
    • 2 - Expiring in 7 Days
    • 3 - Expiring in 15 Days
  • 4th Parameter : Start value. This is the start limit of the number of licenses you wish to list. Eg you wish to list the licenses from 100th license pass the value as 99.
  • 5th Parameter : Length of return from start value. This is the number of licenses you wish to list from the start value. Eg you wish to list the 100th licenses pass the start value as 99 and length value as 1.
  • 6th Parameter : Authorized Email. This will list the licenses with the provided email.


Edit IP of a Webuzo License

$noc->webuzo_editips(1000, '198.198.198.198');
  • 1st Parameter : License ID. You can get the license id from the licenses() function.
  • 2nd Parameter : New IP. This is the new IP for the provided license.


License Logs

$noc->webuzo_licenselogs('WEBUZO-88888-88888-88888-88888');
  • 1st Parameter : License Key for which you need license logs.


Auto Renewals

$noc->webuzo_autorenewals();
  • All Parameters are optional. If no parameters are passed it will list all the licenses with Auto Renewals under your account.
  • 1st Parameter : License Key. This will search by License key.
  • 2nd Parameter : Server IP. This will search by Server IP.
  • 3th Parameter : Start value. This is the start limit of the number of licenses you wish to list. Eg you wish to list the licenses from 100th license pass the value as 99.
  • 4th Parameter : Length of return from start value. This is the number of licenses you wish to list from the start value. Eg you wish to list the 100th licenses pass the start value as 99 and length value as 1.


Add Auto Renewal

$noc->webuzo_addautorenewal('WEBUZO-88888-88888-88888-88888');
  • 1st Parameter : License Key for which you want to enable Auto Renewal.


Cancel Auto Renewal

$noc->webuzo_removeautorenewal('WEBUZO-88888-88888-88888-88888');
  • 1st Parameter : License Key for which you want to disable Auto Renewal.


Refund a Transaction

$noc->webuzo_refund(100);
  • 1st Parameter : Action ID for which you wish to claim a Refund. You can get the action id from the webuzo_licenselogs() function.


Cancel Webuzo License

$noc->webuzo_cancel('WEBUZO-88888-88888-88888-88888', '198.198.198.198');
  • Only one parameter is compulsory. You can pass any one parameter.
  • 1st Parameter : License Key for which you want to cancel license.
  • 2nd Parameter : Server IP for which you want to cancel license.


Refund and Cancel Webuzo License

This function will first refund all the eligible transactions and then cancel the license.

$noc->webuzo_refund_and_cancel('WEBUZO-88888-88888-88888-88888', '198.198.198.198');
  • Only one parameter is compulsory. You can pass any one parameter.
  • 1st Parameter : License Key for which you want to refund and then cancel license.
  • 2nd Parameter : Server IP for which you want to refund and then cancel license.


Webuzo Trial License

This function will issue a 1 month Premium Trial License to the given IP.

$noc->webuzotrial('198.198.198.198', 1);
  • 1st Parameter : Server IP for which you want to issue a Trial License.
  • 2nd Parameter : Server type 1 for Dedicated and 2 for VPS.


Debugging

  • If there are any Errors while executing the above tasks the Errors will be returned in the $noc->error variable. You can print the errors :
$noc->r($noc->error);
  • If the above variable is empty then the tasks were completed without any errors.