Forum Discussion
Mark_Stradling_
Cirrus
Oct 23, 2015Python + bigsuds: What format to create iRule
I am not able to find an example of this anywhere and I am having a lot of trouble creating an iRule with bigsuds + python. I cannot figure out how to deliver the data to the Rule.create method. I am...
Mark_Stradling_
Cirrus
Oct 23, 2015Gah.... Stupid thing won't let me fix formatting
!/usr/bin/env python
import sys
import bigsuds
import ssl
import getpass
'''SSL CERT FIX'''
'''------------'''
ssl._create_default_https_context = ssl._create_unverified_context
def get_rules_list(obj):
try:
return obj.LocalLB.Rule.get_list()
except Exception, e:
print e
def get_rule(obj, rule):
try:
return obj.LocalLB.Rule.query_rule([rule])
except Exception, e:
print e
def create_rule(obj):
try:
return obj.LocalLB.Rule.create(obj,rule, rule_txt)
except Exception, e:
print e
try:
b = bigsuds.BIGIP(
hostname = "192.168.1.2",
username = "admin",
password = "admin",
)
except Exception, e:
print e
try:
c = bigsuds.BIGIP(
hostname = "192.168.1.1",
username = "admin",
password = "admin",
)
except Exception, e:
print e
irules = get_rules_list(b)
print irules
for rule in irules:
rule_txt = get_rule(b, rule)
create_rule(c, rule, rule_txt)
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects
