sriramgd_111845
May 24, 2010Nimbostratus
query irule priority numbers used in a virtual server
I am instrumenting our irules so that they can be tested, loading them onto a virtual server (which is created explicitly for unit testing) in order to run some traffic against them as part of the test suite.
The problem is that to create a test irule, I need to set an arbitrary priority number - otherwise I get an error .
01070621:3: Rule priorities for virtual server (xyz) must be unique."
i.e. if I create a test iRule, I need to make sure I am not re-using a priority number. Is there is way to query all the used priority numbers, so that I can just generate a new one?
If I do something like
(Get-F5.iControl).LocalLBRule.query_rule((Get-F5.iControl).LocalLBRule.get_list()[0])
I can get the name and definition of the iRule, but I cannot get the priority.
I could do other things like maintain the priority numbers used in the test run state or catch the error and generate a new number till it succeeds etc., but I was wondering if there is a cleaner way.
Thanks,
Sriram