Forum Discussion
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?
1 Reply
- JRahm
Admin
Just supply the name attribute with the post, not the fullpath. Here's my advanced rest client URL and payload:
https://ltm3.test.local/mgmt/tm/gtm/pool/a/gslb_pool_1/members POST {"name":"/Common/ltm3.test.local:/Common/testvip"}With results:
{ "kind": "tm:gtm:pool:a:members:membersstate" "name": "testvip" "partition": "Common" "subPath": "ltm3.test.local:/Common" "fullPath": "/Common/ltm3.test.local:/Common/testvip" "generation": 1314 "selfLink": "https://localhost/mgmt/tm/gtm/pool/a/gslb_pool_1/members/~Common~ltm3.test.local:~Common~testvip?ver=12.1.0" "enabled": true "limitMaxBps": 0 "limitMaxBpsStatus": "disabled" "limitMaxConnections": 0 "limitMaxConnectionsStatus": "disabled" "limitMaxPps": 0 "limitMaxPpsStatus": "disabled" "memberOrder": 0 "monitor": "default" "ratio": 1 }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com