Developer

 View Only
  • 1.  AOS-CX Postman errors with version Virtual.10.07.0010

    Posted 2 days ago

    Hello

    In case anyone else out there is having problems running the AOS-CX Postman collection against a virtual CX, here is a solution that I came up with. The collection comes with a script that looks for a header in the response object of a successful authentication called 'X-Csrf-Token', then sets the value of that header as the token. Running this against a virtual CX failed. After a bit of digging I noticed that a successful authentication set a set-cookie header that contains the token. Modifying the Pre-request script to look for a header value that starts with 'user' and using that as a bearer token seems to work. Here's the code:

            }, function (err, response) {
                if (response.code == 200){
                    token = null
                    responseJSON = JSON.parse(JSON.stringify(response))
                    Object.entries(responseJSON.header).forEach(([key, value]) => {
                        key = value.key
                        value = value.value
                        //console.log(`header: ${key} - ${value}`)
                        if (value.startsWith("user")){
                            console.log('Login Successful. Succcessfully fetched new API token.')
                            console.log(`${value}`)
                            token = value
                            pm.environment.set("token", token);
                            pm.request.headers.add({
                                key: "x-csrf-token",
                                value: pm.environment.get("token")    
                            });
                        }
                    });

    Replace lines 30-48 in the pre-request script with that. 

    I don't know if that will work with other CX versions



  • 2.  RE: AOS-CX Postman errors with version Virtual.10.07.0010

    Posted 6 hours ago

    Hi Allen,

    Do you have try with new OVA image? (10.07 is very old and not longer supported)



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



  • 3.  RE: AOS-CX Postman errors with version Virtual.10.07.0010

    Posted an hour ago

    No, I did not. I just downloaded 10.15 - will try with that version.