Forum Discussion
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.
- Satoshi_Toyosa1Ret. Employee
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.
- ha1Nimbostratus
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,
- Grumpy_CatCirrus
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
- Satoshi_Toyosa1Ret. Employee
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>
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com