Forum Discussion
Feb 19, 2015
Hi Damian,
maybe using REST is an option?
To retrieve a list of virtual server direct links you can use the following request:
curl -s -k -u admin:admin -H "Content-Type: application/json" -X GET https://localhost/mgmt/tm/ltm/virtual?\$select=selfLink | grep -ioE '"selfLink":"[^"]+"'
It will return the links to access the virtual servers.
To enable / disable a specific virtual servers you can do the following:
curl -s -k -u admin:admin -H "Content-Type: application/json" -X PUT -d '{"enabled":true}' https://localhost/mgmt/tm/ltm/virtual/~Common~vs_101_8081
curl -s -k -u admin:admin -H "Content-Type: application/json" -X PUT -d '{"disabled":true}' https://localhost/mgmt/tm/ltm/virtual/~Common~vs_101_8081
Thanks, Stephan