Documentation

System extends FortiManagerAPI

FortiManager API System

Tags
link

Fortinet developer ressource center.

Table of Contents

$config  : Config
$session  : string
$transaction  : int|null
$config  : Config
$session  : string
$transaction  : mixed
__construct()  : mixed
Constructor takes care of checking and registering FortiManager's data and login to the API
__destruct()  : mixed
Destructor takes care of logout.
execApiSdnconnector()  : stdClass
execGenerateWsdl()  : stdClass
execLoginChallenge()  : stdClass
execLoginUser()  : stdClass
execLogout()  : stdClass
execProxyJson()  : stdClass
execReboot()  : stdClass
getHaStatus()  : stdClass
getStatus()  : stdClass
curlRequest()  : stdClass
Method to request the FortiManager's API.
login()  : bool
Login in the FortiManager.
logout()  : Return
Logout from the FortiManager.

Properties

$transaction

public int|null $transaction

Ongoning transaction ID. WARNING : When going through the method prepareRequestData(), all upper case letter in function parameter name will be replaced by '-' and ;brought down to lower case. If you modify or add new endpoints replace all '-' in parameter name by the next letter in uppercase.

Methods

__construct()

Constructor takes care of checking and registering FortiManager's data and login to the API

public __construct(Config $config) : mixed
Parameters
$config : Config

Object containing all necessary configuration.

Return values
mixed

__destruct()

Destructor takes care of logout.

public __destruct() : mixed
Return values
mixed

execApiSdnconnector()

public execApiSdnconnector([ $body = null ]) : stdClass
Parameters
$body : = null

Request body.

Tags
route

POST /sys/api/sdnconnector (exec)

Return values
stdClass

Return the fortimanager's response as an object.

execGenerateWsdl()

public execGenerateWsdl([ $body = null ]) : stdClass
Parameters
$body : = null

Request body.

Tags
route

POST /sys/generate/wsdl (exec)

Return values
stdClass

Return the fortimanager's response as an object.

execLoginChallenge()

public execLoginChallenge([ $body = null ]) : stdClass
Parameters
$body : = null

Request body.

Tags
route

POST /sys/login/challenge (exec)

Return values
stdClass

Return the fortimanager's response as an object.

execLoginUser()

public execLoginUser([ $body = null ]) : stdClass
Parameters
$body : = null

Request body.

Tags
route

POST /sys/login/user (exec)

Return values
stdClass

Return the fortimanager's response as an object.

execLogout()

public execLogout([ $body = null ]) : stdClass
Parameters
$body : = null

Request body.

Tags
route

POST /sys/logout (exec)

Return values
stdClass

Return the fortimanager's response as an object.

execProxyJson()

public execProxyJson([ $body = null ]) : stdClass
Parameters
$body : = null

Request body.

Tags
route

POST /sys/proxy/json (exec)

Return values
stdClass

Return the fortimanager's response as an object.

execReboot()

public execReboot([ $body = null ]) : stdClass
Parameters
$body : = null

Request body.

Tags
route

POST /sys/reboot (exec)

Return values
stdClass

Return the fortimanager's response as an object.

getHaStatus()

public getHaStatus([ $body = null ]) : stdClass
Parameters
$body : = null

Request body.

Tags
route

POST /sys/ha/status (get)

Return values
stdClass

Return the fortimanager's response as an object.

getStatus()

public getStatus([ $body = null ]) : stdClass
Parameters
$body : = null

Request body.

Tags
route

POST /sys/status (get)

Return values
stdClass

Return the fortimanager's response as an object.

curlRequest()

Method to request the FortiManager's API.

protected curlRequest(string $method, string $endpoint[, stdClass|array<string|int, mixed> $pathData = null ][, stdClass|array<string|int, mixed> $bodyData = null ][, int $timeout = null ]) : stdClass
Parameters
$method : string

API method for the request. Must be one of those : get, add, set, update, delete, move, clone, exec.

$endpoint : string

API endpoint without the first element ('jsonrpc') and with data in the path not replaced. E.g. /pm/config/adom/{adom}/obj/firewall/address.

$pathData : stdClass|array<string|int, mixed> = null

Data to be passed in the request path.

$bodyData : stdClass|array<string|int, mixed> = null

Params to be passed in the request body.

$timeout : int = null
Return values
stdClass

Return FortiManager's response as a stdClass.

login()

Login in the FortiManager.

private login() : bool
Return values
bool

Return TRUE if successful or throw Exception if fails.

logout()

Logout from the FortiManager.

private logout() : Return
Return values
Return

TRUE if successful, FALSE if it failed.

Search results