Forum Discussion

ha1's avatar
ha1
Icon for Nimbostratus rankNimbostratus
Feb 25, 2020

which REST API is available for invoking using curl "force offline of node members" and checking the "current connections" for the node member.

I need a REST API available for invoking using curl "force offline of node members" and checking the "current connections" for the node member. 

  • I assume you want to perform 'tmsh show ltm pool <pool> members' equivalent. The iControl REST endpoint is /mgmt/tm/ltm/pool/<pool>/members/stats: e.g.,

     

    curl -sku <user>:<pass> https://<host>/mgmt/tm/ltm/pool/<pool>/members/stats

     

    Generally speaking, to run the "show" tmsh command equivalent, append 'stats' to the end of the base endpoint. For example, for /mgmt/tm/ltm/virtual (list ltm virtual), /mgmt/tm/ltm/virtual/stats (show ltm virtual).

     

    You can find the references to iControl REST APIs in iControlREST Home. Toward the bottom, you will find PDF documents. Pick the one for your version. On the left hand side, you will find the details of each endpoints. For example, APIRef_tm_ltm shows the endpoints under /mgmt/tm/ltm. The document is not user-friendly, but once you understand a way to play with iControl REST, you should be able to find the information you are after.

     

  • ha1's avatar
    ha1
    Icon for Nimbostratus rankNimbostratus

    Hi    Thanks for the response, I think i might have wrongly mentioned that i would need the current connections for node but after talking to my team they want me to get the "current connections" for a "pool member".

     

    And also i would appreciate , if you can provide me the URL or documentation that provide me the REST API calls that i can make to the F5 LTM.

     

    Thanks,

     

  • The above is correct but just one minor amendment.

    ha is asking for the node current conns so use 'ss-server-addr' instead of 'cs-client-addr'.

     

    Kind regards

    Ben

  • If you are after calls equivalent to 'tmsh modify ltm <node> state user-down' and 'tmsh show sys connection", they are:

     

    curl -sku <user>:<pass> https://<host>/mgmt/tm/ltm/node/<node> -X PATCH -H 'Content-type: application/json' -d '{"state":"user-down"}'

    curl -sku <user>:<pass> https://<host>/mgmt/tm/sys/connection

     

    Note that '/mgmt/tm/sys/connection" may return a large data, which may clog the management port. You may need to filter. For example, to filter by a client-side client address ('tmsh show sys connection cs-client-addr <addr>'),

     

    curl -sku <user>:<pass> https://<host>/mgmt/tm/sys/connection?options=cs-client-addr,<addr>