Forum Discussion
Use iControl REST to get Active ASM policies
Hi, I am wondering if there is a way using the REST API to get a list of the Active ASM policies. below is the URL and parameters I am using the get information from the ASM which returns all the ASM policies.
https://some.domain.com/mgmt/tm/asm/policies?$select=name,virtualServers,active
1 Reply
- R_Marc
Nimbostratus
You would need to look for "active" for the specified policy.
The direct policy paths are based on a UUID (or some unique hash). You'd have to go in to just /policies to get those unique hashes, then you can just parse return from /policies to acquire those, but that return also tells you on each policy if they are active or not.
For a quick and dirty example which you can run from the shell locally on your F5 or if you have a linux box handy:
curl -sk -u admin:$PASS "Content-Type: application/json" -X GET https://bigip1/mgmt/tm/asm/policies | python -m json.tool | egrep "\"name\"|\"active\""
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