sequence ======== Sequential execute the functions. Function Arguments ------------------ .. list-table:: :widths: 20 10 60 :header-rows: 1 :align: left * - Name - Type - Description * - functions - list - The list of the function expression. Description ----------- The input of the next function is the output of the previous function. The concept is:: data = Func1(data) data = Func2(data) ... This function is very useful when you want to union the outputs of a series of :ref:`probe functions `. Examples -------- Assume that we want to design a probe statement to probe general information from the device. The expected probed data should contain two fields: - ``device_sku`` comes from the command ``cros_config /identity sku-id`` - ``device_version`` from the command ``get_version --board``. Instead of implementing a new probe function, we can reuse the existing :doc:`shell function `, which executes a single command, and writes a probe statement like:: { "eval": { "sequence": { "functions": [ { "shell": { "command": "cros_config /identity sku-id", "key": "device_sku" } }, { "shell": { "command": "get_version --board", "key": "device_version" } } ] } } } The expected probed results is:: [ { "device_sku": , "device_version": } ] As this function is very common to use, the probe framework also supplies a syntax sugar for it. Above probe statement can be simplified to:: { "eval": [ # A list of functions means to apply the `sequence` # function. { "shell": { "command": "cros_config /identity sku-id", "key": "device_sku" } }, { "shell": { "command": "get_version --board", "key": "device_version" } } ] }