Forum Discussion
iControl Rest rewrite profile
I am trying to convert the following tmsh command to iControl Rest.
tmsh modify ltm profile rewrite test uri-rules add { test_rule {client { host test.com path /test/ scheme http } server { host 10.2.2.2 path / scheme http}}}
Here is my attempt to do so and the result.
$ curl -k -u icontrol -X POST -H "Content-type: application/json" -d ‘{"client":{"host":"test.com","path":"/test/","scheme":"http"},"server":{"host":"10.2.2.2","path":"/","scheme":"http"},"type":"both"}’
Enter host password for user 'icontrol':
curl: (6) Could not resolve host: ‘client:path
curl: (3) Illegal port number
curl: (6) Could not resolve host: ‘server:host
curl: (6) Could not resolve host: ‘server:path
curl: (3) Illegal port number
curl: (3) Illegal port number
{"code":400,"message":"Found invalid JSON body in the request.","errorStack":[],"apiError":1}
Any help would be much appreciated!
- geeko_85254
Altostratus
Sorry - pasted the wrong url. Should be
- cjunior
Nacreous
Hello, I think you forgot the rule name on the request, try this way:
curl -k -u icontrol -X POST -H "Content-type: application/json" -d ‘{"client":{"host":"test.com","path":"/test/","scheme":"http"},"server":{"host":"10.2.2.2","path":"/","scheme":"http"},"type":"both"}’ https://bigip/mgmt/tm/ltm/profile/rewrite/test/uri-rules/test_rule
Regards.
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