Hello everyone,
I recently started playing around with the rather newer REST API of the ArubaOS-Switch devices. It is the first time for me programming in python, but thanks to the French How-To-Guides from Aruba Employee alegall and Google Translate, I was able to get a basic setup running.
However I've encountered two problems so far, that unfortunately I cannot solve by myself.
1. On the factory-default configuration without a username and password, I'm able to create a specific VLAN on the Switch without generating a cookie.
But I'm not able to delete that VLAN. Is that an intended behavior?
url = "http://192.168.1.10/rest/v1/vlans"
delete_vlan = requests.delete(url, data=json.dumps({"vlan_id": 10}))
2. I was unable to get the file-transfer working. As far as I understood that function, I should be able to upload a firmware to the switch. The primary file transfer method in the past was TFTP, so I assumed that one.
url = "http://192.168.1.10/rest/v2/file-transfer"
fw = {
"file_type": "FTT_FIRMWARE",
"action": "FTA_DOWNLOAD",
"url": "<path to TFTP>",
"boot_image": "BI_PRIMARY_IMAGE"
}
firmware_update = requests.post(url, data=json.dumps(fw))
I appreciate any help or further reading material.