This is a translation of the original English documentation page. Help us make it better.

connector.create

Description

object connector.create(object/array connectors)

This method allows to create new connector objects.

This method is only available to Super admin user type. Permissions to call the method can be revoked in user role settings. See User roles for more information.

Parameters

(object/array) Connector objects to create.

Additionally to the standard connector properties, the method accepts the following parameters.

Parameter Type Description
tags array Connector tag filter.

Valeurs de retour

(object) Renvoie un objet contenant les IDs des connecteurs créés sous la propriété connectorids. L’ordre des IDs renvoyés correspond à l’ordre des connecteurs transmis.

Exemples

Creating a connector

Create a connector to export trigger events with a tag filter. HTTP authentication will be performed using Bearer token.

Request:

{
           "jsonrpc": "2.0",
           "method": "connector.create",
           "params": [
               {
                   "name": "Export of events",
                   "data_type": 1,
                   "url": "{$DATA_EXPORT_URL}",
                   "authtype": 5,
                   "token": "{$DATA_EXPORT_BEARER_TOKEN}",
                   "tags": [
                       {
                           "tag": "service",
                           "operator": 0,
                           "value": "mysqld"
                       }
                   ]
               }
           ],
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "connectorid": [
                   "3"
               ]
           },
           "id": 1
       }

Source

CConnector::create() dans ui/include/classes/api/services/CConnector.php.