Forum Discussion

Simon_Sparks_12's avatar
Simon_Sparks_12
Icon for Nimbostratus rankNimbostratus
Aug 14, 2013

iControl HTTP REST API for F5 BIG-IP LTM VE v11.4

I have managed to create the following objects a Node, a Monitor, a Pool, Pool Members, a Virtual Address and a Virtual Server and an iRule via the iControl HTTP REST API.

 

I am having an issue when trying to apply the iRule to the Virtual Server, I am posting the following JSON to the following URL and getting the following error:

 

JSON:

 

{ "kind": "tm:ltm:rule:rulestate", "name": "irule-name", "generation": 0, "lastUpdatedMicros": 0, "selfLink": "https://big-ip-ltm-ve-fqdn/mgmt/tm/ltm/rule/irule-name", "apiAnonymous": "when HTTP_REQUEST\n{\n\tif { [HTTP::uri] contains \"/test/\" }\n\t{\n\t\tHTTP::redirect \"http://www.test.com/\"\n\t}\n}" }

 

URL:

 

https://big-ip-ltm-ve-fqdn/mgmt/tm/ltm/virtual/virtual-server-name/rules

 

ERROR:

 

{ "code": 400, "message": "Status code:400, uri:http://big-ip-ltm-ve-fqdn:8110/tm/ltm/virtual/virtual-server-name/rules, body: {\"errorResponse\":\"{\"error\":{\"code\":400,\"message\":\"Found unexpected data at property /ltm/virtual/virtual-server-name/rules. The data is {\\"irule-name\\":null}.\"}}\",\"errorStack\":[]}", "originalRequestBody": "{\"errorResponse\":\"{\"error\":{\"code\":400,\"message\":\"Found unexpected data at property /ltm/virtual/virtual-server-name/rules. The data is {\\"irule-name\\":null}.\"}}\",\"errorStack\":[]}", "restOperationId": 1821832, "errorStack": [ "java.net.ProtocolException: Status code:400, uri:http://big-ip-ltm-ve-fqdn:8110/tm/ltm/virtual/virtual-server-name/rules, body: {\"errorResponse\":\"{\"error\":{\"code\":400,\"message\":\"Found unexpected data at property /ltm/virtual/virtual-server-name/rules. The data is {\\"irule-name\\":null}.\"}}\",\"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" ] }

 

Please can someone from F5 assist me in making this work, as I have managed to automate and orchestrate all the other actions that I need to perform against the iControl HTTP REST API except this 1.

 

1 Reply