Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

REST API Query

iAzhar
Nimbostratus
Nimbostratus

I would like to get the status of the pool and web servers [online/offline] via rest API. I’ve gone through the API documentation but couldn’t figure out what should be my API call.

 

Can someone here please help?

1 ACCEPTED SOLUTION

AlexBCT
MVP
MVP

Hi,

 

Have you seen this one? https://devcentral.f5.com/s/question/0D51T00006i7Yj4/icontrol-rest-getting-pool-member-status

 

Basically, this should be your curl request (change the name of the pool/IP and add user/pass):

 

curl --request GET --url 'https://192.168.10.31/mgmt/tm/ltm/pool/~Common~wiki-pool/members/stats'

 

View solution in original post

5 REPLIES 5

AlexBCT
MVP
MVP

Hi,

 

Have you seen this one? https://devcentral.f5.com/s/question/0D51T00006i7Yj4/icontrol-rest-getting-pool-member-status

 

Basically, this should be your curl request (change the name of the pool/IP and add user/pass):

 

curl --request GET --url 'https://192.168.10.31/mgmt/tm/ltm/pool/~Common~wiki-pool/members/stats'

 

Thanks  , I am able to use this to get a response.

In the API response, I am assuming the key "monitorStatus" indicates whether the member is down or up, is this correct?

That's correct.

 

If you look a bit further down in the response, you can also find these entries;

 

         "sessionStatus": {

           "description": "user-disabled"

         },

         "status.availabilityState": {

           "description": "offline"

         },

         "status.enabledState": {

           "description": "disabled"

         },

         "status.statusReason": {

           "description": "Forced down"

 

This is showing you if the member is administratively down (Disabled / Forced Offline) - the example above is showing it with Forced Offline configured.

 

If you're happy with the answer. Would be great if you can flag the item as "Answered" so it can be closed and may benefit the rest of the community.

iAzhar
Nimbostratus
Nimbostratus

Also, how can I check if a virtual server is up/down via rest call?

Basically anything can be found via iControl, but can be a bit of a search at first. Anything to do with virtual servers, can be found under /mgmt/tm/ltm/virtual (the structure is very similar to TMSH commands). Have a look here for the full guide and setup required for any iControl requests;

 

https://clouddocs.f5.com/api/icontrol-rest/

 

Whenever I need to build any iControl commands, I use these pages to reference material.