\iTopApiITopClient

Class ITopClient

Summary

Methods
Properties
Constants
__construct()
setCurlOption()
setCertificateCheck()
sendRequest()
operation()
coreGet()
coreGetRelated()
coreDelete()
coreGetCustomSelect()
coreUpdate()
coreCreate()
getNewObject()
getObjects()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$endpoint
$user
$password
$certificateCheck
$curlOptions
$proxyEnv
N/A

Properties

$endpoint

$endpoint : string

Type

string — Endpoint for iTopApi

$user

$user : string

Type

string — Username

$password

$password : string

Type

string — Password

$certificateCheck

$certificateCheck : boolean

Type

boolean — Perform ssl checks

$curlOptions

$curlOptions : array

Type

array — Array of custom curl options

$proxyEnv

$proxyEnv : boolean

Type

boolean — use environement proxy or not

Methods

__construct()

__construct(string  $endpoint, string  $user, string  $password, string  $version = '1.0',   $proxyEnv = false) 

Parameters

string $endpoint
string $user
string $password
string $version

(Default:1.0)

$proxyEnv

setCurlOption()

setCurlOption(integer  $option, mixed  $value) : $this

Parameters

integer $option

One of the CURLOPT_* constant

mixed $value

Setting

Returns

$this

setCertificateCheck()

setCertificateCheck(  $bool) : $this

Parameters

$bool

Check for SSL issues

Returns

$this

sendRequest()

sendRequest(array  $data) : mixed

Send a JSON request to the API

Parameters

array $data

Throws

\Exception

Returns

mixed

operation()

operation(string  $operation, array  $data = array()) : mixed

Execute an API operation

Parameters

string $operation
array $data

Throws

\Exception

Returns

mixed

coreGet()

coreGet(string  $class, mixed  $query = null) : mixed

Execute an API core/get

Parameters

string $class

Class to look for

mixed $query

Param to be passed as key

Returns

mixed

coreGetRelated()

coreGetRelated(string  $class, mixed  $key, string  $relation, integer  $depth = 1) : mixed

Get relations

Parameters

string $class

Class to look for

mixed $key

Param to be passed as key

string $relation

Related class to look for

integer $depth

Depth

Returns

mixed

coreDelete()

coreDelete(string  $class, mixed  $query, string  $comment = null) : mixed

Delete one/multiple objects

Parameters

string $class

Class to delete

mixed $query

Param to be passed as key

string $comment

Comment to record in iTop

Returns

mixed

coreGetCustomSelect()

coreGetCustomSelect(  $class,   $query) 

Parameters

$class
$query

coreUpdate()

coreUpdate(string  $class, mixed  $query, array  $data, string  $comment = null) : mixed

Update one/multiple objects in iTop

Parameters

string $class

Class to update

mixed $query

Param to be passed as key

array $data

Data to update

string $comment

Comment to record in iTop

Returns

mixed

coreCreate()

coreCreate(string  $class, array  $data, string  $comment = null) : mixed

Creates an object in iTop

Parameters

string $class

Class to create

array $data

Data for the objects

string $comment

Record a comment in iTop

Returns

mixed

getNewObject()

getNewObject(string  $class) : \iTopApi\ITopObject

Dispense a new ITopObject

Parameters

string $class

Class to get a new object for

Returns

\iTopApi\ITopObject

getObjects()

getObjects(string  $class, mixed  $query = null) : array|\iTopApi\ITopObject

Get objects from iTopApi

Parameters

string $class

Class to get objects for

mixed $query

Param to be passed as key

Returns

array|\iTopApi\ITopObject