gtm scenario
The gtm scenario command manages the rules that reduce the result of one or of more than one health check to a single decision. The decision of the scenario determines the taking part of the DNS records in the answer, the switch to the backup center and the internet state of the local center. Its panel equivalent is the Health Scenarios screen.
The decision is formed in two stages: the result of the condition is the base state of the scenario; the passage from the base state to the final decision, on the other hand, is managed with the activation and deactivation settings.
Command Summary
Required Fields
| Order | Field | Status | Value |
|---|---|---|---|
| 1 | name | Required | The name of the scenario |
There is no other required field. A scenario created without a condition being written does not produce a decision; the condition can be added afterwards with an update.
The Condition
The --hcCond field is the condition that determines the base state of the scenario. The health checks are combined in this condition.
| Field | Value |
|---|---|
--hcCond | The condition expression built from the health checks |
The writing of the condition
The condition expression can be written on the command line as well; the terms that can be used at the point one is at are completed with Tab. The building of the conditions that group more than one check is more practical in the panel visually.
If the check result is positive the condition counts as true, and if it is negative as false; in the checks whose result is uncertain the last decision is preserved.
Activation and Deactivation
How the scenario will pass from the base state to the final decision is determined with two fields.
| Field | Default | Value |
|---|---|---|
--triggerTurn | auto | How the scenario will become active when the condition is met |
--triggerReturn | auto | How the scenario will return to passive when the condition is broken |
| Value | Behavior |
|---|---|
auto | The scenario follows the base state by itself |
on | First the trigger actions are run; the scenario waits until the verification condition is met |
When on is selected, two more fields are used in the related direction:
| Direction | The action list | The verification condition |
|---|---|---|
| Activation | --triggerTurnActions.0 | --triggerTurnCond |
| Deactivation | --triggerReturnActions.0 | --triggerReturnCond |
- The actions run in the order in the list and are selected from among the trigger profiles defined with
gtm trigger. - The verification condition is evaluated with the health check results independently of the result of the triggers.
- When the direction is returned to the
autovalue and is saved, the action list and the verification condition belonging to that direction are deleted from the scenario.
The option of turning the deactivation off is not present on the command line
In the panel there is a third option for the deactivation (a scenario that has once become active staying active). On the command line this field accepts only the auto and on values; the behavior in question is set from the panel.
Examples
Where the Scenario Is Used
| Where | How it is bound |
|---|---|
| The health state of the address in a DNS record | gtm dns-record update id <record> --recordConfig.0.records.0.cond <scenario> |
| The switch to the backup center | gtm dns-record update id <record> --drCond <scenario> |
| The internet state of the local center | gtm data-center-local update --internetScenario <scenario> |
Updating and Deleting
Things to Know
- A scenario does not do anything on its own. Its decision does a job when it is bound to a DNS record, to a switch condition or to the internet setting of the local center.
- A scenario without a condition does not produce a decision. A scenario created only with a name does not give a result until a condition is added.
- The triggered directions are two-staged. First the actions run, then the verification condition is waited for; without the condition being met the direction is not completed.
- Changing a direction deletes data. When a direction is returned to the
autovalue, the action list and the verification condition belonging to that direction are deleted while it is being saved.
