Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

iControl to assign iRule to VIP in partition other than Common

garylonbrown
Nimbostratus
Nimbostratus

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.

2 ACCEPTED SOLUTIONS

Hello Gary

Just try this instead

https://****.****.com/mgmt/tm/ltm/virtual/~DevOps~gary-dev.yrcw.com_vs

 

Regards,
Dario.

View solution in original post

Hello Gary,

Use PATCH method instead of PUT.

 

Regards,
Dario.

View solution in original post

5 REPLIES 5

Hello Gary

Just try this instead

https://****.****.com/mgmt/tm/ltm/virtual/~DevOps~gary-dev.yrcw.com_vs

 

Regards,
Dario.

Thanks. That works.

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.

 

Regards,
Dario.

Okay, got it. Now it's working. Thanks much.