Closed MSlawik closed 1 month ago
Please submit an SR with F5 support and provide the number
Case # is 00704327.
Hi Marcus, I believe you're using wrong double quote characters in: -H “Content-Type: application/json”
Can you try with this: -H "Content-Type: application/json"
Great catch Adam. That was the problem.
Environment
Summary
Sending declaration through Postman is working, but throws an error using cURL.
Steps To Reproduce
Steps to reproduce the behavior:
Using Postman this is working on a blank configuration:
When putting the body into a file and issuing this cURL, its working fine as well: curl -sku admin:password -H “Content-Type: application/json” -X POST -d @initapp https://192.168.0.219/mgmt/shared/appsvcs/declare
When adding a second app to the same tenant using Postman I end up with two apps in the "test" tenant - as expected. POST https://{{cbip}}/mgmt/shared/appsvcs/declare/test/applications/ { "schemaVersion": "3.0.0", "id": "generated-for-testing", "application-b": { "class": "Application", "my-virtual-b": { "class": "Service_HTTP", "virtualAddresses": [ "10.1.2.2" ], "virtualPort": 80, "pool": "my-pool-b" }, "my-pool-b": { "class": "Pool", "members": [ { "servicePort": 80, "serverAddresses": [ "10.1.0.1", "10.1.0.2" ] } ] } } }
But if I'm using a cURL command to add the second app I'm having issues. Again I'm adding the body in a second file (application) and use: curl -sku admin:password -H “Content-Type: application/json” -X POST -d @application https://192.168.0.219/mgmt/shared/appsvcs/declare/test/applications
But instead of adding a second VIP I'm getting this error: {"code":422,"message":"Invalid data property: Per-app declaration must contain at least one application","declaration":{}}
I'm not understanding why the first call is working using cURL but the second doesn't.
Thx, Marcus