Got it to work now and i can change ip addresses on templates! Thank all for your help: The issue was that i tried to changed it to a complete different ip range then configured on the template: /24 from 172.16.0.0/8 when i do change it but in the given range it works. Also the JSON i used wasn't formed correctly. def setmxipaddresses(p_apikey, p_shardurl, p_nwid, p_vlid):
try:
Data = {"applianceIp":"172.9.20.1","subnet":"172.9.20.0/24"}
print (p_apikey, p_shardurl, p_nwid, p_vlid)
r = requests.put('https://%s/api/v0/networks/%s/vlans/%s' % (p_shardurl, p_nwid, p_vlid), data=json.dumps(Data), headers={'X-Cisco-Meraki-API-Key': p_apikey, 'Content-Type': 'application/json'})
print (r)
except:
printusertext('ERROR 11: Unable to contact Meraki cloud')
sys.exit(2)
if r.status_code != requests.codes.ok:
return ('null')
return('ok')
... View more