Forum Discussion
Importing ASM profile with iControl REST to a custom BigIP partition
Using iControl REST for ASM module (F5 BigIP v12.1.2), I cannot figure out how to import an ASM profile to a custom partition, only
/common
seems possible...
Is there a specific parameter or HTTP header to provide?
payload={}
payload['file']=open('/home/user/sample_asm.xml,"rb").read()
payload['name']='ASM_POLICY'
bigip.post('https://%s/mgmt/tm/asm/tasks/import-policy?ver=12.1.2' % (BIGIP_ADDRESS), data=json.dumps(payload))
- https://devcentral.f5.com/d/icontrol-rest-api-user-guide-version-1210
- https://devcentral.f5.com/questions/applying-an-asm-policy-using-icontrol-rest
thanks,
JSC- CharlesCS
Cirrus
Extrapolating from the example on page 42 of the user guide, I suspect that all you need to add is a "partition" keyword/value pair to the payload. For example, if you're importing the policy into the "foo" partition, then you'd add
to the sample shown above.payload['partition']='~foo'
The tilde (
) in front of the partition name seems to be absolutely necessary.~
- Zdenda
Cirrus
Hi, actually I have same problem when I do those commands:
1) tmsh 2) cd /desiredPartition/ 3) load asm policy file /var/tmp/tmp_policy.xml
It does load policy to Common partition. Even all relations to Common partition are replaced by proper one within XML file. It works correctly via GUI, but not via TMSH.
What should I do to be able to use either Rest call or TMSH to be able to upload ASM policy to proper partition? Btw, version I use 12.1.3.3
Thanks, Zdenek
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