Forum Discussion
Add to LTM Policies with iControl REST
Currently we have a LTM policy that handles our path-based routing for one of our virtual servers. We modify it with a tmsh command, but we're looking to move it over to an iControl REST call. I'm pretty familiar with the REST interface but for the life of me I can't seem to get the request correct. Here is the command we are trying to replicate:
tmsh modify ltm policy policy_https_pool_selector rules add { foo { actions replace-all-with { 0 { forward select pool pool_foo } 1 { server-ssl disable } } conditions replace-all-with { 0 { http-uri path starts-with values { /foo} } } } }
I know it needs to be a PUT call to the policy itself to add this rule, but again I can't seem to get the format correct. Any help here would be greatly appreciated.
1 Reply
- Arnaud_Lemaire
Employee
Hi, you need to POST your new rule to /mgmt/tm/ltm/policy/policy_https_pool_selector/rules
your need to increment the rule ordinal parameter.
here is a payload example which complement a policy created with your command line :
{ "name" : "foo2", "ordinal" : 1, "actionsReference" : { "items" : [{ "name" : "0", "code" : 0, "forward" : true, "pool" : "/Common/pool_foo", "port" : 0, "request" : true, "select" : true, "status" : 0, "vlanId" : 0 }, { "name" : "1", "generation" : 4532, "code" : 0, "disable" : true, "port" : 0, "request" : true, "serverSsl" : true, "status" : 0, "vlanId" : 0 } ] }, "conditionsReference" : { "items" : [{ "name" : "0", "caseInsensitive" : true, "external" : true, "httpUri" : true, "index" : 0, "path" : true, "present" : true, "remote" : true, "request" : true, "startsWith" : true, "values" : ["/foo"] } ] } }
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