Python macros controller

Executor controller service for Python macros. See Python Logic Macros.

Installing/updating

Python macros controller is not included into EVA ICS distribution. To install/update it, either edit “eva/config/python-venv” registry key, specify the desired version in “extra” section (e.g. eva4-controller-py>=0.0.1) and rebuild the Python virtual environment (/opt/eva4/sbin/venvmgr build). Or execute:

/opt/eva4/sbin/venvmgr add eva4-controller-py
# or
/opt/eva4/sbin/venvmgr add eva4-controller-py==N # where N = version number

The latest eva-shell version number can be obtained from https://pypi.org/project/eva4-controller-py/

Setup

Use the template EVA_DIR/share/svc-tpl/svc-tpl-controller-py.yml:

# Python macros controller service
#
# Requires https://pypi.org/project/eva4-controller-py/ Python module installed
command: venv/bin/eva4-svc-controller-py
bus:
  path: var/bus.ipc
config:
  # required for lock functions
  #locker_svc: eva.svc.locker
  # required for mail functions
  #mailer_svc: eva.svc.mailer
  # override macros directory (runtime-relative or absolute)
  #macro_dir: xc/py
  # custom global variables (available in all lmacros)
  #cvars:
    #name: value
    #name2: value2
user: nobody # if file operations are required, make sure the user has access to

Create the service using eva-shell:

eva svc create eva.controller.py /opt/eva4/share/svc-tpl/svc-tpl-controller-py.yml

or using the bus CLI client:

cd /opt/eva4
cat DEPLOY.yml | ./bin/yml2mp | \
    ./sbin/bus ./var/bus.ipc rpc call eva.core svc.deploy -

(see eva.core::svc.deploy for more info)

EAPI methods

See EAPI commons for the common information about the bus, types, errors and RPC calls.

run

Description

Executes a mapped macro action

Parameters

See Macros actions

Returns

See Macros actions