Developer

last person joined: yesterday 

Expand all | Collapse all

Aruba IAP 8.6.0.x Rest API / SSID

This thread has been viewed 57 times
  • 1.  Aruba IAP 8.6.0.x Rest API / SSID

    Posted Nov 26, 2020 11:56 AM
    Hey guys,
    I am testing the API functionality with Aruba IAP 325,
    I have one master and 5 slaves.
    I already enabled API with allow-rest-api,
    and I can also login with

    curl "https://IP:4343/rest/login" -H "Content-Type: application/json" --data '{"user": "user", "passwd": "password"}' -k
    and get success a response.

    Now, I would use an SSID profile.
    Regarding the documentation Aruba IAP 8.6.0.x there is one ssid example.
    I tried to use this, but nothing happens.
    When I use:

    curl "https://IP:4343/rest/ssid?sid=SID" -H "Content-Type: application/json" --data ssid.json -k
    I receive:

    {

    "Status-code": 3,

    "message": "Failed to parse JSON input for /rest/ssid"

    }

    When I use
    curl "https://IP:4343/rest/ssid?sid=SID" -H "Content-Type: application/json" --data ssid.json -
    insecure

    I receive nothing.
    -k or -insecure , according to macOS CLI curl man both skip the cert check.

    Actually, I would think, this is good, but it isn't.
    When I log in to Aruba IAP, there is no additional SSID network.

    What is wrong?

    Here the ssid.json code, which is a copy from the documentation:

    {
    "ssid-profile" :
    {
    "action" : "create",
    "ssid-profile" : "AA-Cabin123",
    "essid":
    {
    "action" : "create",
    "value" : "AA-Cabin123"
    },
    "type": "employee",
    "opmode" : "wpa2-psk-aes",
    "wpa-passphrase": "abcefgg@123",
    "vlan":
    {
    "action" : "create",
    "value" : "30"
    },
    "rf-band": "5.0",
    "enable": "yes",
    "dtim-period":
    {
    "action" : "create",
    "value" : 1
    },
    "broadcast-filter":
    {
    "action" : "create",
    "value" : "arp"
    },
    "g-min-tx-rate": "1",
    "a-min-tx-rate": "6",
    "a-basic-rates":
    {
    "action" : "create",
    "value" : "6,9"
    },
    "g-basic-rates":
    {
    "action" : "create",
    "value" : "11"
    },
    "dmo-channel-utilization-threshold": 90,
    "local-probe-req-thresh": 0,
    "max-clients-threshold": 64,
    "dot11k": "enable",
    "dot11r": "enable",
    "dot11v": "enable",
    "mdid" :
    {
    "action" : "create",
    "value" : 65535
    },
    "auth-server" :
    {
    "action" : "create",
    "value" : "auth_server"
    },
    "deny-inter-user-bridging" : "enable",
    "deny-local-routing" : "enable",
    "max-authentication-failures" : 0
    }
    }



  • 2.  RE: Aruba IAP 8.6.0.x Rest API / SSID

    Posted Dec 08, 2020 12:30 PM

    Hello,

    I see an error in your cURL usage. If you specify "-d" and your Content-Type is "application/json" then you need to pass a json string and not a file.

    If you would like to pass a json file you need to add "@" before the filename, eg: @myjsonfile.json.

    Let me know if that works out for you.

    Thanks,
    Jay



    ------------------------------
    Jay Pathak
    ------------------------------



  • 3.  RE: Aruba IAP 8.6.0.x Rest API / SSID

    Posted Dec 11, 2020 09:38 AM
    Awesome. it worked.
    Any idea how I can delete a profile? Didn't find anything in the documentation about.​

    ------------------------------
    Salih Zett
    ------------------------------



  • 4.  RE: Aruba IAP 8.6.0.x Rest API / SSID

    Posted Dec 11, 2020 12:57 PM

    Yes, sure. To delete anything on AOS8 via API, you need to use the POST method itself. The way it works is using a key "_action" and its value "delete".
    You need to add "_action": "delete" wherever required. For deleting the entire profile, usually it goes with the "profile-name" key n the JSON payload. For more information checkout the Aruba Developer Hub.

    You can find some examples on different type of actions and their respective JSON payloads here

    Thanks,

    Jay



    ------------------------------
    Jay Pathak
    ------------------------------



  • 5.  RE: Aruba IAP 8.6.0.x Rest API / SSID

    Posted Jan 04, 2021 08:41 AM
    Works really good, thanks.
    What I regonize is aruba doesn't allow whitespaces in value for SSID name. (this cant be a JSON issue).

    When I use whitespace for instance "enterprise guest" the whole json file is not working.



    ------------------------------
    Salih Zett
    ------------------------------