REST aXAPI service group member
skms
Member ✭
Hello,
I am trying to enable/disable a service group member using the aXAPI REST interface. I have managed to get the connected and read the state using REST/JSON.
I can read the state using REST/JSON witht he method
/services/rest/V2/?session_id=XXXXXXXXXXXXXXXX&method=slb.service_group.search&name=YYYYYYYYYYYYY&format=json
But when I try to change the status to 0 (disabled) the status does not change, even though I get 200 response code with OK . I use the following command
/services/rest/V2/?session_id=XXXXXXXXXXXXXXXXX&method=slb.service_group.member.update&format=json
When I read the service group information again the status value has not changed. This seems simple enough, but why is the status not changing for the service group member?
Is there another way to do this? To enable/disable a service group memeber?
Stefanos
I am trying to enable/disable a service group member using the aXAPI REST interface. I have managed to get the connected and read the state using REST/JSON.
I can read the state using REST/JSON witht he method
/services/rest/V2/?session_id=XXXXXXXXXXXXXXXX&method=slb.service_group.search&name=YYYYYYYYYYYYY&format=json
But when I try to change the status to 0 (disabled) the status does not change, even though I get 200 response code with OK . I use the following command
/services/rest/V2/?session_id=XXXXXXXXXXXXXXXXX&method=slb.service_group.member.update&format=json
When I read the service group information again the status value has not changed. This seems simple enough, but why is the status not changing for the service group member?
Is there another way to do this? To enable/disable a service group memeber?
Stefanos
0
Comments
I did something below from my linux box to ACOS device (version 2.7.1-p3), and works well.
#Authentication - slicing out only the session ID#
curl -s -k "https://XXXXXXXXXXXX/services/rest/V2/?format=json&method=authenticate" -X POST -d '{ "username": "XXXXX", "password": "XXX" } ' | awk -F\: '{ print $2 }' | sed 's/\"//g' | sed 's/\}//g' | tr -d '\\n'
#updating service group
curl -s -k "https://XXXXXXXXXXXX/services/rest/V2/?session_id=ZZZZsessionIDZZZZ&format=json&method=slb.service_group.member.update" -X POST -d '{ "name": "http", "member": { "server":"vm107", "port":"80", "status":"0" } }'
and found my server "vm107" with port "80" in service-group "http" had changed to disabled.
Since you are receiving "OK" as a response, command syntax should be ok, but you may want to check the parameters sent with POST method. (whether it was sent to correct member, etc.)
Hope this helps.