Forum Discussion
iControl to assign iRule to VIP in partition other than Common
I have VIP on partition /DevOps. I’m trying to create a REST call to assign an iRule to an existing VIP that are not in /Common. When I use a call like the following, it gets an HTTP 404 not found because it defaults to thinking the VIP is in the /Common partition:
curl -k -X PUT -H Content-Type: application/json -H X-F5-Auth-Token: **** -d {"rules":["/Common/_sys_https_redirect"]} https://****.****.com/mgmt/tm/ltm/virtual/gary-dev.yrcw.com_vs
But, when I revise it as follows, it returns HTTP 400 “Found unexpected URI”:
curl -k -X PUT -H Content-Type: application/json -H X-F5-Auth-Token: **** -d {"rules":["/Common/_sys_https_redirect"]} https://****.****.com/mgmt/tm/ltm/virtual/DevOps/gary-dev.yrcw.com_vs
What is the proper way to direct it to my VIP in the /DevOps partition?
If I must use TMSH then please provide a working example and I’ll script it that way.
Thanks in advance for your assistance.
Hello Gary
Just try this instead
https://****.****.com/mgmt/tm/ltm/virtual/~DevOps~gary-dev.yrcw.com_vs
Hello Gary,
Use PATCH method instead of PUT.
Hello Gary
Just try this instead
https://****.****.com/mgmt/tm/ltm/virtual/~DevOps~gary-dev.yrcw.com_vs
- Gary_Lon_BrownAltostratus
Thanks. That works.
- Gary_Lon_BrownAltostratus
Now that I've got it coded that way:
curl -k -X PUT -H Content-Type: application/json -H X-F5-Auth-Token: **** -d {"rules":["/Common/_sys_https_redirect"]} https://****.****.com/mgmt/tm/ltm/virtual/~DevOps~gary-dev.yrcw.com-redir_vs
I get an HTTP 400 with:
The source (::) and destination (*.*.148.61) addresses for virtual server (/DevOps/gary-dev.yrcw.com-redir_vs) must be be the same type (IPv4 or IPv6).
So I guess the question is why does it think the source is blank when the HTTP and HTTPS VIP both have the same IP?
Hello Gary,
Use PATCH method instead of PUT.
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