Integration module based on shell-scripts

From ISPWiki
Jump to: navigation, search

This feature is available in BILLmanager Advanced and BILLmanager Corporate starting from version 5.61.

A universal integration module based on shell-scripts (ShellScripts) is specially designed to sell services managed by shell-scripts on a remote server.

Configuration

In order to set up the processing module, navigate to "Processing modules".

Click "Create" to start the Wizard.


Shellscripts step1-en.png


First, select a product type. The processing module supports all custom (which are not provided by the system by default) and "Shared hosting".

Second, select a processing module. You should select ShellScripts.


Next, fill out the form:

  • IP-address - IP-address of the server where services will be processed;
  • Password - root password to access the server; this field is not displayed unless the "Has root password" option is selected. If not, you will need to enter a public SSH-key in /root/.ssh/authorized_keys of the server;
  • Path to scripts - path on the server where shell-scripts are located.

Finally, fill out the following fields:

  • Name - processing module name;
  • Responsible department - select a department that will be responsible for various tasks, when needed;
  • Sorting - processing module priority; the module with the highest priority will be applied first if there are several processing modules

Supported scripts

The module requires the following scripts:

  • open.sh
  • resume.sh
  • suspend.sh
  • close.sh

+ setparam.sh, if you want to allow users to edit order parameters.

Requirements to the open.sh script

The following data are passed as parameters to the script during service activation:

  • values for tariff add-on in the format --addon=value
  • values for tariff parameters --param=value
  • automatically generated username and password: --password=<password> --user=<username>

The script should return code 0 and the string starting with "OK" (in the Latin alphabet letters), then the string should contain the following parameters space separated: --param1=value --param2=value ... --paramN=value. The obligatory parameter that should be returned - "id", which is a unique identifier of the newly created service. It will be used for further service processing, All output parameters are saved into the itemparam table of the database. The id parameters is saved as externalid. user and password are also saved in itemparam.

Requirements to theresume.sh, suspend.sh, close.sh. Two parameters are passed: --id=<externalid> --user=<username> (where username is a username generated during service activation). If a success, the scripts should return code 0 and the string starting with "OK".

Requirements to custom product type

A custom product type may have any number of parameters and add-ons. Values from them are passed into the open.sh. script during service activation.

After service activation the following parameters are saved into the database (even if they are not specified in a product's configuration form): externalid, user, password. If you want them to be displayed on a service edit form, create parameters with the same names in the product type module.