iControl REST: Working with Pool Members
Since iControl REST is the new kid on the block, it's bound to start getting some of the same questions we've addressed with traditional iControl. One of these oft-asked and misunderstood questions i...
Published Jun 10, 2014
Version 1.0JRahm
Admin
Joined January 20, 2005
JRahm
Admin
Joined January 20, 2005
Amit_K_Sharma_1
Aug 10, 2014Nimbostratus
Hi Jason,
While i have been able to use REST API Calls to get, modify, delete the Pool Members and create new ones in a Virtual Server. However, i have not been able to find out how to add one member to an existing pool which already has, say, 2 members. I have gone through the documentation and it mentions that POST has to be used, but it gives me error. PATCH and PUT overwrite the existing Pool members.
Ex. -
curl -k -u user:pass -H "Content-Type: application/json" -X POST -d '{"name":"myPoolName","members":[{"name":"MEMBERIP:PORT","description":"Server3"}]}' https://MANAGEMENTIP/mgmt/tm/ltm/pool/myPoolName
gives an error -
{"code":400,"message":"Found unexpected json pair at configuration item /ltm/pool/myPoolName. The json pair is \"myPoolName\":null.","errorStack":[]}
While the following with PUT works fine but overwrites -
curl -k -u user:pass -H "Content-Type: application/json" -X PUT -d '{"name":"myPoolName","members":[{"name":"MEMBERIP:PORT","description":"Server3"}]}' https://MANAGEMENTIP/mgmt/tm/ltm/pool/myPoolName
Appreciate some guidance here. Thanks.