Wired Intelligent Edge (Campus Switching and Routing)

Reply
MVP Expert

PowerArubaSW : a powershell module for use ArubaOS Switch REST API

Hi,

 

I have been working for several months on a Powershell module that uses the ArubaOS Switch REST API.

 

This module is available on psgallery(.com) : https://www.powershellgallery.com/packages/PowerArubaSW/

Actually, we support to connect to HTTPS or HTTP

and configure the following feature :

  •  Vlans
  •  Vlans-Ports (affect a vlan tagged/untagged/forbidden to a port/interface)
  • Rest info (get api-version, timeout...)
  • LLDP
  • LACP
  • Led Locator
  • ...

it is very easy to use (and install)

 

Launch powershell command line and launch following command for install

 

Install-Module PowerArubaSW

for load the module

Import-Module PowerArubaSW

Connect to your switch

Connect-ArubaSW 192.0.2.1

You get a prompt to ask credential

 

Need to have enable web-managemnt ssl and a user/password

 

for example to get all vlan use

Get-ArubaSWVlan

 

You can get the list of command available via

Get-Command -Module PowerArubaSW

 

 and for get help (and example about a command for example Get-ArubaSWVlans)

Get-Help Get-ArubaSWVlans -Full

More documentation, example is available on https://github.com/PowerAruba/PowerArubaSW and you can also report issue/enhance !

 

 




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


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


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


PowerArubaIAP: Powershell Module to use Aruba Instant AP




ACMP 6.4 / ACMX #107 / ACCP 6.5
Aruba Employee

Re: PowerArubaSW : a powershell module for use ArubaOS Switch REST API

Hi Alagoutte,

This is excellent work!  It would be fantastic if you would share this in our Aruba Programmability and Automation group. 

Could you please repost this information in our Airheads Developer Community, located here: https://community.arubanetworks.com/t5/Developer-Community/gp-p/NetworkAbstraction

 

Thanks!

Highlighted
MVP Expert

Re: PowerArubaSW : a powershell module for use ArubaOS Switch REST API

a new release available ! (0.6)

 

What new :

 

3 new cmdlets

  • Enhance speed (Don't wait 5sec between each request...) (#32)
  • Enhance security (Enable TLS 1.2 when HTTPS is used...) (#60)
  • Better "error" message when fail to connect or use a API (#55)
  • Add -usebasicparsing for use without connnected session (like task) (#56)
  • Add integration test (using Pester) for check code (Known issue about VSF Switch) (#36)
  • Add Get|Set-ArubaSWPort(-statistics) to get and configure a port (name, status, mode...) and Port statistics (name, packets/bytes/throughtput/error TX or RX...) (#40)
  • Add Extract-Port-ArubaSW.ps1 tools script for generate a Excel file with the list of Port and configuration (vlan, status, lldp neighbor...) (#34)
  • 4 removed cmdlets (Get-ArubaSWSystemStatus[Cpu|Memory|Storage|Time] (#43)

For update

 

 

Update-Module PowerArubaSW

See also https://github.com/PowerAruba/PowerArubaSW/releases/tag/v0.6

 




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


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


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


PowerArubaIAP: Powershell Module to use Aruba Instant AP




ACMP 6.4 / ACMX #107 / ACCP 6.5
New Contributor

Re: PowerArubaSW : a powershell module for use ArubaOS Switch REST API

Hi Alexis, is it possible to use in on Powershell Core for Mac? I have pwsh in both my windows and mac machines and it works well on windows but I'm getting an "unable to connect" error on mac. I'm trying to connect to the same device on both. 

MVP Expert

Re: PowerArubaSW : a powershell module for use ArubaOS Switch REST API


@danieltudares wrote:

Hi Alexis, is it possible to use in on Powershell Core for Mac? I have pwsh in both my windows and mac machines and it works well on windows but I'm getting an "unable to connect" error on mac. I'm trying to connect to the same device on both. 


Hi Daniel,

 

What release do you have using ? (get-module -name PowerArubaSW)

 

There is some "known issue" with PowerShell Core and the module...

Actually it is not possible to connect to secure way (HTTPS) (https://github.com/PowerAruba/PowerArubaSW/issues/38)

 

if you enable http on switch and use -httpOnly to Connect-ArubaSW, can you connect ?

 

We can continue on https://github.com/PowerAruba/PowerArubaSW/issues




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


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


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


PowerArubaIAP: Powershell Module to use Aruba Instant AP




ACMP 6.4 / ACMX #107 / ACCP 6.5
New Contributor

Re: PowerArubaSW : a powershell module for use ArubaOS Switch REST API

Hi Alexis, I'm running `0.6`

 

 

PS /Users/danieltudares> Get-Module -name PowerArubaSW

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     0.6        PowerArubaSW                        {Add-ArubaSWLACP, Add-ArubaSWVlans, Add-ArubaSWVlansPorts,...


and also my switch is an 2930f running the latest version 

l3-core(config)# show flash | include Image
Image             Size (bytes) Date     Version
Primary Image    :    29616419 11/21/18 WC.16.08.0001
Secondary Image  :    29616419 11/21/18 WC.16.08.0001
Default Boot Image   : Primary

and yes, I tried with the httpOnly flag and it worked, seems to be only over https. 

I'll be following the ticket for the resolution, thanks a lot! 

 

MVP Expert

Re: PowerArubaSW : a powershell module for use ArubaOS Switch REST API


@danieltudares wrote:

Hi Alexis, I'm running `0.6`

 

 

PS /Users/danieltudares> Get-Module -name PowerArubaSW

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     0.6        PowerArubaSW                        {Add-ArubaSWLACP, Add-ArubaSWVlans, Add-ArubaSWVlansPorts,...


and also my switch is an 2930f running the latest version 

l3-core(config)# show flash | include Image
Image             Size (bytes) Date     Version
Primary Image    :    29616419 11/21/18 WC.16.08.0001
Secondary Image  :    29616419 11/21/18 WC.16.08.0001
Default Boot Image   : Primary

and yes, I tried with the httpOnly flag and it worked, seems to be only over https. 

I'll be following the ticket for the resolution, thanks a lot! 

 


Thanks Daniel for feedback,

the support of Powershell Core is planned for next release but i don't when ;-)

I have already look but it will be easy to fix for Core (need to add -SkipCertificate to Invoke-WebRequest)




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


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


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


PowerArubaIAP: Powershell Module to use Aruba Instant AP




ACMP 6.4 / ACMX #107 / ACCP 6.5
MVP Expert

Re: PowerArubaSW : a powershell module for use ArubaOS Switch REST API

a new release of PowerArubaSW is available (0.7)

 

What New ?

4 new cmdlets

  • Add support of PowerShell 6(/Core)
  • Now run (and validated) under Linux and macOS
  • Add fix some issue with Stacked/VSF switch
  • Adding DNS support (Get/Set/Remove DNS server and domain names)

more info https://github.com/PowerAruba/PowerArubaSW/releases/tag/v0.7

 

Like always for update

 

Update-Module PowerArubaSW



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


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


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


PowerArubaIAP: Powershell Module to use Aruba Instant AP




ACMP 6.4 / ACMX #107 / ACCP 6.5
MVP Expert

Re: PowerArubaSW : a powershell module for use ArubaOS Switch REST API


@danieltudares wrote:

Hi Alexis, is it possible to use in on Powershell Core for Mac? I have pwsh in both my windows and mac machines and it works well on windows but I'm getting an "unable to connect" error on mac. I'm trying to connect to the same device on both. 


Hi Daniel,

 

You can now use with your macOS !




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


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


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


PowerArubaIAP: Powershell Module to use Aruba Instant AP




ACMP 6.4 / ACMX #107 / ACCP 6.5
New Contributor

Re: PowerArubaSW : a powershell module for use ArubaOS Switch REST API

I apologize if this should be a separate thread vs a question on your PS module:

 

I'm trying to determine if the REST API for ArubaOS allows toggling the PoE state on a given port?  Aka: Port E6: turn off PoE.

 

If it's possible, can someone give a syntax example for the request?

 

 

Search Airheads
cancel
Showing results for 
Search instead for 
Did you mean: