Extreme Campus Controller

Expand all | Collapse all

XCC API: Add an SSID to a given AP

  • 1.  XCC API: Add an SSID to a given AP

    Posted 26 days ago

    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



  • 2.  RE: XCC API: Add an SSID to a given AP

    Posted 23 days ago

    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.

     

     



  • 3.  RE: XCC API: Add an SSID to a given AP

    Posted 23 days ago

    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.



  • 4.  RE: XCC API: Add an SSID to a given AP

    Posted 23 days ago

    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.



  • 5.  RE: XCC API: Add an SSID to a given AP

    Posted 23 days ago

    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.



  • 6.  RE: XCC API: Add an SSID to a given AP

    Posted 23 days ago

    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/".



  • 7.  RE: XCC API: Add an SSID to a given AP

    Posted 23 days ago

    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



  • 8.  RE: XCC API: Add an SSID to a given AP

    Posted 23 days ago

    OK, but unfortunately I need to enable/disable SSID on every single AP.

    Using profiles, may be I’ve to reorganize completely my configuration.

    It’ would be very useful to have a CLI command to disable an SSID on an AP, so I could use expect module to do that.



  • 9.  RE: XCC API: Add an SSID to a given AP

    Posted 23 days ago

    Ok,

    if you want to switch the SSIDs only for single APs then you can do it in the following way:


    You can apparently switch the SSID on and off per radio.
    I.e. you define all required SSIDs in the profile and then switch the SSIDs that are currently required on the radio as needed.

    Take a look at the following two parameters:
    under "/v1/aps/{apSerialNumber}":
    radioIfList => Here you define the serviceIds for the radio.
    radioIfListOvr => As written at the beginning you make sure that the profile does not overwrite your changes.

    Here there is again a get and a set, so that you can check what is in there now.

    By the way, the configuration via the CLI is not officially supported by XCC. Therefore, the way via the API is the right one.
     



  • 10.  RE: XCC API: Add an SSID to a given AP

    Posted 23 days ago

    OK, I’ll try that way.

    Thank you for your support.

    Claudio



  • 11.  RE: XCC API: Add an SSID to a given AP

    Posted 13 days ago
    Edited by StephanH 13 days ago
    Hello Claudio,

    did it work?

    ------------------------------
    Regards
    Stephan
    ------------------------------