Hi,
I'm working on a Python script to change ip ranges of MX's that are bound to a template.
def setmxipaddresses(p_apikey, p_shardurl, p_nwid, p_vlid):
try:
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({'applianceIp':'192.168.1.2','subnet':'192.168.1.0/24'}), 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')
if arg_IP_address != 'null':
#print (getvlan (arg_apikey, shardurl, nwid))
setmxipaddresses(arg_apikey, shardurl, nwid, arg_IP_address)
But is seems that there is something wrong as i'm getting a error 400 back but i cannot figure out what is wrong.