.. _variables: ========== Variables ========== *This chapter describes variables in Orchestra Manager and how to use them.* What a variable is ------------------ Variables in Orchestra Manager store settings and parameters for devices, compositions and fleets. They work like variables in programming: each one holds a value under a name. Variables exist on three levels: **Global**, **Fleet** and **Device**. Each level overrides the level above it. How variables override each other --------------------------------- Variables follow one rule: **the most specific level takes precedence.** Orchestra Manager checks three levels, from the broadest to the most specific: Global → Fleet → Device. **Example:** the ``UPDATE`` variable defines how often devices send updates. .. list-table:: :header-rows: 1 :widths: 20 20 60 * - Level - Value - Devices that receive this value * - Global - ``UPDATE=24h`` - All devices not covered by another level * - Fleet - ``UPDATE=12h`` - Devices in this fleet, except the specific device * - Device - ``UPDATE=1h`` - Only the specific device * - Variables in .yml - ``UPDATE=4h`` - Cannot be overridden, because the value is defined in the .yml application file .. important:: A variable that is defined and assigned a value in the .yml file cannot be overridden. Only references in the ``${VARIABLE}`` format can be overridden. Each level overrides the one above it. As a result, the specific device reports every hour, even though the Global value is 24 hours. Creating a Global variable -------------------------- .. note:: For instructions on creating variables on other levels, see the Fleet and Device chapters. .. TODO: link to the Fleet variables and Device variables pages To create a variable, go to the **Variables** tab in the sidebar. .. image:: images/vr-variables-in-sidebar.png :alt: Variables in the sidebar :align: center :width: 100% Click the **\"+\"** button on the Variables page. .. image:: images/vr-create-button.png :alt: Button for creating a new variable :align: center :width: 100% Specify the variable's key, select the value type (text or file) and provide the value. Then add a description. .. note:: The description is optional, but a clear description is recommended for each variable. The following figure shows an example of a new variable: .. image:: images/vr-creating-variable.png :alt: Example of creating a variable :align: center :width: 100% Changing and deleting a variable -------------------------------- To change or delete a variable, click it in the list of variables. The following pop-up opens: .. image:: images/vr-change-delete.png :alt: Changing or deleting a variable :align: center :width: 100% To delete the variable, click **Delete variable**. To change the key, value or description, edit the corresponding fields and press **Save**. .. note:: A new variable value reaches devices only after the release is restarted.