Package: instantpy
Aruba Instant Python API WrapperThis module provides a Python 3 interface for the Aruba Instant 8.6 REST API.Please understand this project is a WIP.  I'd also really appreciate some help testing.  My Instant cluster is my production wifi at home.  I can't thoroughly test certain calls to the API (specifically in the Configuration portion) because breaking the wifi at home would result in an unhappy household.For full documentation, seehere.The REST API is divided into three secions.Monitoring,Action, andConfiguration.  Details on each section are below.  Logging in and out is handled by thelogin()andlogout()methods.  Logging in has a decorator method that will handle logging in if needed.  You will still need to handle logging out.See examples below.MonitoringThe monitoring endpoints of the API is used for, obviously, monitoring.  It is used to gather state, statistics, and logs from master, slave, or standalone Instant APs.  The architecture of this portion of the API is very similar to the cli output of "show" commands.  The currently supported commands areshow clientsandshow aps.  More will be added shortly.  There is also a genericshow commandmethod that will accept any CLI show commands and return unstructured text.Feel free to open an issue and request support for more commands if the structured output would be helpful.  I can also add support for different OS versions (at least back to 8.5) if it would be helpful.NOTE: The response from the API is currently unstructred text and requires parsing with RegEx.  
This lends itself to breaking easily between versions.  My current testing has been against 8.6.ActionThe action endpoints are used for configuring AP specific settings.  See below for supported endpoints.EndpointMethodDescriptionHostnamehostname()Set the hostname of a specific IAP.Swarm Modeswarm()Set an AP to be standalone or part of a swarm cluster.Static Channel and Powerchannel()Set the tx channel and power of the radios of a specific IAP.Zonezone()Set the zone of a specific IAP.Antenna Gainantenna_gain()Set the specific antenna gain when external antennas are used.Enable and Disable Radiosradio_state()Enable or disable a radio in an AP.Generic Show Commandshow_cmd()Returns unstructured output text from any "show" command provided.ConfigurationConfiguration endpoints are used to configure an Instant Virtual Controller.  See table below for supported endpoints.When intantiating an instance of InstantVC() the 'templates' directory defaults to the folder in the project.  It is recommended that you create your own templates directory and use this one for reference.Note: Due to the complexity of the profiles created using these endpoints, 
all Configuration methods require a json file as an argument.

There are examples in the "templates" directory.  
These example templates were taken directly from the 
Aruba Instant REST API document referenced above.EndpointMethodDescriptionVC Country Codevc_country_code()Set the virtual controller country code.VC IP addressvc_ip()Set the IP of the virtual controller.NTP Serverntp()Set the NTP server of the virtual controller.Syslocationsyslocation()Set the syslocation of the virtual controller.Organizationorganization()Set the virtual controller organization.Syslog Levelsyslog_level()Set the syslog level for the virtual controller.Syslog Serversyslog_server()Set the destination IP for syslog traffic from the virtual controller.dot11g Radio Profileradio_11g()Configure a radio profile for the 2.4GHz antenna.dot11a Radio Profileradio_11a()Configure a radio profile for the 5GHz antenna.ARMarm()Configure an ARM profile for use by the Instant cluster.SSID Profilessid()Configure an SSID profile for use by the Instant cluster.RF Bandrf_band()Configure an RF Band (2.4, 5, all) profile for use by the Instant cluster.Authentication Server Profileauth_server()Configure an authentication server (RADIUS) for the virtual controller.ACL Profileacl()Configure an ACL profile for use by the Intant cluster.External Captive Portalext_captive_portal()Configure an External Captive Portal profile for use by the Instant cluster.IDSids()Configure an IDS profile for use by the Instant cluster.Software Upgradeos_upgrade()Initiate an OS Upgrade of the Instant cluster.Time Zoneclock()Set clock and timezone of the virtual controller.AP Rebootap_reboot()Initiate a reboot of a single or all APs in the Instant cluster.Wired Port Profilewired_port()Configure a wired port profile for use by the Instant cluster.Wired Profile Mapwired_profile_map()Configure a wired profile to port mapping for use by the Instant cluster.Management Usermgmt_user()onfigure management users on the virtual controller.Examples:Login leveraging the @autologin decorator - In this scenario the decorator will login for you when the first API call is made.import instantpy

vc = instantpy.InstantVC('user', 'password', 'VC IP')

result = vc.clients()
...
vc.logout()Monitoring Endpoint ExampleList connected clientsimport json
import instantpy

vc = instantpy.InstantVC('user', 'password', 'VC IP')
result = vc.clients()
print(json.dumps(result, indent=4))
vc.logout()Arbitrary 'show' commandimport json
import instantpy

vc = instantpy.InstantVC('user', 'password', 'VC IP')
result = vc.show_command(command="show swarm state")
print(result)
vc.logout()Action Endpoint ExampleSet Hostname of a specfic APimport json
import instantpy

vc = instantpy.InstantVC('user', 'password', 'VC IP')
result = vc.hostname(name="testname", iap_ip="1.2.3.4")
print(json.dumps(result, indent=4))
vc.logout()Configuration Endpoint ExampleSet RADIUS Authentication Serverimport json
import instantpy

vc = instantpy.InstantVC('user', 'password', 'VC IP')
result = vc.auth_server(template='auth_server_template.json')
print(json.dumps(result, indent=4))
vc.logout()If this project has been helpful you canbuy me a coffeebut please don't feel obligated.