Forum Discussion
Adding a iRule to a Virtual Server
Hi again,
thanks to Matt's hint I figured it out - it's a serialization issue:
Your convert_rule() should look like this:
ruleSequence = bigip.LocalLB.VirtualServer.typefactory.create('LocalLB.VirtualServer.VirtualServerRuleSequence')
ruleSet = bigip.LocalLB.VirtualServer.typefactory.create('LocalLB.VirtualServer.VirtualServerRule')
ruleSet.rule_name = ruleName
ruleSet.priority = priority
ruleSequence.item = [ruleSet]
return [ruleSequence]
And then execute it like:
bigip.LocalLB.VirtualServer.add_rule(virtual_servers = ['/Common/VS'], rules = [convert_rule(bigip, '/Common/test', '')])
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