Forum Discussion
dotsonpaper_280
Nimbostratus
Oct 14, 2017How To Delete An irule using Rest API with CURL
Hello,
I am a bit stumped. I know I can add an irule using the rest api running the following command:
curl -sku ':' -H "Content-Type: application/json" -X PATCH https://bigip1/mgmt/tm/ltm/virtua...
Hygor
Nimbostratus
Oct 17, 2017Ok, you want to remove the irule from the virtual server. Here is how you can do that:
import requests
from f5.bigip import ManagementRoot
requests.packages.urllib3.disable_warnings()
connect to your F5
b = ManagementRoot('your_f5_mgmt_ip', 'user', 'pass')
load the virtual server
vip = b.tm.ltm.virtuals.virtual.load(name='vs_name')
list irules in vs
vip.rules
[u'/Common/irule1', u'/Common/irule2']
In this case we'll remove the irule2. The irule1 will remain in the virtual server
vip.rules = ['/Common/irule1']
update the configuration
vip.update()
Hope that it helps you. Regards,
Hygor
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
