I'm getting an error when running this code. while trying to update the network syslog server values. It fails when it tries to run the update = dashboard.networks.updateNetworkSyslogServers(network_id, servers) line. below is the script I'm tying to run.
thanks for your help in advance
# File will update a syslog server in networks based on county tag
import meraki
# Set Meraki variables
api_key = '6bec40cf957de430a6f1f2baa056b99a4fac9ea0' # Public Sandbox
syslog_server = '10.178.207.68' # Ashburn Syslog server
# sets what networks to update by the country tag
country_tag = 'Country-Lab-US'
# Sets the syslog server values
servers = [{'host': {syslog_server}, 'port': 513, 'roles': ['Flows', 'Security events']}]
network_loop = 0
dashboard = meraki.DashboardAPI(api_key)
all_networks = dashboard.organizations.getOrganizationNetworks(organization_id)
while network_loop < len(all_networks):
if country_tag in all_networks[network_loop]["tags"]:
network_id = all_networks[network_loop]['id']
response = dashboard.networks.updateNetworkSyslogServers(network_id, servers)
print(f' The network ID is {network_id} and country tag is {all_networks[network_loop]["tags"]}')
network_loop +=1
else:
print('nothing was updated')
network_loop +=1