Command-line Execution Services


Execution services allow to create pvmanager services based on command-line execution. The service call will create a process from a given command-line, allows to map some arguments, and returns the result. This allows to gather data from the underlying os, IT infrastructure or anything that can be accessed through a script.

The support includes a general purpose "exec/run" service method that allows a generic command to be run. Other services can be created by writing xml files.

XML syntax

Here is an example of an XML file describing an exec service:

<?xml version="1.0" encoding="UTF-8"?>
<execService ver="1" name="execSample" description="A test service">
<method name="echo" description="A test script">
<command>echo You selected #string#</command>
<argument name="string" description="The string" type="VString"/>
<result name="result" description="The result"/>
<method name="script" description="My script">
<command> #value#"</command>
<argument name="value" description="The value" type="VNumber"/>
<result name="result" description="The script result"/>

Each service method correspon to one command, with specific mappings. A service is a collection of different mehods.

Syntax Description
execService Version is required to be "1". Name and description of the service are required
methods List of methods must be provided
method Each method must have a name and a description
command The command correspond to the actual command passed to the shell. Each command can have multiple arguments noted by #argName#. The arguments are substituted right before execution, in the order they are defined in the argument list.
argument Arguments are optional. Each argument must have a name, a description and a type. Supported type include: VString, VNumber.
result Result must include a name and a description. If the output can be parsed as a table, the service will return a VTable. Otherwise will return a VString.