Forum Discussion

aar_ucl_299416's avatar
aar_ucl_299416
Icon for Nimbostratus rankNimbostratus
Apr 04, 2017

Traffic-Group Failover with IControl REST API

I am trying to use iControl REST api to failover my F5 LAB devices. This is a very small part of a bigger project.

 

Version: 12.1.0 Appliance/License: F5 Lab/Ve

 

Problem description:

 

  • Following the guide at:

'https://devcentral.f5.com/wiki/iControlREST.APIRef_tm_sys_failover.ashx'

 

  • I send a POST (use either CURL or Python Requests API), with the following JSON payload:

'{"command":"run","standby":true,"trafficGroup":"traffic-group-1"}'

 

against the following URL:

 

''

 

  • A 200 HTTP response is returned with below JSON payload in the HTTP response body. Typically this would indicate the Request was successful but the F5 is not failing over to Standby and no signs of failover being triggered in /var/log/ltm. At this point I should state, failover works from TMSH and GUI:

'{"kind":"tm:sys:failover:runstate","command":"run","standby":true,"trafficGroup":"traffic-group-1"}'

 

So, It seems the REST api accepts my request but does not do anything with it??

 

My Questions:

 

  1. How can I switch '/var/log/restjavadaudit.0.log' into debug so as I can understand why my request is not being processed correctly? (I did not see the DB keys for that, does such a key exist?)

     

  2. In the API reference (linked above) it seems to imply the I should be using ~resource id at the end of the URI /mgmt/tm/sys/failover/. I cannot think what resource should be specified since the default traffic-group is in Common and I specify the traffic-group in the JSON payload. Am I missing something obvious?

     

Thanks in Advance for your answers.

 

1 Reply

  • I am experiencing the same behaviour with 12.1.2. When trying to issue a failover for a traffic-group using the same method as you tried above, I also see nothing happen. The same script is working with devices running 11.6.0. One hint though: when triggering this through iCR, I see the request in /var/log/restjavad-audit.0.log (and also the 200 response), and I also an according "go standby" command for the affected traffic-group being logged in /var/log/ltm:

    Apr  4 13:10:17 slot1/lb-LBTEST-rz3 notice sod[6579]: 010c0044:5: Command:  go standby /Common/TG997-Test1 tmsh.

    So, obviously, the REST call is OK and is even triggering something on the box, but the "go standby" command is not processed properly. I suppose this to be a bug.

    Maybe we should file a support case for that...

    HTH Martin