Dispatchers

In Extra Horizon, you can create Dispatchers which trigger Actions based on incoming events. You can manage these Dispatchers and their Actions using the Extra Horizon CLI by creating and consuming a JSON file containing all your Dispatchers. This JSON file can then be easily managed through version control and the CLI will help you to synchronize the Dispatchers with Extra Horizon.

circle-info

For information regarding Dispatchers and the Dispatcher Service please refer to the Dispatcher Service documentationarrow-up-right.

Create a new dispatcher

To create a new dispatcher, you can use the init command. This command will generate a minimal dispatcher for you to start out with.

This example will create a new dispatcher at the top of dispatchers.json file. If the dispatchers.json file does not exist, it will be created.

exh dispatchers init <dispatcher-name>

After editing the dispatcher file to your liking, you can use the exh dispatchers sync command to upload your new dispatcher to your Extra Horizon cloud.

Arguments

--file

Optional. Path to the JSON file containing the dispatchers. Defaults to ./dispatchers.json. If the specified file does not exist, it is created.

Synchronizing Dispatchers

This command provides the functionality to read a locally declared Dispatchers file and synchronize the contents with existing Dispatchers.

exh dispatchers sync

A tag with value EXH_CLI_MANAGED will be appended to Dispatchers created with the CLI.

The CLI will only consider Dispatchers with the EXH_CLI_MANAGED tag for updates or deletions.

Arguments

--file

Optional. Path to the JSON file containing the dispatchers. Defaults to ./dispatchers.json.

--clean

This optional argument will delete all Dispatchers with the EXH_CLI_MANAGED tag that are not present in the local Dispatchers file.

circle-exclamation

Example

File format

Dispatchers must be provided in a .json file as defined in the arguments section. This file must contain an array of Dispatcher objects as shown in the example below.

For detailed information regarding the structure of a Dispatcher, please refer to the section Create your first Dispatcherarrow-up-right.

Example

Last updated