You are viewing documentation for the development version, it may be incomplete.
Join our translation project and help translate Zabbix documentation into your native language.

connector.get

Description

integer/array connector.get(object parameters)

The method allows to retrieve connector objects according to the given parameters.

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) Parameters defining the desired output.

The method supports the following parameters.

Parameter Type Description
connectorids ID/array Return only connectors with the given IDs.
selectTags query Return a tags property with connector tag filter.

Supports count.
sortfield string/array Sort the result by the given properties.

Possible values: connectorid, name, data_type, status.
countOutput boolean These parameters being common for all get methods are described in detail in the reference commentary.
excludeSearch boolean
filter object
limit integer
output query
preservekeys boolean
search object
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch boolean

Return values

(integer/array) Returns either:

  • an array of objects;
  • the count of retrieved objects, if the countOutput parameter has been used.

Examples

Retrieving all connectors

Retrieve all data about all connectors and their properties.

Request:

{
           "jsonrpc": "2.0",
           "method": "connector.get",
           "params": {
               "output": "extend",
               "selectTags": ["tag", "operator", "value"],
               "preservekeys": true
           },
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": [
               {
                   "connectorid": "1",
                   "name": "Export of item values",
                   "protocol": "0",
                   "data_type": "0",
                   "url": "{$DATA_EXPORT_VALUES_URL}",
                   "item_value_type": "31",
                   "authtype": "4",
                   "username": "{$DATA_EXPORT_VALUES_USERNAME}",
                   "password": "{$DATA_EXPORT_VALUES_PASSWORD}",
                   "token": "",
                   "max_records": "0",
                   "max_senders": "4",
                   "max_attempts": "2",
                   "attempt_interval": "10s",
                   "timeout": "10s",
                   "http_proxy": "{$DATA_EXPORT_VALUES_PROXY}",
                   "verify_peer": "1",
                   "verify_host": "1",
                   "ssl_cert_file": "{$DATA_EXPORT_VALUES_SSL_CERT_FILE}",
                   "ssl_key_file": "{$DATA_EXPORT_VALUES_SSL_KEY_FILE}",
                   "ssl_key_password": "",
                   "description": "",
                   "status": "1",
                   "tags_evaltype": "0",
                   "tags": [
                       {
                           "tag": "component",
                           "operator": "0",
                           "value": "memory"
                       }
                   ]
               },
               {
                   "connectorid": "2",
                   "name": "Export of events",
                   "protocol": "0",
                   "data_type": "1",
                   "url": "{$DATA_EXPORT_EVENTS_URL}",
                   "item_value_type": "31",
                   "authtype": "5",
                   "username": "",
                   "password": "",
                   "token": "{$DATA_EXPORT_EVENTS_BEARER_TOKEN}",
                   "max_records": "0",
                   "max_senders": "2",
                   "max_attempts": "1",
                   "attempt_interval": "5s",
                   "timeout": "5s",
                   "http_proxy": "",
                   "verify_peer": "1",
                   "verify_host": "1",
                   "ssl_cert_file": "",
                   "ssl_key_file": "",
                   "ssl_key_password": "",
                   "description": "",
                   "status": "1",
                   "tags_evaltype": "0",
                   "tags": [
                       {
                           "tag": "scope",
                           "operator": "0",
                           "value": "performance"
                       }
                   ]
               }
           ],
           "id": 1
       }

Source

CConnector:get() in ui/include/classes/api/services/CConnector.php.