Forum Discussion

Dave_Noonan's avatar
Jan 23, 2020

Modify local traffic policy from CLI or API

I recently got enjoy the GUI for local traffic policy management and determined that it's an abomination. You can't duplicate a policy so it's click-click-click all the way through to add eight near identical policies. You can't rename so that one where I forgot to update the name, delete and rebuild. Oh, and there's no true default policy so if you have one that's supposed to be the default you need to manually drag it to the end of the list.

 

The request boiled down to, if the URI starts with /A send it to A-pool, /B send to B-pool, etc. This is really tedious in the GUI.

 

Is there a better way to do it?

 

Please tell me there are CLI examples that I didn't find yesterday or that there's an API call I could have made to do this.

 

Thanks

    • Dave_Noonan's avatar
      Dave_Noonan
      Icon for Cirrus rankCirrus

      Got to use this today. Much easier than the GUI. Thanks again.

    • Dave_Noonan's avatar
      Dave_Noonan
      Icon for Cirrus rankCirrus

      That sounds perfect. I found the list but didn't know how to get the modified config back into the F5. Was thinking maybe API could pass it in or something.

      • Dario_Garrido's avatar
        Dario_Garrido
        Icon for MVP rankMVP

        Hello Dave.

        BTW, if you want it's even possible to execute "merge" command through API REST.

        URL: https://bigiphostname/mgmt/tm/sys/config
        Method: POST
        Payload: {“command”:”load”, “options”:[{“file”: “/var/config/rest/downloads/uploaded_file_name”, “merge”:true}]}

        But if you are not familiar with iControl REST, I recommend you to use the TMSH command because it's easier.

        REF - https://devcentral.f5.com/s/articles/demystifying-icontrol-rest-merging-big-ip-config-files-19636

        If my reply suits you, please don't forget to mark the answer as "the best". Thanks.

        KR,

        Dario.

  • Forgot to add that in olden times (6 years ago) I'd have done this with an iRule and updating it would have taken 5-10 minutes instead of an hour of click-click-click.