Forum Discussion
jakauppila_3997
Nimbostratus
Aug 06, 2015TMSH Transactions via Plink
I am trying to automate the creation of some objects via TMSH using Powershell and Plink, I would also like to utilize transactions.
The commands I'm trying to execute are the following:
c...
Kevin_Stewart
Employee
Aug 06, 2015You're best bet will probably be to use TMSH scripts:
https://devcentral.f5.com/wiki/TMSH.Commands.ashx
So a basic example might look like this:
tmsh create cli script transact-script
which creates and opens the script for editing:
create script transact-script {
proc script::init {} {
}
proc script::run {} {
tmsh::begin_transaction
tmsh::create ltm pool [lindex $tmsh::argv 1] members replace-all-with \{ [lindex $tmsh::argv 2] \}
tmsh::commit_transaction
}
proc script::help {} {
}
proc script::tabc {} {
}
}
And then you can then remotely execute this script (with command arguments):
ssh root@bigip 'tmsh run cli script transact-script foobar-pool 10.10.10.10:80'
Where [lindex $tmsh::argv 1] and [lindex $tmsh::argv 2] consume the command line arguments "foobar-pool" and "10.10.10.10:80" respectively.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects