Actions

An action is a specific step in a processing pipeline that performs a specific task on an item being processed. In the context of the documentation provided so far, an action is represented as a key-value pair in a YAML file, where the key is the name of the action (e.g. “remove_unwanted”) and the value is a dictionary containing details about how the action should be performed.

A processing pipeline is a series of actions that are applied to an item in a specific order, with the goal of transforming or manipulating the item in some way. In the YAML examples provided, each action is a key in the actions dictionary, and the processing pipeline consists of all the actions listed in the actions dictionary.

For example, in the following YAML file:

actions:
  remove_unwanted_fields:
    action: remove
    keys: [GROUP, TYPE, UID, ATTRIBUTE_CODE, DUMP_TIMESTAMP, MEASUREMENT_FAMILY]
  add_timestamp:
    action: add_field
    field: TIMESTAMP
    value: "{{ now() }}"
  rename_fields:
    action: rename
    mapping: { OLD_FIELD_NAME: NEW_FIELD_NAME, OLD_FIELD_NAME_2: NEW_FIELD_NAME_2 }

The processing pipeline consists of actions: remove_unwanted_fields, add_timestamp and rename_fields. These actions will be applied to the item in the order they are listed, starting with remove_unwanted_fields and ending with rename_fields.