saidshow_251381
Dec 06, 2016Cirrostratus
iControlREST and Curl to save and download ASM policies
Hi,
I want to be able to save/export asm policies on the F5 and then download. I want to do this using iControlREST and curl.
I am able to save UCS files with the post shown below:
curl -v -sk -u admin:admin https://myF5/mgmt/tm/sys/ucs -H 'Content-Type: application/json' -X POST -d '{"command":"save","name":"blah.ucs"}' | jq
However if I try to do something similar for asm I get errors. Below is what I was trying with asm.
curl -v -sk -u admin:admin https://myF5/mgmt/tm/asm/policies/fn9GoMrandomGvoN2dD -H 'Content-Type: application/json' -X POST -d '{"command":"save","name":"as_test.xml"}' | jq
The error I get is: { "code": 400, "message": "Could not parse/validate the Policy 'Security Policy /Common/as_test'. Unknown field 'command'", "originalRequestBody": "{\"command\":\"save\",\"name\":\"as_test.xml\"", "referer": "x.x.x.x", "restOperationId": 59083, "kind": ":resterrorresponse" }
Thank you