Forum Discussion
Query ASM Policies with iControl in version 11.5
The response value of "virtualServers" is what you're looking for. Unfortunately, this field/value can not be obtained for all policies in a single call, but a separate request per policy is required. You will have to use Python/Perl/Bash to iterate.
Getting the "where used" Virtual Servers per one particular ASM policy
API Call:
curl -sk -u 'admin:admin' https://localhost/mgmt/tm/asm/policies/9RXyqZ_cn1PF8Dt5gRQFCQ/
Somewhere in the output, you will get:
"virtualServers":["/Common/vs_myvirtualserver,/Common/vs_myvirtualserver2"]
. If the value is empty as below, the ASM policy is not linked to any Virtual Servers
"virtualServers":[""]
The last part of gibberish (22 digits) in the API call is a unique policy ID reference. To get a list of those IDs, you will have to make another request beforehand:
curl -sk -u 'admin:admin' https://localhost/mgmt/tm/asm/policies/
Since there will be a ton of irrelevant output, you will need to use your own scripts or 3rd party tools to parse the output so it can be used in a meaningful way.
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