Hello community,
I Need your assistance with a Meraki, Python issue,
I’m not a python specialist and I really wonder if the solution is really that simple with Python.
Let’s say I have 100 networks and I want to enable SSID interface Nr. 2 with a specific VLAN Nr. (The WLAN configuration is not the issue here).
I want to use the below python script to read through a . txt or .CSV file and execute the command below for every network.
Networkid.txt
N_111111111111111111
N_111111111111111112
N_111111111111111113
N_111111111111111114
N_111111111111111115
Read a file with networkids, execute the Python - Request “URL” with the variable Networkid and go for the next Networkid.
url = "https://api.meraki.com/api/v1/networks/{networkId}/wireless/ssids/{number}"
url = "https://n123.meraki.com/api/v1/networks/networkid/appliance/ssids/2"
******This Script works fine for a single Network****
import meraki
import requests
dashboard = meraki.DashboardAPI()
url = "https://n123.meraki.com/api/v1/networks/N_111111111111111113/appliance/ssids/2"
payload = '''{
"number": 2,
"name": "Test_3333",
"enabled": true,
"defaultVlanId": 777,
"authMode": "psk",
"psk": "xtesty2022",
"encryptionMode": "wpa",
"wpaEncryptionMode": "WPA2 only",
"visible": false
}'''
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Cisco-Meraki-API-Key": "xxabcc7ff12344bababababa333334444"
}
response = requests.request('PUT', url, headers=headers, data = payload)
print(response.text.encode('utf8'))
Thank you in advance
Ishai