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 12:57 PM
Hi Stephan,
thank you for your reply.
So there’s no way to enable or disable an SSID in a single AP by Web API.
Do you know how to disable it by ECA CLI?
Thanks a lot
Claudio
10-04-2021 12:54 PM
If the SSIDs are the same for all APs that belong to a profile. You can make your changes directly to the profile.
The access is done via the "ProfileManager" and the "ServiceManager".
Where the so-called serviceIds are relevant for the profile.
It is best to first look at the profiles with: "management/v3/profiles/".
10-04-2021 12:27 PM
Hello,
from the API guide:
services
Array of strings
A list of the names of the services this AP is providing. They could be obtained by looking up its site and getting them from there but it is likely that it will be more efficient to include references to the services directly. This attribute is READ-ONLY in this Access Point Element
Valid character set : Alphanumeric, special characters except semi-colon, colon and ampersand
It seems that can not work.
10-04-2021 12:11 PM
Hello Claudio,
I am aware that you are using the API. But you have to find the switch that sets the hook in my image either via the API or you have to set the hook once manually, otherwise your settings will be overwritten by the profile as written by me.
How should the AP know that he may no longer apply what comes from the profile? Therefore, in my opinion, the hook must be set (for every AP) then the AP knows that you want to overwrite the settings manually.
10-04-2021 12:05 PM
Hello Stephan,
I’m using the API to enable and disable an SSID on schedule by a script. I’m aware that I can enable/disable It by hand, but I need to enable/disable It automatically.
I also tried to use ECA CLI with expect python module, but I found how to enable an SSID with ‘wlan-assign’ command in the ap/serial-number context, but I did not find the command to disable It.
Is seems that you can use the ‘no’ command, but I did not find the way to use It. The ECA CLI is not documented, as far as I know.