Download the PHP package benclerc/aruba-switchapi without Composer
On this page you can find all versions of the php package benclerc/aruba-switchapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download benclerc/aruba-switchapi
More information about benclerc/aruba-switchapi
Files in benclerc/aruba-switchapi
Package aruba-switchapi
Short Description Library used for interacting with Aruba SwitchAPI (ArubaOS).
License MIT
Homepage https://github.com/benclerc/Aruba-SwitchAPI
Informations about the package aruba-switchapi
Aruba SwitchAPI (ArubaOS)
Aruba SwitchAPI is a PHP library for requesting Aruba switches (ArubaOS). This library can retrieve, create, update and delete configuration on the switch. It wan be used to :
- Configure switch from a PHP designed web interface.
- Backup switch configuration with a PHP script.
- So much more, it is up to you !
Warning : This library is incomplete and mainly oriented towards POE, VLAN, port and LED locator. Contributions are welcome !
You can find all supported methods on Aruba's website, choose your equipment and download the API documentation.
Table of contents
- Getting started
- Documentation
- Config class
- SwitchAPI class
- Usage
- Available methods
Getting started
- Get Composer.
- Install the library using composer
composer require benclerc/aruba-switchapi
. - Add the following to your application's main PHP file
require 'vendor/autoload.php';
. - Instanciate the Config class with the switch's hostname, username and password
$configSwitch = new \Aruba\Config('123.123.123.123', 'admin', 'password');
. - Use the Config object previously created to instanciate the SwitchAPI object
$switch = new \Aruba\SwitchAPI($configSwitch);
. - Start using the library
$runningConf = $switch->getRunningConfig();
.
Documentation
You can find a full documentation here.
Config class
This Config class is used to prepare the mandatory configuration information to instanciate and use the SwitchAPI class. In the constructor you must pass :
- The switch's hostname (FQDN) or IP address
- A valid user's username
- The valid user's password
Optional parameters :
- Timeout : 5000ms. Use
setTimeout()
to change. - SSL verify peer option : TRUE. Use
setSSLVerifyPeer()
to change. - SSL verify host option : 2. Use
setSSLVerifyHost()
to change. - API version : 'v7'. Use
setAPIVersion()
to change (only >= v7 are supported).
Example :
SwitchAPI class
Usage
This class uses Exception to handle errors, for nominal execution you should instanciate and request methods inside try/catch statements.
Examples :
Available methods
You can browse all available methods here.