Wireless Access

last person joined: 13 hours ago 

Access network design for branch, remote, outdoor, and campus locations with HPE Aruba Networking access points and mobility controllers.
Expand all | Collapse all

Enable/Disable SSID Programmatically via Aruba OS8 API

This thread has been viewed 20 times
  • 1.  Enable/Disable SSID Programmatically via Aruba OS8 API

    Posted Dec 04, 2017 05:37 PM

    I'm attempting to enable and disable an SSID using the Aruba OS 8 API.  I've got it down to being able to login and get the UIDARUBA token/key, as well as using "write memory" to try to commit the change.  When I execute the attempt to enable/disable the SSID, however, I see the "_pending" flag is zero (0) and no change takes effect.  I realize this means I've likely got something wrong, but cannot seem to find out exactly what.  

     

    I'm using Postman to execute the following:

    1.  https://172.31.1.79:4343/v1/api/login  ==> A POST operation with body content "username=meuser&password=mepassword"

    2.  https://172.31.1.79:4343/v1/configuration/object/ssid_prof?config_path=%2Fmm&UIDARUBA=3906813f-ed03-47d2-be07-363ac613fb3a   ==> A POST operation with body content as shown below:

     

    {
        "profile-name": "Aruba-Testing",
        "ssid_enable": {
            "_action": "modify",
            "enabled": false
        }
    }

     

    3.  https://172.31.1.79:4343/v1/configuration/object/write_memory?config_path=%2Fmm&UIDARUBA=3906813f-ed03-47d2-be07-363ac613fb3a   ==> A POST operation with NO body content.

     

    4.  https://172.31.1.79:4343/v1/api/logout  ==> A GET operation.

     

    Any ideas what might be going on here?!



  • 2.  RE: Enable/Disable SSID Programmatically via Aruba OS8 API

    Posted Dec 05, 2017 04:10 PM

    I realize after more investigation that setting select fields is simply the difference between using the underscore (_) character vs. a dash (-) character.  I was able to set the "advertise_ap_name" field for an SSID profile with the following:

     

    {

        "profile-name":"Aruba-Test",

        "advertise_ap_name": {

            "advertise-ap-name": true

        }

    }

     

    This also works for other fields, but when I try it with ssid_enable I do not get the expected results:  i.e.

     

    {

        "profile-name":"Aruba-Test",

        "ssid_enable": {

            "ssid-enable": true

        }

    }

     

    I don't see anything obvious in the documentation about this field, and using the equivalent GET operation shows the ssid_enable field is present (_present is true) and the _flags value shows the default set to true.  If the field were non-editable, I would expect that to show up in the GET response per the documentation.  

     

    If anyone has any insight on this, it would be greatly appreciated!



  • 3.  RE: Enable/Disable SSID Programmatically via Aruba OS8 API

    Posted Jan 16, 2018 10:21 AM

    Did you ever find a resolution for this? I have encountered exactly the same issue.



  • 4.  RE: Enable/Disable SSID Programmatically via Aruba OS8 API

    Posted Jan 17, 2018 05:07 AM

    Just in case it benefits anyone else, I have a solution.

     

    If you look at the schema, via https://<ipaddress>:<port>/api/ then you'll see that some items have a type of "Inline Model <n>" and some have a type of "object". The former tend to be of the format "param_name": { "param-name": value } as you have discovered (note dashes and underscores), whilst the latter are what ssid_enable and hide_ssid are.

     

    Every object and sub-object of this type "object" can optionally contain another field called "_action" which indicates what should be done with the object.

    The various values it can take is:

    • "add" - add this new object and if already present, it will replace the old object with new.
    • "delete" - delete the instance of a multi-instance object or delete the full object for a single instance object.
    • "noop" - No action is required for this object. This value should ideally never be used.

    Not specifying anything appears to behave as adding it if was previously absent, or setting it to default if already present (or possibly leaving it unchanged, I'm not sure).

     

    Thus, to enable the ssid, you use

    "ssid_enable": {} or, if you want to be explicit, "ssid_enable": {"_action": "add"}

    And to disable the ssid you use  "ssid_enable": {"_action": "delete"}

     

    Likewise to hide an ssid you use "hide_ssid": {} or "hide_ssid": {"_action": "add"}

    And to show the ssid you use  "hide_ssid": {"_action": "delete"}

     

     



  • 5.  RE: Enable/Disable SSID Programmatically via Aruba OS8 API

    EMPLOYEE
    Posted Jul 21, 2018 10:30 AM

    Just adding the exact syntax to Enable/Disable SSID in Postman.

     

    Controller IP: 192.168.26.1
    Config_path: /md/Campus-A/20:4c:03:15:b9:9c
    UIDARUBA: 7327fb9c-5fa9-4a1d-a2b0-9588d38322b5

     

    Enable SSID:
    POST
    https://192.168.26.1/v1/configuration/object/ssid_prof?config_path=%2Fmd%2FCampus-A%2F20%3A4c%3A03%3A15%3Ab9%3A9c&UIDARUBA=7327fb9c-5fa9-4a1d-a2b0-9588d38322b5
    Body(raw)
    {
    "profile-name": "Aruba-Demo",
    "ssid_enable": {
    "_present": true
    }
    }


    Disable SSID:
    POST
    https://192.168.26.1/v1/configuration/object/ssid_prof?config_path=%2Fmd%2FCampus-A%2F20%3A4c%3A03%3A15%3Ab9%3A9c&UIDARUBA=7327fb9c-5fa9-4a1d-a2b0-9588d38322b5
    Body(raw)
    {
    "profile-name": "Aruba-Demo",
    "ssid_enable": {
    "_action": "delete"
    }
    }