...
Screenshot: Advanced Search drop-down menu
Image RemovedImage Added
Field | Description |
---|
Event | Select from a list of all possible handler events |
Handler Type | Indicate type of handler: |
Status | Choose a target status:
or leave this field blank. In this case, both enabled and disabled handlers will be displayed. This field is empty by default |
...
Screenshot: Provisioning section/Handler adding form
Image RemovedImage Added
Field | Description |
---|
Name | Specify a particular title for a handler |
Event | Specify a handler event from the following list: |
Clients | - create
- update
- delete
- archive
- custom fields update
- balance became >=0
- balance became <=0
|
Accounts | |
Clients Packages | - assign
- activate
- deactivate
- renew
- close
|
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. |
Panel |
---|
borderColor | #ffffb3 |
---|
bgColor | #ffffb3 |
---|
borderWidth | 2px |
---|
|
Attention In VCS 3.1617.0, to prevent performance degradation and data inconsistency, affected by external side, Before event type has been removed from the section. |
Panel |
---|
borderColor | #ccffcc |
---|
bgColor | #ccffcc |
---|
borderWidth | 2px |
---|
borderStyle | solid |
---|
|
Image Modified Best practice exampleHere there is an example how to apply the script handler.- Open the Provisioning section and create a handler.
- Specify the name, type, and status.
- In Event field select Clients Create event from the drop-down list.
- In Task field indicate script type and determine the location of the script, for example: /provisioning/script.py.
- Click Apply.
We have the next script (see below) with the following location: /provisioning/script.py. Code Block |
---|
| #!/usr/bin/env python2.7
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. - Specify the name, type, and status.
- In Event field select Clients Create event from the drop-down list.
- In Task field indicate http:// type and determine the port and method, for example: 120.0.0.1:5000/api.
- Click Apply.
Find below an example of the http://handler: Code Block |
---|
| 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() |
|
...
You can access the details about handler execution in this tab. For more details, check out a related article: Execution Logs.
Panel |
---|
borderColor | #FFBABA |
---|
bgColor | #FFBABA |
---|
borderWidth | 2px |
---|
borderStyle | solid |
---|
|
Warning Please note, the Provisioning functionality is experimental and may be changed completely in future releases. |
...