Forum Discussion
ERROR "The requested profile (/#create_new#) was not found" during rest call to create a vip via iapp
I want to create a vip through iapp via a Rest call.
POST CALL : https://192.168.41.117/mgmt/tm/sys/application/service/
Headers: Basic-authentication , Content-type (application/json)
Body
{ "name": "test2", "partition": "/Common/", "deviceGroup": "none", "inheritedDevicegroup": "true", "inheritedTrafficGroup": "true", "strictUpdates": "enabled", "template": "f5.http", "templateModified": "no", "trafficGroup": "traffic-group-1", "tables": [ { "name": "basic__snatpool_members" }, { "name": "net__snatpool_members" }, { "name": "optimizations__hosts" }, { "name": "pool__hosts", "columnNames": [ "name" ], "rows": [ { "row": [ "www.me.com" ] } ] }, { "name": "pool__members", "columnNames": [ "addr", "port", "connection_limit" ], "rows": [ { "row": [ "9.3.6.9", "80", "0" ] }, { "row": [ "9.6.3.9", "80", "0" ] } ] }, { "name": "server_pools__servers" } ], "variables": [ { "name": "client__http_compression", "encrypted": "no", "value": "\"/create_new\"" }, { "name": "client__use_wa", "encrypted": "no", "value": "yes" }, { "name": "monitor__monitor", "encrypted": "no", "value": "\"/create_new\"" }, { "name": "monitor__response", "encrypted": "no", "value": "\"Server Up\"" }, { "name": "monitor__uri", "encrypted": "no", "value": "/bigip.html" }, { "name": "net__client_mode", "encrypted": "no", "value": "wan" }, { "name": "net__server_mode", "encrypted": "no", "value": "lan" }, { "name": "pool__addr", "encrypted": "no", "value": "1.8.2.9" }, { "name": "pool__pool_to_use", "encrypted": "no", "value": "\"/create_new\"" }, { "name": "pool__port", "encrypted": "no", "value": "80" }, { "name": "ssl__mode", "encrypted": "no", "value": "no_ssl" }, { "name": "ssl_encryption_questions__advanced", "encrypted": "no", "value": "no" }, { "name": "ssl_encryption_questions__help", "encrypted": "no", "value": "hide" } ] }
RESPONSE:
{ "code": 400, "message": "Status code:400, uri: body: {\"errorResponse\":\"{\\"error\\":{\\"code\\":400,\\"message\\":\\"01020036:3: The requested profile (/create_new) was not found.\\"}}\",\"errorStack\":[]}", "originalRequestBody": "{\"errorResponse\":\"{\\"error\\":{\\"code\\":400,\\"message\\":\\"01020036:3: The requested profile (/create_new) was not found.\\"}}\",\"errorStack\":[]}", "restOperationId": 865640, "errorStack": [ "java.net.ProtocolException: Status code:400, uri: body: {\"errorResponse\":\"{\\"error\\":{\\"code\\":400,\\"message\\":\\"01020036:3: The requested profile (/create_new) was not found.\\"}}\",\"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" ] }
Not sure why it is searching for the profile /create_new it should ideally create new ?
Product: BIG-IP Version: 11.4.1 Build: 608.0 BaseBuild: 608.0
Please help.
4 Replies
- Fred_Slater_856Historic F5 Account
The published library of iApps were designed before the REST API, and were not originally intended for this type of use, but it can be done. You're example almost works. I'm not sure that the extra escaped quotes are necessary. The following POST works for me on version 12.0:
{ "name": "test2", "partition": "Common", "template": "f5.http", "tables": [ { "name": "basic__snatpool_members" }, { "name": "net__snatpool_members" }, { "name": "optimizations__hosts" }, { "name": "pool__hosts", "columnNames": [ "name" ], "rows": [ { "row": [ "www.me.com" ] } ] }, { "name": "pool__members", "columnNames": [ "addr", "port", "connection_limit" ], "rows": [ { "row": [ "9.3.6.9", "80", "0" ] }, { "row": [ "9.6.3.9", "80", "0" ] } ] }, { "name": "server_pools__servers" } ], "variables": [ { "name": "asm__use_asm", "encrypted": "no", "value": "/do_not_use" }, { "name": "client__http_compression", "encrypted": "no", "value": "/create_new" }, { "name": "client__use_wa", "encrypted": "no", "value": "yes" }, { "name": "monitor__monitor", "encrypted": "no", "value": "/create_new" }, { "name": "monitor__response", "encrypted": "no", "value": "Server Up" }, { "name": "monitor__uri", "encrypted": "no", "value": "/bigip.html" }, { "name": "net__client_mode", "encrypted": "no", "value": "wan" }, { "name": "net__server_mode", "encrypted": "no", "value": "lan" }, { "name": "pool__addr", "encrypted": "no", "value": "1.8.2.9" }, { "name": "pool__pool_to_use", "encrypted": "no", "value": "/create_new" }, { "name": "pool__port", "encrypted": "no", "value": "80" }, { "name": "ssl__mode", "encrypted": "no", "value": "no_ssl" }, { "name": "ssl_encryption_questions__advanced", "encrypted": "no", "value": "no" }, { "name": "ssl_encryption_questions__help", "encrypted": "no", "value": "hide" } ] }- anoop1
Nimbostratus
Thanks a lot for the help , extra escaped quotes was the problem i got it working , i can see the vip is created on the Device but i still see the the REST Response Status Code: 404 Not Found Cache-Control: no-cache Connection: Keep-Alive Content-Length: 1498 Content-Type: application/json; charset=UTF-8 Date: 15 Oct 2015 04:54:51 UTC Keep-Alive: timeout=4, max=99 Server: com.f5.rest.common.RestRequestSender Set-Cookie: BIGIPAuthCookie=00B046DBA0E566B064E84C00EDCC1F0FB7FF90EA; path=/; Secure; HttpOnly BIGIPAuthUsernameCookie=appviewx; path=/; Secure; HttpOnly X-Frame-Options: SAMEORIGIN "code": 404, "message": "Status code:404, uri:http://localhost:8110/tm/sys/application/service/, body: {\"errorResponse\":\"{\\\"error\\\":{\\\"code\\\":404,\\\"message\\\":\\\"The configuration was updated successfully but could not be retrieved. The error is \\\\\\\"01020036:3: The requested application (/Common/test2) was not found.\\\\\\\"\\\"}}\",\"errorStack\":[]}"
- Fred_Slater_856Historic F5 Account
That's a bug in the REST worker that was fixed in 12.0. It fails to find the application at /Common/test2, because iApps are created in a subfolder. Your test2 was created at /Common/test2.app/test2. However, as you noticed, the application does get successfully deployed. You can verify it with at GET to the selflink at /mgmt/tm/sys/application/service/~Common~test2.app~test2.
- ChrisMutzel_151
Altocumulus
How did you generate the request body here? Here are the steps I typically follow:
1. 1) create the iApp through the UI
2. query iApp in json via iControlREST
3. clean up json such that it can be reposted:
4. delete self references in the json payload
5. change all none/None values with ""
Repost with variables changed as necessary. This was worked with the small subset of F5 produced iApps I have managed with iCR
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