Forum Discussion
Create new ASM Policy from Exported XML
Up to 11.5.0 the ability to designate a local filename was quite limited. The approved method in 11.5.0 to import a policy is through the "file" field. The contents of the xml file need to passed in through rest encoded into JSON.
From 11.6.0 onward you should be able to reference a local path for the file parameter. If it fails, please check for the errors in /var/log/asm/
You can try the pre 11.6.0 method as it should still work:
curl -sk -u admin:admin https://myhost/mgmt/tm/asm/tasks/import-policy/ -H 'Content-Type: application/json' -X POST -d @asm_pol.txt | python -m json.tool
{
"file": "\nI tried that and didn't work for me.
When I try the POST using: '{"filename":"policy.xml","name":"Test"}' I get the exception: The remote server returned an error: (501) Not Implemented.
When I try the POST using what you suggested: '{"file":"","status":"NEW"}' I get the exception: A positional parameter cannot be found that accepts argument '\n
For me it seems that I'm not doing the post correctly on the second post as you suggested. Could you share a little bit more ? What is python-m json.tool ? I'm trying to run my commands using Powershell...
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