Forum Discussion
What is the proper way to redfine an iRule through iControl?
// This is Groovy code; you may need to Java-ify it.
// Write the new definition of the iRule.
String newRule = "NEW_IRUL_DEF_HERE"
// Instantiate a new rule def, make sure to give it the same name as the one you want to modify.
LocalLBRuleRuleDefinition ruleDef = new LocalLBRuleRuleDefinition("NAME_OF_RULE", newRule)
LocalLBRuleRuleDefinition[] ruleDefs = new LocalLBRuleRuleDefinition[1]
ruleDefs[0] = ruleDef
// Tell F5 you wish to modify the iRule. It will look up the existing "Name of rule" and overwrite it with 'newRule'. f5Interface.getLocalLBRule().modify_rule(ruleDefs)
// I despise the iControl Java API and wish someone at F5 would provide a modern, non-mechanically generated, OO client access JAR for it.
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
