genvid.toolbox.EventsTool

Warning

This module has been deprecated. Although the code is still working for our oldest model, it is not expected to work with the new Bastion API. Please use the new genvid-sdk tool.

class genvid.toolbox.EventsTool(**kwargs)

Bases: genvid.toolbox.config.ConfigTool

Tool that manages events configuration.

MAP_REDUCES = 'genvid/events/mapreduce/'

The key prefix for all map-reduce definitions.

add_events_commands()

Add the events commands to the parser.

Run from add_commands() to add the events commands to the parser.

get_map_reduce_items()

Get all map-reduce definitions available.

load_map_reduce(name, path)

Load a map-reduce from a file.

If the file ends with .hcl, use the HCL format for map-reduce. Otherwise, consider it a JSON file.

map_reduce_hcl_to_json(hcldef)

Transform the map object produced by map “<id>” {} hcl syntax into the expected { “maps” : [ { “id”: … ] } object for events.

print_map_reduce()

Print the list of map-reduce configured on stdout.

run_events_command(command, options)

Detect if the command is an events command and execute it.

Call from run_command() to handle events commands. Events commands are added with the help of add_events_commands().

Returns:

handled, result: A tuple with a boolean saying if the
command were handled and it’s result if it was.
update_map_reduce(name, mrdef)

Update a map-reduce definition.

class config.EventsTool

Implementation of genvid.toolbox.EventsTool