Ok so have my script to grab all our networks. Now I would like to filter that list by a word in the name. This issue I am having is the list of networks is showing the ID and Name together but on separate lines.
id: #1
name: #1
id: #2
name: #2
etc...
Now I have been able to filter but when I do it only gives new the name and not the id. So if I filter on the name containing Z3:
Z3....
Z3.....
etc...
I would like it to return id:name combination that matches a word in the name.
L_###### : Z3...
Here is what I have currently. I have tried a couple different ways of filtering but just can't get it the way I want.
import meraki
API_KEY = ''
dashboard = meraki.DashboardAPI(API_KEY, suppress_logging=True)
organization_id = ''
response = dashboard.organizations.getOrganizationNetworks(
organization_id, total_pages='all'
)
#ID and Name
fields = ['id', 'name']
for item in response:
for field in fields:
if "Z3" in item[field]:
print (f"{field}: {item[field]}")
Thanks in Advance!