This documentation relates to an earlier version of JeraSoft VCS.
View User Guide 3.20 or visit our current documentation home page.
Skip to end of metadata
Go to start of metadata
On this page


The following section allows configuring and monitoring of hooks for Provisioning API

Provisioning API provides a mechanism for a real-time integration with 3rd party systems, including softswitches, gateways and CRM systems.  It calls pre-defined handlers on an occurrence of specific events in the system. The handlers are allowed to modify data, allow or forbid the action or simply process given event.
 

For detailed information about Provisioning API functionality, go to the APIs section of your User Guide.

To configure handlers and check their call log, go to the System → Provisioning API.

The full list of Provisioning API parameters matches with CoreAPI and they are available upon an individual request of your current clients.

 

Screenshot: Provisioning section


 

Column NameDescription
IDHandler's identification number
StatusState of the handler: enabled/disabled/archived
Priority

Order of importance to perform handlers

NameHandler's title
Event

Description of the event and performance period (before/after) of the handler

Handler

Category of the handler that is used and location. There are two types of handlers that can be used: 

  • HTTP scripts, called via POST requests (used in most cases)
  • Local server scripts, called locally on the server (used in very specific cases)
IconDescription
  Is used to identify a disabled state of handler
  Is used to identify an enabled state of handler
 Is used to quick open of execution logs tab
Is used to delete a handler from the system
  1. Click the status icon to quickly update the state of the handler.
  2. To view the details of handlers' performance, click the logs icon from the full list of the section.

Creating New Handler

To start with provisioning, you need to create a handler manually. Click the "New Handler" button on the toolbar to add it. Then, specify respective parameters.


Screenshot: Provisioning section/Handler adding form

SectionFields Description
General Information

 

General information about handler
  • Name
Specify a particular title for the handler
  • Event

Select an action and the period (before/after) that a handler should be run

 

  • After Action - in this case, you simply handle the action. 
    In most cases, if you don't need to modify data, we recommend using handlers with "after" type of event.

  • Before Action - in this case, you can modify incoming data and push it back to the VCS or forbid the action.
  • Task

Determine a type of handler and details:

  • script - here you need to specify the path where a following script is located,
    for example: user/local/vcs/script.py.
  • http:// - here specify the port and method,
    for example: 120.0.0.1:5000/api.
  • Status

Choose the state of the handler:

  • enabled - select it to make a handler active;
  • disabled - select it to unable a handler;
  • archived - select it to archive a handler.
  • Priority

Establish an order of handler performing.
Note: The handler with 1 priority will precede all other handlers in order.

Best practice example

Here there is an example how to apply the script handler.

  1. Open the Provisioning section and start to create a handler.
    1. Specify the name, type and status.
    2. Find "Event" field. Here, select "Before" and "Clients Create" event from the drop-down list.
    3. Find "Task" field in this form. Here, indicate "script" type and determine the location of the script, for example: user/local/vcs/script.py.
    4. Click "Apply".

We have the next script (see below) with the following location: devel/vcs/script.py.

import sys 
import json 
input = '\n'.join(sys.stdin.readlines()) 
 
data = json.loads(input) 
data['name'] = data['name'] + "testprefix" 
 
print json.dumps(data)

As a result, this handler will add the prefix to the name of the client after creation.
 

Here there is an example based on http:// handler usage.

2. Open the Provisioning section and start to create a handler.

    1. Specify the name, type and status.
    2. Find "Event" field. Here, select "After" and "Clients Create" event from the drop-down list.
    3. Find "Task" field in this form. Here, indicate "http://" type and determine the port and method, for example, 120.0.0.1:5000/api.
    4. Click "Apply".

Find below an example of the http:// handler:

from flask import Flask, request
import json
app = Flask(__name__)
@app.route("/api", methods=['GET', 'POST'])
def api():
    data = json.loads(request.data)
    return json.dumps(data)
if __name__ == "__main__":
    app.run()

Execution Logs tab

You can access the details about handler execution in this tab. Here there is a list of logs with handler's status, execution duration, errors and date, information that the billing sends via handler.

 

Screenshot: List of execution logs

Column NameDescription
IDHandler's identification number
DateParticular period of time
EventDetails of the handler type and event
StatusState of the handler: success/fail
Name

Title of the handler

ErrorDescription of the event
Duration

Period of time during which the handler was performing

Icon Details icon for access to an additional information about handler performance


When you click the Details icon , a new window with a description of respective handler execution appears (see screenshot below). This windows contains an information that the billing sends via handler.
Click this icon  to expand logs. 

 

Screenshot: Provisioning details

 For example, logs for handlers with "before" type of event will only show modified data. 

Quick Handler Search

Use the Quick Search toolbar for fast investigation in this sectionThis tool makes a search filter to limit the results for higher working efficiency. For example, to find handlers by the status or event. To open this form click on the down arrow .
 

Screenshot: Provisioning section/quick search toolbar

To effective search, use an asterisk * for the next fields: Name, Task, Data, Error.


Please note, the Provisioning functionality is experimental and may be changed completely in future releases.

  • No labels