kman,
This can already be done from the web UI and tmsh. From the web UI you can edit the assign rules and place them in any order you like, then update the virtual. tmsh offers the equivalent functionality of "replace with" from the web UI (see below).
test-ltm-01(Active)(/Common)(tmos) list /ltm virtual test-http-virtual-02.element.local
ltm virtual test-http-virtual-02.element.local {
destination 10.84.3.227:http
ip-protocol tcp
mask 255.255.255.255
pool test-ubuntu-lucid_http
profiles {
http { }
tcp { }
}
rules {
xml-to-http-header
}
snat automap
vlans-disabled
}
test-ltm-01(Active)(/Common)(tmos) modify /ltm virtual test-http-virtual-02.element.local rules { exp_backoff vip-target-vip sqrt math }
results in:
test-ltm-01(Active)(/Common)(tmos) list /ltm virtual test-http-virtual-02.element.local
ltm virtual test-http-virtual-02.element.local {
destination 10.84.3.227:http
ip-protocol tcp
mask 255.255.255.255
pool test-ubuntu-lucid_http
profiles {
http { }
tcp { }
}
rules {
exp_backoff
vip-target-vip
sqrt
math
}
snat automap
vlans-disabled
}
I agree that historically it would have been nice to have a method to do this, but it isn't necessary in version 11. This behavior can be implemented with iControl transactions, which were introduced in version 11. The idea is that you start a transaction, execute iControl calls as you normally would, then submit the transaction. Action will only be taken if all the commands will execute correctly. The transaction will cause the iControl commands to be executed in parallel and should not impact your users (unless of course they were dependent on the iRules that you remove). Here is an article I wrote on transactions when we launched version 11:
v11 iControl: Transactions. In the next post is a code sample written in Java provide the functionality you are requesting.
Best regards,
George