10-01-2021 03:02 PM
Hi All,
I’m trying to update ap configuration with XCC REST API.
I’d like to add a new SSID by updating the “service” linst in the Ap configuration.
Reading docs, I’ve written the following python function:
def addServiceToAp(controller,token,serial,service):
#print(token)
url = 'https://'+str(controller)+':5825/management/v1/aps/'+str(serial)
myHeaders = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + token
}
apConf = getApConfig(controller,token,serial) # get configuration with custom function
services = apConf['services']
services.append(service)
services.append(service)
apConf['services'] = services # Update list
try:
r = requests.put(url,verify=False, headers=myHeaders, json=apConf) # PUT the new configuration
except requests.exceptions.Timeout:
print("Timeout!")
return False
if r.status_code != 200:
print("Cannot access XCC REST API! Error code: {}".format(r.status_code))
print(r.content)
return False
else:
print("unimi-convegni added!")
print(r.status_code)
return True
Before calling the function above, I correctly get the auth token and use it successful to get the full configuration of the ap.
This function first get the ap configuration, add the SSID unimi-convegni twice to the list of services, than PUT it on the XCC.
What appens is that the configuration on the XCC isn’t updated, even if the status code returned by the PUT method is 200, that it means that the operation is successful.
XCC software version is 05.26.05.0003
Is there something wrong on the code?
Thank you in advance for any help.
Claudio
10-04-2021 11:50 AM
Hello Claudio,
The SSIDs are configured via the device group and the associated profile for the AP.
I suspect you can write your settings (hence status 200), but the data will be overwritten by the configuration in the DeviceGroup/Profile.
Try to set the checkbox in the “Advanced Setting” of the AP. This is for SSID/WLAN override.