Configuring Conditional Statements

Use the condition builder in the runbook visual designer to configure conditional statements for tasks or containers in Fleet Application Management.

The execution of runbook tasks is based on the conditional statements that you specify.

You can build conditions that decide the relevance of a task that apply to a product or component of a product.

    1. Open the navigation menu and click Observability & Management. Under Fleet Application Management, click Actions and Controls.
    2. On the Runbooks tab, click Create runbook. Populate the fields. For field descriptions, see Creating a Runbook.
    3. On the Streamline (Design Runbook) page, create a conditional statement for containers or tasks as follows:
      1. Select the component that you want to configure on the canvas work area, and then click the settings icon ( settings-icon) to configure conditions by using the Properties tab.
      2. For Condition, click to open the Condition dialog box.
      3. Select a variable or products, components, properties from the box on the left side to add it to the condition box on the right side.
      4. Select one of the arithmetic operators, such as AND, NOT, or others.
      5. Enter a value for the condition in the condition box. Following are the examples of conditional statements:
        • For the following condition, if the backuptype variable for a task equals the value hot, the task is run, or the condition builder skips and proceeds to the next task.
          backuptype=hot
        • An example for the Run on grammar condition is as follows:
          target.product.name = <product_name>
          target.product.properties.<property_name> = <property_value>
          target.product.components.has(<component_name>)
          target.product.components.<component_name>.properties.<property_name> = <property_value>
          Note

          The conditions based on properties depend on your understanding of product discovery.
      6. Add more conditional statements as needed. These statements are added to the next row in the condition box.
  • Use the oci fleet-apps-management fleet-apps-management-runbooks runbook create command and required parameters to create a custom runbook:

    oci fleet-apps-management fleet-apps-management-runbooks runbook create [OPTIONS]

    For a complete list of flags and variable options for Fleet Application Management CLI commands, see the CLI for Fleet Application Management.

  • Run the CreateRunbook operation to create a custom runbook.