Original Message:
Sent: May 05, 2023 06:08 PM
From: BT20
Subject: Aruba Central - How to disable a WLAN/SSID?
If anyone comes across this, we got it to work. Aruba Central get wlan, will send a key:value dictionary, formatted as a string. This is what they want back in the "Put" call - except they want it as an "object" - a key:value object - with {"value":wlan_string}, where wlan_string is the original key:value they sent in the "get" call, modified as you need to, of course.
If any Aruba dev's read this, it's really annoying/frustrating - that you want an object, with a key named "value", and the value of "value" is a string, of a dictionary. Clear as mud. Thanks.
#...truncated # wlan at this point, is the raw string sent from Aruba Central - it's a k:v dictionary, in a string format. # The api demands wlan be an object, with a key called "value". wlan = {"value": wlan} # Build a dictionary with the base url and the token central = get_central() apiPath = f"/configuration/full_wlan/{group_name}/{ssid}" # this is the set the wlan configuration apiMethod = "PUT" print("Sending wlan") response = central.command(apiMethod=apiMethod, apiPath=apiPath, apiData=wlan) if response['code'] == 200: print("Sent the wlan") return {'code':200, 'msg':'WLAN successfully sent to Aruba Central'} else: {'code':500, 'msg':response}###################def get_central(ssl_verify:bool=False): """Create an Aruba Central Object which utilizes the Aruba Central SDK to issue commands to Aruba Central API endpoints. Args: ssl_verify (bool, optional): A Parameter the SDK wants. Defaults to False. Returns: central (Aruba Central SDK Object): An Aruba Central SDK object used to issue commands. """ # get aws param to send to central PNAME = "XXXXXXXXXXXXXXX" # Note, we're NOT caching the token or renewing it. Every time we make an api call # We're going to get a new token. This is a TODO: for the future. token = get_token(PNAME) # Calling out to an imported function, which makes the API Call to get the Aruba Central token. # Build a dictionary with the base url and the token central_info = { "base_url": "https://apigw-prod2.central.arubanetworks.com", "token": token } # The code below instantiates an object, we're calling "central", of the ArubaCentralBase class. central = ArubaCentralBase(central_info=central_info, ssl_verify=ssl_verify) return central
------------------------------
Brannen Taylor
LendingTree
Manager, Network Operations
Original Message:
Sent: May 04, 2023 09:52 AM
From: BT20
Subject: Aruba Central - How to disable a WLAN/SSID?
Now I'm trying the string below, in swagger, and getting a 400 "not a string"
{"value": {"wlan": {"essid": "LTTEST", "type": "employee", "disable_ssid": "false"}}}
Getting swagger response:
{ "detail": "{'wlan': {'essid': 'LTTEST', 'type': 'employee', 'disable_ssid': 'false'}} is not of type 'string'", "status": 400, "title": "Bad Request", "type": "about:blank" }
------------------------------
Brannen Taylor
LendingTree
Manager, Network Operations
Original Message:
Sent: May 03, 2023 02:34 PM
From: BT20
Subject: Aruba Central - How to disable a WLAN/SSID?
Also tried variations of "disable_ssid"
"false"
false
False
None work.
------------------------------
Brannen Taylor
LendingTree
Manager, Network Operations
Original Message:
Sent: May 03, 2023 02:12 PM
From: BT20
Subject: Aruba Central - How to disable a WLAN/SSID?
Looks like this might be a step in the right direction - the change doesn't work, but it returns a "200" OK.
{ "wlan": { "essid": "LTTEST", "type":"employee", "disable_ssid": false }}
------------------------------
Brannen Taylor
LendingTree
Manager, Network Operations
Original Message:
Sent: May 03, 2023 01:37 PM
From: BT20
Subject: Aruba Central - How to disable a WLAN/SSID?
However, this api call gives me a 500 error
https://apigw-prod2.central.arubanetworks.com/configuration/full_wlan/GROUPNAME/SSID
error:
{ "description": "'value'", "error_code": "0001", "service_name": "Configuration"}
Response code 500
------------------------------
Brannen Taylor
LendingTree
Manager, Network Operations
Original Message:
Sent: May 03, 2023 01:29 PM
From: BT20
Subject: Aruba Central - How to disable a WLAN/SSID?
I did a
apiPath = "/configuration/full_wlan/GROUPNAME/SSID"
and got the full wlan config into JSON. With a GUI change to disable the network, and then compared the "before" and "after" and the only change is:
"disable_ssid": false,
changes to:
"disable_ssid": true,
So, parsing the json, it appears the body to send the api should be:
{ "wlan": { //disable:false = ENABLED "disable_ssid": false }}//{ "wlan": { //disable:true= DISABLED "disable_ssid": true }}
------------------------------
Brannen Taylor
LendingTree
Manager, Network Operations
Original Message:
Sent: May 03, 2023 08:55 AM
From: BT20
Subject: Aruba Central - How to disable a WLAN/SSID?
Now that we can change the wlan password in Central, we're working on automation to turn the wlan on and off. We think the endpoint to do it is:
{"wlan":{"disable_ssid": true}}
However, we cannot get this working in swagger - getting 400's and 500's.
Can anyone help?
------------------------------
Brannen Taylor
LendingTree
Manager, Network Operations
------------------------------