Skip to content
Smarter by Design.Simpler for Business

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 ​

TR7 WEB-CLI · gtm scenario
admin@TR7LBWAF01> gtm scenario list # list them all
admin@TR7LBWAF01> gtm scenario show <id> # show one
admin@TR7LBWAF01> gtm scenario add name <name> … # a new scenario
admin@TR7LBWAF01> gtm scenario update id <id> … # change
admin@TR7LBWAF01> gtm scenario delete <id> # delete
admin@TR7LBWAF01>  

Required Fields ​

OrderFieldStatusValue
1nameRequiredThe 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.

FieldValue
--hcCondThe 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.

FieldDefaultValue
--triggerTurnautoHow the scenario will become active when the condition is met
--triggerReturnautoHow the scenario will return to passive when the condition is broken
ValueBehavior
autoThe scenario follows the base state by itself
onFirst 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:

DirectionThe action listThe 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 auto value 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 ​

TR7 WEB-CLI · A) Creating a scenario
admin@TR7LBWAF01> gtm scenario add name primary-center
# the condition can be added afterwards
admin@TR7LBWAF01> gtm scenario update id <id> --hcCond <condition>
admin@TR7LBWAF01>  
TR7 WEB-CLI · B) A triggered activation
# when the condition is met let the trigger run first, then let the verification condition be waited for
admin@TR7LBWAF01> gtm scenario update id <id> --triggerTurn on \
--triggerTurnActions.0 <trigger> --triggerTurnCond <condition>
admin@TR7LBWAF01>  
TR7 WEB-CLI · C) Taking back a triggered activation
# returning to the auto value deletes the action list and the verification condition
admin@TR7LBWAF01> gtm scenario update id <id> --triggerTurn auto
admin@TR7LBWAF01>  

Where the Scenario Is Used ​

WhereHow it is bound
The health state of the address in a DNS recordgtm dns-record update id <record> --recordConfig.0.records.0.cond <scenario>
The switch to the backup centergtm dns-record update id <record> --drCond <scenario>
The internet state of the local centergtm data-center-local update --internetScenario <scenario>

Updating and Deleting ​

TR7 WEB-CLI · update and delete
admin@TR7LBWAF01> gtm scenario update id <id> --triggerReturn on --triggerReturnActions.0 <trigger>
admin@TR7LBWAF01> gtm scenario delete <id>
admin@TR7LBWAF01>  

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 auto value, the action list and the verification condition belonging to that direction are deleted while it is being saved.