Forum Discussion

Cay_Jeglinski_1's avatar
Cay_Jeglinski_1
Icon for Nimbostratus rankNimbostratus
Mar 22, 2016

iControlREST and POST method to enable or disable members

Hi All,

 

I followed Jason Rahms articles on iControlREST. With GET method I always get a useful result - so far so good.

 

I work with POST method as well. Is there a limitation of some kind with POST method to use to change parameters of objects?

 

The POST works fine to add a pool .../mgmt/tm/ltm/pool/ and also to change the monitor to http with a JSON like { "name" : "/mypartition/mypool", "monitor" : "http" }

 

This took me to the next step to enable or disable members in a pool. Easy query with .../mgmt/tm/ltm/pool/~mypartition~mypool/members. But when I issue a POST with that uri and a JSON like { "name" = "myMember", "session" : "user-disabled" } I always receive a 400 code. Have you any ideas how to approach or fix this?

 

Cay

 

    • Cay_Jeglinski_1's avatar
      Cay_Jeglinski_1
      Icon for Nimbostratus rankNimbostratus
      Hi Steve! Thank you for your post! It was just the way to go! Cheers! Here the solution in case somebody uses partitions as well. Enable the member with: curl -sk -u admin:admin https://waymuc01.waysoft.de/mgmt/tm/ltm/pool/~webfarm-WAY~way-pool3/members/~webfarm-WAY~srvweb16.waysoft.de:80/ -H "Content-Type: application/json" -X PUT -d '{"state": "user-up", "session": "user-enabled"}' To disable the member I used: curl -sk -u admin:admin https://waymuc01.waysoft.de/mgmt/tm/ltm/pool/~webfarm-WAY~way-pool3/members/~webfarm-WAY~srvweb16.waysoft.de:80/ -H "Content-Type: application/json" -X PUT -d '{"state": "user-up", "session": "user-disabled"}' Cheers again Steve! Cay