Forum Discussion
Assign iRule to Virtual Server via iControl REST
Hi guys,
I am trying to create a Virtual Server using iControl REST API but I have problems specifying the iRule to be assigned to the server.
Here is the JSON content I am POST-ing:
{"name": "iControl_virtual", "rules": ["/Common/_sys_https_redirect"], "mask": "255.255.255.255", "nat64": "disabled", "destination": "192.168.1.30:80", "enabled": null, "sourceAddressTranslation": {"type": "automap"}, "source": "0.0.0.0/0", "profiles": [ {"kind": "ltm:virtual:profile", "name": "tcp"}, {"kind": "ltm:virtual:profile", "name": "http"} ], "mobileAppTunnel": "disabled", "mirror": "disabled", "ipProtocol": "tcp", "pool": "icontrol_pool", "description": "A Python REST client test virtual server"}
And the error returned by F5:
{"errorStack": ["java.net.ProtocolException: Status code:400, uri: body: {\"errorResponse\":\"{\\"error\\":{\\"code\\":400,\\"message\\":\\"\\\\"replace-all-with\\\\" unexpected argument\\"}}\",\"errorStack\":[]}"
I have the feeling I'm missing something here. Would appreciate any help.
F5 firmware: BIG-IP 11.4.1 Build 608.0 Final
Thanks, Radu
2 Replies
- What_Lies_Bene1
Cirrostratus
Perhaps you've missed something but shouldn't the URI be .../mgmt/tm/ltm/virtual/?
I'd imagine you need braces around the rule name:
[{"/Common/_sys_https_redirect"}]Alternatively, try adding a name parameter:
[{"name": "/Common/_sys_https_redirect"}] - Radu_Faragau_18
Nimbostratus
Thanks for your feedback,
I have tried your suggestions but the same error is returned. The same message is returned: "replace-all-with\\\\" unexpected argument\\"
Regards, Radu
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