Can I config mass AP name on sz100 after all the AP joined the controller
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2020 11:14 PM
Hi there,
It's there any method to modify all the ap name using script or cvs file after all the AP has joined to the sz ?
It's there any method to modify all the ap name using script or cvs file after all the AP has joined to the sz ?
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2020 11:19 PM
this is a great idea! currently we have 70 new APs to join and to rename.
we use consecutive numbering, hence it would be easy to create a csv with excel for that.
we use consecutive numbering, hence it would be easy to create a csv with excel for that.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2020 11:34 PM
But seems the csv just can work for pre-provision AP.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2020 08:15 AM
Take a look at the following:
import requests
url="https://:8443/wsg/api/public/v6_0/"
login=requests.post(url+'session',verify=False,json={'username':'admin','password':''})
cookies=login.cookies
#find the zone name and uuid you want
zones=requests.get(url+'rkszones', verify=False, cookies=cookies)
zones.json()
#get a list of all the APs
aps=requests.get(url+'aps', verify=False, cookies=cookies)
aps.json()
#get a filtered list of APs (The aps of a specific zone)
aprequest={'filters':[{'type':'APZONE', 'value': ''}]}
aps=requests.get(url+'aps', verify=False, cookies=cookies,json=aprequest)
#how many APs did we get? len(myaps['list'])
#define new names for the APs
newapnames={'E8:1D:A8:22:AC:30':'AP-PR-01-28',
'E8:1D:A8:22:91:00':'AP-PR-01-29',
'E8:1D:A8:22:C2:F0':'AP-PR-03-38',
'E8:1D:A8:22:87:C0':'AP-SE-PB-04',
'E8:1D:A8:22:DC:20':'AP-SE-PB-05',
'E8:1D:A8:22:86:30':'AP-SE-01-12',
'E8:1D:A8:22:D7:70':'AP-SE-01-13',
'E8:1D:A8:22:BE:10':'AP-SE-02-20',
'E8:1D:A8:22:94:90':'AP-BI-01-45',
'E8:1D:A8:22:87:20':'AP-BI-01-46',
'E8:1D:A8:22:DC:30':'AP-KI-PB-47',
'E8:1D:A8:22:E3:10':'AP-KI-PB-48',
'E8:1D:A8:22:D6:10':'AP-KI-PB-50',
'D8:38:FC:19:19:90':'AP-SE-01-11',
'D8:38:FC:19:05:D0':'AP-SE-01-15'}
#do the actual renaming
for apname in newapnames.keys():
print apname, newapnames[apname]
#originalap=requests.get(url+'aps/'+apname, verify=False,cookies=cookies)
#print originalap.json()
patchAp=requests.patch(url+'aps/'+apname, verify=False, json={'name':newapnames[apname]}, cookies=cookies)
print patchAp.status_code
You should run this line by line in a python shell... to be sure of what's happening. But it should get you going!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2020 08:42 AM
An additional note. This is meant for python 2.x but should work with minimal changes for python 3.x (replace the "print ..... " by "print(...)"

