cancel
Showing results for 
Search instead for 
Did you mean: 
Login & Join the DevCentral Connects Group to watch the Recorded LiveStream (May 12) on Basic iControl Security - show notes included.

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

ha1
Nimbostratus
Nimbostratus

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

4 REPLIES 4

Satoshi_Toyosa1
F5 Employee
F5 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>

 

 

Grumpy_Cat
Cirrus
Cirrus

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

ha1
Nimbostratus
Nimbostratus

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,

 

Satoshi_Toyosa1
F5 Employee
F5 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.