Forum Discussion

Radu_Faragau_18's avatar
Radu_Faragau_18
Icon for Nimbostratus rankNimbostratus
Feb 27, 2015
Solved

Assign iRule to Virtual Server with iControl REST

Hi all,

 

I've been trying to assign an iRule to a Virtual Server using the iControl REST but failed. I get the following error: Status code:403, "Operation is not supported on configuration item /ltm/virtual." .

 

Below is the JSON information I'm trying to PUT (tried with PUSH as well).

 

{ "name":"iControl_virtual", "rules":"[ {'name':'/Common/_sys_https_redirect'} ]" }

 

Is this a known issue? I'm testing on 11.4 version.

 

Thanks, Radu

 

3 Replies

  • John_Alam_45640's avatar
    John_Alam_45640
    Historic F5 Account

    This works for me on 11.6

    curl -sk -u admin:admin -H "Content-Type: application/json" https://localhost/mgmt/tm/ltm/virtual/fasthttp_tst -X PUT -d '{"rules":["/Common/_sys_https_redirect"]}'
    

    Note how the iRule is specified:

    "rules":["/Common/_sys_https_redirect"]

    This will display the virtual configuration so you can test and see how parameters are specified.

    curl -sk -u admin:admin -H "Content-Type: application/json" https://localhost/mgmt/tm/ltm/virtual/fasthttp_tst | sed 's/,/\'$'\n/g'