Download the PHP package benclerc/fortinet-fortimanagerapi without Composer
On this page you can find all versions of the php package benclerc/fortinet-fortimanagerapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download benclerc/fortinet-fortimanagerapi
More information about benclerc/fortinet-fortimanagerapi
Files in benclerc/fortinet-fortimanagerapi
Package fortinet-fortimanagerapi
Short Description PHP library used for interacting with Fortinet firewall manager (FortiManager) API.
License MIT
Homepage https://github.com/benclerc/Fortinet-FortiManagerAPI
Informations about the package fortinet-fortimanagerapi
Fortinet FortiManager API
This library is automatically generated, if you want support for a newer version, please open an issue.
PHP library used for interacting with Fortinet firewall manager (FortiManager) APIs (CLI, DeviceManager, PolicyManager, SecurityConsole, System and Task). This library can retrieve, create, update and delete configuration on the FortiManager.
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
- CLI, DeviceManager, PolicyManager, SecurityConsole, System and Task classes
- Usage
- Examples
- Workspace
- Config class
Getting started
- Get Composer.
- Install the library using composer
composer require benclerc/fortinet-fortimanagerapi
. - Add the following to your application's main PHP file
require 'vendor/autoload.php';
. - Instanciate the Config class with the fortimanager's hostname, username and password
$configConnection = new \Fortinet\FortiManagerAPI\Config('123.123.123.123', 'admin', 'password');
. - Use the Config object previously created to instanciate the wanted class
$policyManager = new \Fortinet\FortiManagerAPI\PolicyManager($configConnection);
. - Start using the library
$globalAddrObj = $policyManager->getGlobalObjectFirewallAddress();
.
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 different classes. In the constructor you must pass :
- The fortimanager'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.
Examples
CLI, DeviceManager, PolicyManager, SecurityConsole, System and Task classes
Usage
These classes uses Exception to handle errors, for nominal execution you should instanciate and request methods inside try/catch statements.
Examples
Workspace
This library also supports workspace locking. It allows to lock the workspace, make changes and then commit thoses changes or unlock without committing (rollback).
You have to enable workspace on the FortiManager first.