Documentation

Task extends FortiManagerAPI

FortiManager API Task

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.
getOneTask()  : stdClass
getOneTaskLine()  : stdClass
getOneTaskLineHistory()  : stdClass
getTask()  : stdClass
getTaskLine()  : stdClass
getTaskLineHistory()  : 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

getOneTask()

public getOneTask( $task[,  $body = null ]) : stdClass
Parameters
$task :
$body : = null

Request body.

Tags
route

POST /task/task/{task} (get)

Return values
stdClass

Return the fortimanager's response as an object.

getOneTaskLine()

public getOneTaskLine( $task,  $line[,  $body = null ]) : stdClass
Parameters
$task :
$line :
$body : = null

Request body.

Tags
route

POST /task/task/{task}/line/{line} (get)

Return values
stdClass

Return the fortimanager's response as an object.

getOneTaskLineHistory()

public getOneTaskLineHistory( $task,  $line,  $history[,  $body = null ]) : stdClass
Parameters
$task :
$line :
$history :
$body : = null

Request body.

Tags
route

POST /task/task/{task}/line/{line}/history/{history} (get)

Return values
stdClass

Return the fortimanager's response as an object.

getTask()

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

Request body.

Tags
route

POST /task/task (get)

Return values
stdClass

Return the fortimanager's response as an object.

getTaskLine()

public getTaskLine( $task[,  $body = null ]) : stdClass
Parameters
$task :
$body : = null

Request body.

Tags
route

POST /task/task/{task}/line (get)

Return values
stdClass

Return the fortimanager's response as an object.

getTaskLineHistory()

public getTaskLineHistory( $task,  $line[,  $body = null ]) : stdClass
Parameters
$task :
$line :
$body : = null

Request body.

Tags
route

POST /task/task/{task}/line/{line}/history (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