iControlREST - adding members to a pool
Hi folks, I've come across an odd issue when trying to update an existing pool with new members.
First create a pool in your favourite way. I've used curl here but happens other ways too.
Do a GET on the pool members to ensure emptiness:
curl -k -u user:password -X GET -H "Content-Type: application/json" https://your.big-ip.net/mgmt/tm/gtm/pool/test-pool/members
Do a POST to the pool members to add a member(assuming you have already created the server/virtualserver):
curl -k -u user:password -X POST -d ‘{ "name": "test-server:test-virtualserver", "fullPath": "/Common/test-server:test-virtualserver" }’ -H "Content-Type: application/json" https://your.big-ip.net/mgmt/tm/gtm/pool/test-pool/members
I am receiving the response:
{
"code": 404,
"message": "Object not found - test-server:test-virtualserver",
"errorStack": []
}
When I do a GET on the members I expect emptiness, no?
curl -k -u user:password -X GET -H "Content-Type: application/json" https://your.big-ip.net/mgmt/tm/gtm/pool/test-pool/members
Actual Response is that the member got added:
{ "kind": "tm:gtm:pool:members:memberscollectionstate",
"selfLink": "https://localhost/mgmt/tm/gtm/pool/test-pool/members?ver=11.5.3",
"items": [ {
"kind": "tm:gtm:pool:members:membersstate",
"name": "test-server:test-virtualserver",
"partition": "Common",
"fullPath": "/Common/test-server:test-virtualserver",
"generation": 212,
"selfLink": "https://localhost/mgmt/tm/gtm/pool/test-pool/members/~Common~test-server:test-virtualserver?ver=11.5.3",
"enabled": true,
"limitMaxBps": 0,
"limitMaxBpsStatus": "disabled",
"limitMaxConnections": 0,
"limitMaxConnectionsStatus": "disabled",
"limitMaxPps": 0,
"limitMaxPpsStatus": "disabled",
"monitor": "default",
"order": 0,
"ratio": 1
}
]}
Am I doing something wrong here? How do I avoid the HTTP 404 on the POST?