Forum Discussion
iControl to disable a virtual server
Actually I've made some progress... I didn't have the icrd running on my LTM. I can now run the first example you gave to describe my VS.
It's still failing with the below though:
curl -s -k -u admin:ourpassword -H "Content-Type: application/json" -X PUT -d '{"enabled":true}' https://10.241.100.11/mgmt/tm/ltm/virtual/~Common~Bens_Test_VIP
{"code":400,"message":"Status code:400, uri:http://localhost:8110/tm/ltm/virtual/~Common~Bens_Test_VIP, body: {\"errorResponse\":\"{\\\"error\\\":{\\\"code\\\":400,\\\"message\\\":\\\"Found unexpected data at property /ltm/virtual/~Common~Bens_Test_VIP/enabled. The data is true.\\\"}}\",\"errorStack\":[]}","originalRequestBody":"{\"errorResponse\":\"{\\\"error\\\":{\\\"code\\\":400,\\\"message\\\":\\\"Found unexpected data at property /ltm/virtual/~Common~Bens_Test_VIP/enabled. The data is true.\\\"}}\",\"errorStack\":[]}","restOperationId":2290260,"errorStack":["java.net.ProtocolException: Status code:400, uri:http://localhost:8110/tm/ltm/virtual/~Common~Bens_Test_VIP, body: {\"errorResponse\":\"{\\\"error\\\":{\\\"code\\\":400,\\\"message\\\":\\\"Found unexpected data at property /ltm/virtual/~Common~Bens_Test_VIP/enabled. The data is true.\\\"}}\",\"errorStack\":[]}","at com.f5.rest.common.RestRequestSender.finish(RestRequestSender.java:412)","at com.f5.rest.common.RestRequestSender.processNext(RestRequestSender.java:397)","at com.f5.rest.common.RestHelper$2.run(RestHelper.java:1478)","at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)","at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)","at java.lang.Thread.run(Unknown Source)\n"]}
- StephanMantheyFeb 19, 2015
Nacreous
The syntax looks good. I tested in v11.5.1HF7. Will downgrade. Perhaps the attributes were renamed. To pull full list of attributes please just run: curl -s -k -u admin:admin -H "Content-Type: application/json" -X GET https://localhost/mgmt/tm/ltm/virtual? | sed -r 's/,(\{?")/,\n\1/g' - StephanMantheyFeb 19, 2015
Nacreous
Yepp, it was due to syntax change. This one works in v11.4.1: curl -s -k -u admin:admin -H "Content-Type: application/json" -X PUT -d '{"disabled":null}' https://localhost/mgmt/tm/ltm/virtual/vs_apitest curl -s -k -u admin:admin -H "Content-Type: application/json" -X PUT -d '{"enabled":null}' https://localhost/mgmt/tm/ltm/virtual/vs_apitest - damian_19221Feb 19, 2015
Nimbostratus
AWESOME! That works,thanks a lot Stephan!! - StephanMantheyFeb 19, 2015
Nacreous
Thanks for the feedback! :)
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