Service syntax

From Upsilon Project
Jump to: navigation, search

Services look like this is in the config file:

<config>
    ...
    <service id = "checkFoo" commandRef = "bar" />
    ...
</config>

Where, the ID of the service is a unique identifier, and commandRef is a reference to the <comment /> that wll be used.

Services sometimes need to fill out arguments in a command;

<config>
    ...
    <service id = "checkFoo" commandRef = "bar">
        <argument>arg1value</argument>
    </service>
    ...
</config>

Aarguments are passeed to the command in the order they are defined.

<config>
    ...
    <command id = "checkFoo" exec "echo $ARG1 $ARG2 $ARG3" />
    <service id = "checkFoo" commandRef = "bar">
        <argument>arg1value</argument>
        <argument>arg2value</argument>
        <argument>arg3value</argument>
    </service>
    ...
</config>

In the above example, upsilon would literally try to execute; echo arg1value arg2value arg3value. Arguments are simply found and replaced using their relative position. For more information, see Command syntax.

Arguments

Name Type Default Required Description
parent Service ID (string) - Optional The parent for this service. Default values are derived from the parent.
register boolean true Optional Actaully try to execute this service & send it to peers?
id Unique string, no spaces or special chars. - Required Used to identify the service.
minDelay
maxDelay
successfulUpdateIncrement
timeout
commandRef