Forum Discussion

Alli_Saidulu_29's avatar
Alli_Saidulu_29
Icon for Nimbostratus rankNimbostratus
Oct 05, 2016

REST API to take a pool member to offline/online in F5 ltm

I am trying to bring a pool member offline during maintenance and bring it back to online once maintenance is over. My device F5 LTM. Is there any REST API to do this (which can help me in taking a pool member to offline and bring it back online using REST API)?.

 

2 Replies

  • Using curl, you could do it like that:

    DISABLE pool member:
    curl -sk -u admin:password https://1.2.3.4:443/mgmt/tm/ltm/pool/~Common~testweb_pool/members/~Common~host1:80 -H 'Content-Type: application/json' -X PUT -d "{\"session\":\"user-disabled\"}"
    ENABLE pool member:
    curl -sk -u admin:password https://1.2.3.4:443/mgmt/tm/ltm/pool/~Common~testweb_pool/members/~Common~host1:80 -H 'Content-Type: application/json' -X PUT -d "{\"session\":\"user-enabled\"}"
    

    You can adopt this using any language / REST client you like.

    HTH

    Martin

  • curl -sk -u ankara:ankara https://192.168.66.66/mgmt/tm/ltm/pool/testpool/members/~Common~66.66.66.66:66/ -H "Content-Type: application/json" -X PUT -d '{"state": "user-down", "session": "user-disabled"}'

     

    {"state": "user-down", "session": "user-disabled"} (Member Forced Offline in GUI) {"state": "unchecked", "session": "user-disabled"} (Member Disabled in GUI) {"state": "unchecked", "session": "user-enabled"} (Member Enabled in GUI) 1