Forum Discussion
transaction partial runs
Is it possible to partially run a transaction, run some checks, then add more calls to the same transaction?
I will have several sets of iControlRest calls that may or may not fire based on a conditional. Each set of calls will be associated with its own conditional statement, and previous sets of calls may affect the outcome of future conditional checks.
For example, lets say the first conditional checks if a pool exists. If it does, it adds node1 to it. The next conditional checks if node1 is part of a pool. If it is not part of a pool, it deletes it.
There may be many of these types of checks and calls, there may be multiple calls per check or vice versa. I do not know what calls or checks will be made ahead of time (they will be user generated).
I need to be able to undo all of the calls made if any of them fail so as not to leave the system in a strange state. I cannot use a transaction in the traditional way because I need to check the conditional for the next set of calls before calling them.
If it is not possible to partially run a transaction, is it possible to set a point before the calls begin executing, then if a call fails, roll back to that point, or something along those lines?
Thanks.
- Satoshi_Toyosa1Ret. Employee
You can write your own tmsh script and call it from the
endpoint. See/mgmt/tm/cli/script
- Executing A TCL/CLI Script From iControlRest
- Call TMSH script with a curl command?
- Master list of tmsh commands
- TMSH Scripting in v10.1
tmsh script allow you to use transactions (see
, etc.)tmsh::begin_transaction
Depending on what you would allow users to perform, make sure you write the script super robust.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com