Forum Discussion
Brent_West_7733
Mar 03, 2013Historic F5 Account
Posted By stucky101 on 03/02/2013 09:12 PM
To add...can you explain why I need a list that has another list as a single member, this list in turn has one dictionary as a single member.
Sorry I don't get the purpose of the double list context here.
Why is this not enough :
lb.LocalLB.VirtualServer.add_rule(['/Common/test'], [{'rule_name':'/Common/api_maintenance', 'priority': 1}])
thx
This has to do with the API works.
The API is designed so that you can have MANY virtuals and add MANY rules in one API call. Even if you are only modifying 1 virtual, and modifying 1 rule at a time, the API expects an array (same as a python list) of virtuals that you want to access and an array(list) of rules you want to add.
If you are creating some hefty tools this approach is much more efficient, but I'll agree that it can be a lot of data structures to keep track of, especially if your goal is a fairly simple 1 to 1 call.