Python Connector Agent Configuration

To open the Python Connector agent configuration, click  Build → New Configuration . Select  Workflow  from the Configurations dialog. When prompted to  Select workflow type , select  Realtime . Click Add agent and select Python Connector in the Collection tab in the Agent Selection dialog. Double-click the agent icon or right-click the icon and select  Edit agent , to display the Agent Configuration dialog.

The Python Connector agent configuration has three tabs: General, API and MIM.

General Tab

The Python Connector agent - General tab

Setting

Description

Setting

Description

Host

The IP address or hostname to which the Python Connector will bind. If left empty, the Python Connector binds to all IP addresses available on the system.

Port

The port number on which the Python Connector will bind. Ensure that the port is not used by other applications.

Allow Multiple Connections

If enabled, several connections are allowed simultaneously. If disabled, only one at a time is allowed.

Number of Connections Allowed

If Allow Multiple Connections is enabled, the maximum number of simultaneous connections is specified as a number between 0 and 99999.

Use Connection Control

Select this option if you want to control connection requests individually. If you select this option, you may need to make a selection for Route Connection Requests on. See the description below.

Route Connection Requests on

Select on which route you want to route connection requests when a user requests to connect. Select one of the possible routes listed in the drop-down list.

Use per Connection Routing

Select this check box if you want to control what each individual connection is routing.

Use TLS

Select this check box if you want to use TLS. When you select this check box, the Security Profile selection and Require Client Authentication checkbox is enabled.

If you want connections to use SSL, see Connecting Using SSL.

Security Profile

Require Client Authentication

Select this check box if you require client authentication from all connecting clients.

Accepted Types

Select which data types are to be accepted by the Python Connector agent. You can select UDR types or bytearrays.

Output Routes

Enter which route accepts what data type.

API Tab

The API tab allows you to define your own agent API exposed to your connecting users.

You can use __all__ = ['<name1>', '<name2>', ..] to only expose the names listed as the API instead of adding to the default API. See the example shown in the image below. 

For further information on writing code in the API tab, see Python Writer's Guide.

Python Connector agent - API tab

MIM Tab

In the MIM tab you can set the MIMs that you want the the Python Connector agent to publish.

Python Connector agent - MIM tab

Parameter

Description

Parameter

Description

Assigned

Select the type of MIM assigned. Only MIMs of the global type are available.

Name

Enter the MIM resource name.

Type

Select the data type of MIM resource.

Connecting with an Exploration Tool using Python

To be able to connect the exploration tool of your choice to the Python Connector agent, you must first import the connector Python module: mzconnector.py. The connector module, mzconnector.py, is extracted to MZ_HOME/python during installation. For easy access, you can copy this module to a directory on your local machine, which you will connect from.

All the Python code, which also includes the Python code in the API tab and the code imported from the Python Module profile, is executed by the Python process that connects on your local machine, while the APL code is executed on the EC server.

After you have configured a Python Connector agent within a real-time workflow, you must start the workflow before you can start to interact using an exploration tool.

You can then start to run your script. In the following example, Jupyter Notebook is used to connect to a simple workflow.

Example - Interaction via Python Connector agent

The Python Connector agent is configured to accept DRUDR types.

The Analysis agent is configured to debug the input and send UDRs to route r_2 back to the Python Connector agent.

As shown below, you can trigger activity in the workflow using an exploration tool, Jupyter Notebook is used in this example.