Documentation

Config

SwitchOSAPI's configuration class

Table of Contents

$apiVersion  : string
$hostname  : string
$password  : string
$SSLVerifyHost  : int
$SSLVerifyPeer  : bool
$timeout  : int
$username  : string
__construct()  : Config
getAPIVersion()  : string
Getter for API version to use.
getHostname()  : string
Getter for firewall's FQDN.
getPassword()  : string
Getter for API autorized user's password.
getSSLVerifyHost()  : int
Getter for curl's option to verify SSL peer.
getSSLVerifyPeer()  : bool
Getter for curl's option to verify SSL peer.
getTimeout()  : int
Getter for curl's timeout in ms.
getUsername()  : string
Getter for API autorized user.
setAPIVersion()  : Config
Setter for API version to use.
setPassword()  : Config
Setter for API autorized user's password.
setSSLVerifyHost()  : Config
Setter for curl's option to verify SSL peer.
setSSLVerifyPeer()  : Config
Setter for curl's option to verify SSL peer.
setTimeout()  : Config
Setter for curl's timeout in ms.

Properties

$apiVersion

private string $apiVersion = 'v7'

$hostname

private string $hostname

$password

private string $password

$SSLVerifyHost

private int $SSLVerifyHost = 2

$SSLVerifyPeer

private bool $SSLVerifyPeer = TRUE

$timeout

private int $timeout = 5000

$username

private string $username

Methods

__construct()

public __construct(string $hostname, string $username, string $password) : Config
Parameters
$hostname : string

switch's FQDN or IP address

$username : string

API autorized user

$password : string

API autorized user's password

Return values
Config

Config object to be passed on a new instance of SwitchAPI object.

getAPIVersion()

Getter for API version to use.

public getAPIVersion() : string
Return values
string

API version to use.

getHostname()

Getter for firewall's FQDN.

public getHostname() : string
Return values
string

Firewall's FQDN.

getPassword()

Getter for API autorized user's password.

public getPassword() : string
Return values
string

API autorized user's password.

getSSLVerifyHost()

Getter for curl's option to verify SSL peer.

public getSSLVerifyHost() : int
Return values
int

Curl's option to verify SSL host.

getSSLVerifyPeer()

Getter for curl's option to verify SSL peer.

public getSSLVerifyPeer() : bool
Return values
bool

Curl's option to verify SSL peer.

getTimeout()

Getter for curl's timeout in ms.

public getTimeout() : int
Return values
int

Curl's timeout in ms.

getUsername()

Getter for API autorized user.

public getUsername() : string
Return values
string

API autorized user.

setAPIVersion()

Setter for API version to use.

public setAPIVersion(string $version) : Config
Parameters
$version : string

API version to use e.g. 'v7'.

Return values
Config

Config object to be passed on a new instance of SwitchAPI object.

setPassword()

Setter for API autorized user's password.

public setPassword(string $password) : Config
Parameters
$password : string

Password.

Return values
Config

Config object to be passed on a new instance of SwitchAPI object.

setSSLVerifyHost()

Setter for curl's option to verify SSL peer.

public setSSLVerifyHost(bool $verifySSLHost) : Config
Parameters
$verifySSLHost : bool

Curl's option to verify SSL host.

Return values
Config

Config object to be passed on a new instance of SwitchAPI object.

setSSLVerifyPeer()

Setter for curl's option to verify SSL peer.

public setSSLVerifyPeer(int $verifySSLPeer) : Config
Parameters
$verifySSLPeer : int

Curl's option to verify SSL peer.

Return values
Config

Config object to be passed on a new instance of SwitchAPI object.

setTimeout()

Setter for curl's timeout in ms.

public setTimeout(int $timeout) : Config
Parameters
$timeout : int

Curl's timeout in ms.

Return values
Config

Config object to be passed on a new instance of SwitchAPI object.

Search results