Forum Discussion
Best practices for handling batches of commands via REST
I am seeking suggestions on how best to handle a batch of commands for LTM. For example, if there is an existing route domain, whats the best way to add another VLAN?
There are several steps required: - Associate the VLAN to the existing RD - Create IPv4 self IPs on each cluster member - Create a floating IPv4 IP for the VLAN - Create IPv6 self IPs on each cluster member - Create a floating IPv6 IP for the VLAN
We have our own home brew automation tool that we're incorporating into this design, so we'd prefer not to rely on middleware for managing configuration transactions. This is a distributed application, so many processes may be modifying the configuration simultaneously on the same device.
My questions in summary are: - Whats the best way to send this batch of commands? Execute each one separately then validate individually after each REST call? - If there is an error in any step, what's the best path? Error out? Roll back? If that's the case, what would be the best way to do so? - Is there a "check point" that can be configured or a way to treat the batch of commands as a total transaction that gets rolled back upon failure?
Any suggestions would be appreciated!
1 Reply
- Kevin_Stewart
Employee
One option might be to create a transaction. From the guide:
"iControl REST supports batch mode transactions as a sequence of web service requests. The basic iControl REST methods to create, delete, commit, or query a resource also apply to transactions. However, instead of individual method requests, you combine multiple requests into a transaction, and perform the sequence of requests atomically. The transaction completes successfully if all of the commands in the transaction complete successfully. Otherwise, the transaction fails and the commands in the transaction are rolled back, or not committed."
https://devcentral.f5.com/d/icontrol-rest-user-guide-version-1150
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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