Forum Discussion
Jason_Nance_333
Cirrus
Give this a try:
!/usr/bin/env python3
import pprint
from f5.bigip import ManagementRoot
mgmt = ManagementRoot('hostname', 'username', 'password')
virtuals = {}
for virtual in mgmt.tm.ltm.virtuals.get_collection():
virtuals[virtual.fullPath] = {
'partition': virtual.partition,
'name': virtual.name,
'clientssl': [],
}
for profile in virtual.profiles_s.get_collection():
if profile.context == 'clientside':
try:
pobj = mgmt.tm.ltm.profile.client_ssls_client_ssl.load(
partition=profile.partition,
name=profile.name,
)
except:
Not a client ssl profile
pobj = None
if pobj:
virtuals[virtual.fullPath]['clientssl'].append({
'partition': profile.partition,
'name': profile.name,
})
If we didn't find more than 1 clientssl profile delete the virtual
server from the list (well, dict) of virtuals
if len(virtuals[virtual.fullPath]['clientssl']) < 2:
del(virtuals[virtual.fullPath])
pprint.pprint(virtuals)
jcrubaugh45_208
May 29, 2018Cirrus
this seems to be accepted by my F5 but its returning no data, im going to have to keep tweaking it some...thanks for pointing me down the road closer to my goal :)