Developer

 View Only
last person joined: 8 days ago 

Expand all | Collapse all

Aruba IAP 8.6.0.x Rest API / SSID

This thread has been viewed 78 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

    EMPLOYEE
    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

    EMPLOYEE
    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
    ------------------------------



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

    Posted 27 days ago
    Hello,
    I have the same problem than zesa with on a AP635 AP.
    I'm trying to create a new SSID with the command :
    curl "https://@IP:4343/rest/ssid?sid=SSID" -H "Content-Type: application/json" --data @ssid.json -insecure

    and I have simply copy/paste his file into a new ssid.json.

    I have no error executing the command from the Windows command, but when I log into the Aruba AP, there is no additional SSID network.

    Thanks for your help.



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

    EMPLOYEE
    Posted 27 days ago
    Hello,

    You might need to provide some details. Can you share any screenshots?

    Thanks,
    Jay


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

    MVP GURU
    Posted 26 days ago
    Do you have check the log ?

    ------------------------------
    PowerArubaSW : Powershell Module to use Aruba Switch API for Vlan, VlanPorts, LACP, LLDP...

    PowerArubaCP: Powershell Module to use ClearPass API (create NAD, Guest...)

    PowerArubaCL: Powershell Module to use Aruba Central

    PowerArubaCX: Powershell Module to use ArubaCX API (get interface/vlan/ports info)..

    ACEP / ACMX #107 / ACDX #1281
    ------------------------------



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

    EMPLOYEE
    Posted 26 days ago

    Create folder json_IAP (example)

     

    cd json_IAP from terminal

    Creation of the various files in json format based on the documentation Aruba Instant 8.9.0.0 REST API Guide

     

    Connect at the session
     

    ➜  json_IAP curl "https://10.224.101.2:4343/rest/login" -H "Content-Type: application/json" --data '{"user":"admin","passwd":"password' --insecure                                                

    {                                                                                                                                                                                                     

            "Status":       "Success",                                                                                                                                                                    

            "sid":  "kdV8dlqWzR9Hz4oHFxiN"  

     

    sid will be use on the next commands

     

    Creation new SSID (see page 42)

     

    ➜  json_IAP curl "https://10.224.101.2:4343/rest/ssid?sid=kdV8dlqWzR9Hz4oHFxiN" -H "Content-Type: application/json" --data @ssid_json_file --insecure                                                

    {                                                                                                                                                                                                     

            "Status-code":  0,                                                                                                                                                                            

            "message":      "Success"                                                                                                                                                                     

    }%  

     

    Deletion SSID

    Open file json ssid_json_file and change create to delete and retype previous command

     

    ➜  json_IAP curl "https://10.224.101.2:4343/rest/ssid?sid=kdV8dlqWzR9Hz4oHFxiN" -H "Content-Type: application/json" --data @ssid_json_file --insecure                                                

    {                                                                                                                                                                                                     

            "Status-code":  0,                                                                                                                                                                            

            "message":      "Success"                                                                                                                                                                     

    }%  

    Logout session

    ➜  json_IAP curl "https://10.224.101.2:4343/rest/logout" -H "Content-Type: application/json" --data '{"sid":"kdV8dlqWzR9Hz4oHFxiN"}' --insecure -k                                                   

    {                                                                                                                                                                                                     

            "Status-code":  0,                                                                                                                                                                            

            "message":      "User logout successfully"                                                                                                                                                    

    }%

    @alagoutte Oh la question à Kudos 😁



    ------------------------------
    Nicolas Culetto
    SE Aruba France
    ------------------------------