Forum Discussion
Joel_Newton
Jun 03, 2015Cirrus
Examples of JSON for adding an iRule for a virtual server via the REST API
I'm looking for examples of how to do this. I came across the post below, but it wasn't clear that it actually worked.
https://devcentral.f5.com/questions/assign-irule-to-virtual-server-via-ico...
nathe
Jun 03, 2015Cirrocumulus
Joel,
I'm no expert on this but i know you need tmos v11.5 to add irules to virtual servers and in my lab POST doesn't work, only PUT and PATCH. Although it always does a replace so I can see you've got the redirect irule on the VS already so you'll need to re-add this to your code.
For example, in curl i can do this:
curl -sk -u user:pass -H "Content-Type: application/json" https://localhost/mgmt/tm/ltm/virtual/vs_lab -X PUT -d '{"rules":["/Common/test", "/Common/_sys_https_redirect"] }'
See if that works for you.
Hope this helps,
N
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