Forum Discussion
List all VS and associated (or not) Dos profile
- Mar 04, 2022
Hi SamCo,
You should be able to obtain a full list of the virtual servers, and a full list of the DoS profiles fairly easily, then in a programming language iterate over each VIP and the list of DoS profiles to check if there are any matches.
So basically in some python pseudocode:
Get /mgmt/tm/ltm/virtual as virtuals Get /mgmt/tm/security/dos/profile as dosprofiles for vip in virtuals: # start by setting some variable to false, if there is no dos profile match it will stay false match = False for profile in dosprofiles: if profile['name'] in vip['profiles']: # found a profile match, set some variable to true match = True # return the requested data
You may also find it helpful to use the "expandSubcollections" flag, which can reduce the number of calls needed, but does increase the size of the response. More info is here: https://community.f5.com/t5/technical-articles/demystifying-icontrol-rest-part-3-how-to-pass-query-parameters/ta-p/286957
Hope this helps.
Hi SamCo,
You should be able to obtain a full list of the virtual servers, and a full list of the DoS profiles fairly easily, then in a programming language iterate over each VIP and the list of DoS profiles to check if there are any matches.
So basically in some python pseudocode:
Get /mgmt/tm/ltm/virtual as virtuals
Get /mgmt/tm/security/dos/profile as dosprofiles
for vip in virtuals:
# start by setting some variable to false, if there is no dos profile match it will stay false
match = False
for profile in dosprofiles:
if profile['name'] in vip['profiles']:
# found a profile match, set some variable to true
match = True
# return the requested data
You may also find it helpful to use the "expandSubcollections" flag, which can reduce the number of calls needed, but does increase the size of the response. More info is here: https://community.f5.com/t5/technical-articles/demystifying-icontrol-rest-part-3-how-to-pass-query-parameters/ta-p/286957
Hope this helps.
- SamCoMar 07, 2022
Cirrus
Many Thanks ! ExpandSubcollection will really help.
I am not very familiar with python, and make my call with php.
Cheers,
Sam
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