Download the PHP package benclerc/fortinet-fortiosapi without Composer
On this page you can find all versions of the php package benclerc/fortinet-fortiosapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download benclerc/fortinet-fortiosapi
More information about benclerc/fortinet-fortiosapi
Files in benclerc/fortinet-fortiosapi
Package fortinet-fortiosapi
Short Description PHP library used for interacting with Fortigate firewall (FortiOS) APIs.
License MIT
Homepage https://github.com/benclerc/Fortinet-FortiOSAPI
Informations about the package fortinet-fortiosapi
Fortinet Fortigate configuration API (FortiOS)
This library is automatically generated, if you want support for a newer version, please open an issue.
PHP library used for interacting with Fortigate firewall (FortiOS) APIs (CMDB (Configuration), Log and Monitor). This library can retrieve, create, update and delete configuration on the firewall.
You can find all supported methods on Fortinet's developer website, you will need an account to browse information.
Table of contents
- Getting started
- Documentation
- Config class
- Usage
- Examples
- Configuration, Log and Monitor classes
- Usage
- Examples
- Transactions
- Config class
Getting started
- Get Composer.
- Install the library using composer
composer require benclerc/fortinet-fortiosapi
. - Add the following to your application's main PHP file
require 'vendor/autoload.php';
. - Instanciate the Config class with the firewall's hostname, username and password
$configConnection = new \Fortinet\FortiOSAPI\Config('123.123.123.123', 'admin', 'password');
. - Use the Config object previously created to instanciate the FortiOSAPI object
$firewallConf = new \Fortinet\FortiOSAPI\Configuration($configConnection);
. - Start using the library
$staticRoutes = $firewallConf->getAllRouterStatic();
.
Documentation
You can find a full documentation here.
Config class
Usage
This Config class is used to prepare the mandatory configuration information to instanciate and use the FortiOSAPI... classes. In the constructor you must pass :
- The firewall'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 : 2. Use
setAPIVersion()
to change.
Examples
Configuration, Log and Monitor classes
Usage
These classes uses Exception to handle errors, for nominal execution you should instanciate and request methods inside try/catch statements.
Examples
Transactions
This library also supports transactions : start a transaction, create, update, delete, and depending on the result commit or abort your changes.