Forum Discussion
How do I enable and disable pool members using iControlREST
Hi
I'm trying to the following PUT request to enable a pool member (IP's masked out):
https://10.102.xx.xx/mgmt/tm/ltm/pool/~QA~pool_vcoza_portal_UAT/members/~QA~10.102.xx.xx:9001
My request has the following body and Content-Type: application/json
{ "state" : "up" }
I get the following result back:
{"code":400,"message":"invalid property value \"state\":\"up\"","errorStack":[]}
However, doing the same kind of thing for other properties, dynamicRatio for example, does work.
Please help!
- JRahmAdmin
curl -sk -u admin:admin https://192.168.6.5/mgmt/tm/ltm/pool/testpool/members/~Common~192.168.101.11:8000/ -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)
- JRahmAdmin
jrahm@ubuntu:/var/tmp$ curl -sk -u admin:admin https://192.168.6.5/mgmt/tm/ltm/pool/testpool/members/~Common~192.168.101.11:8000/ | jq . { "state": "user-down", "connectionLimit": 0, "address": "192.168.101.11", "selfLink": "https://localhost/mgmt/tm/ltm/pool/testpool/members/~Common~192.168.101.11:8000?ver=11.5.1", "generation": 63, "fullPath": "/Common/192.168.101.11:8000", "partition": "Common", "name": "192.168.101.11:8000", "kind": "tm:ltm:pool:members:membersstate", "dynamicRatio": 1, "inheritProfile": "enabled", "logging": "disabled", "monitor": "default", "priorityGroup": 0, "rateLimit": "disabled", "ratio": 1, "session": "user-disabled" }
- Kapil_Malhotra_Nimbostratus
I tried this but getting the following error. {"code":415,"message":"Found invalid content-type. The content-type must be application/json. The received content-type is application/x-www-form-urlencoded","errorStack":[]}
- JRahmAdmindon't forget this part of the query: -H "Content-Type: application/json"
- Kapil_Malhotra_NimbostratusHi Jason, -H "Content-Type: application/json was part of my query but still getting the error posted above curl -sk -u kapil:xxxxx https://xxxxxxxx/mgmt/tm/ltm/pool/test-default/members/~Common~10.xx.xx.xx:10001/ \ -H "Content.Type: application/json" -X PUT -d '{"state": "user-down", "session": "user-disabled"}'
- Romuald_197888NimbostratusHello, I've got the same error : {"code":400,"message":"Found invalid JSON body in the request.","errorStack":[]} With the following request : curl -sk -u admin:xxxxx -H "Content-Type: application/json" -X PUT -d '{"session": "user-enabled"}' https://xx.xx.xx.xx/mgmt/tm/ltm/pool/~PREPROD~POOL_COLLECTEAI/members/~PREPROD~host.domain.fr:80 Any idea ? Thanks
- Romuald_197888Nimbostratus
Hello,
Our consultant find the solution. The correct syntax is with PUT method:
curl -X PUT -d '{"session":"user-enabled"}' -u admin:xxxxxxxxx -H "Content-Type: application/json" -k
- JRahm_128324Historic F5 Accountgood deal. Just saw this, sorry I missed the original comment. Yes, a modification of an existing object requires the PUT method, POST is for object creation.
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