Forum Discussion
Python SDK Assign iRules to a virtual server
Hi Jason, Thanks very much! This worked for me. I assume that it is not possible to define the rules list as a parameter in the bigip.ltm.virtuals.virtual.create method.
Best Regards, Kurt
- JRahmJan 23, 2017
Admin
sure, you can do that as well:
x = b.tm.ltm.virtuals.virtual.create( name='testvip5', partition='Common', rules=['/Common/tcptest'], profiles=['/Common/http']) - IRONMAN_183357Nov 03, 2017
Nimbostratus
Hi Jason,
I am getting below error
Traceback (most recent call last): File "C:\Users\krissara\Desktop\F5 SDK\Stage5\VIP add.py", line 6, in x = b.tm.ltm.virtuals.virtual.create( NameError: name 'b' is not defined
- JRahmNov 03, 2017
Admin
did you instantiate your BIG-IP to b or a different variable first?
from f5.bigip import ManagementRoot b = ManagementRoot('x.x.x.x', 'admin', 'admin') x = b.tm.ltm.virtuals.virtual.create( name='testvip5', partition='Common', rules=['/Common/tcptest'], profiles=['/Common/http']) - IRONMAN_183357Nov 03, 2017
Nimbostratus
Thanks Very much
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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