Это перевод страницы документации с английского языка. Помогите нам сделать его лучше.

connector.update

Описание

object connector.update(объект/массив connectors)

Этот метод позволяет обновить существующие коннекторы.

Этот метод доступен только пользователю с типом доступа Супер-администратор. Разрешения на вызов метода можно отозвать в настройках ролей пользователя. Дополнительную информацию см. в разделе Роли пользователей.

Parameters

(object/array) Connector properties to be updated.

The connectorid property must be defined for each connector, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.

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

Parameter Type Description
tags array Connector tag filter to replace the current tag filter.

Return values

(object) Returns an object containing the IDs of the updated connectors under the connectorids property.

Примеры

Изменение типа HTTP-аутентификации

Измените тип аутентификации HTTP на «Носитель» для соединителя с идентификатором «3».

Запрос:

{
           "jsonrpc": "2.0",
           "method": "connector.update",
           "params": {
               "connectorid": 3,
               "authtype": 5,
               "token": "{$DATA_EXPORT_BEARER_TOKEN}"
           },
           "id": 1
       }
Copy
✔ Copied

Ответ:

{
           "jsonrpc": "2.0",
           "result": {
               "connectorids": [
                   "3"
               ]
           },
           "id": 1
       }
Copy
✔ Copied

Обновление фильтра тегов

Измените фильтр тегов для соединителя с идентификатором «5».

Запрос:

{
           "jsonrpc": "2.0",
           "method": "connector.update",
           "params": [
               {
                   "connectorid": 5,
                   "tags_evaltype": 2,
                   "tags": [
                       {
                           "tag": "service",
                           "operator": 0,
                           "value": "mysqld"
                       },
                       {
                           "tag": "error",
                           "operator": 12,
                           "value": ""
                       }
                   ]
               }
           ],
           "id": 1
       }
Copy
✔ Copied

Ответ:

{
           "jsonrpc": "2.0",
           "result": {
               "connectorids": [
                   "5"
               ]
           },
           "id": 1
       }
Copy
✔ Copied

Источник

CConnector::update() в ui/include/classes/api/services/CConnector.php.

To toggle search highlight, press Ctrl+Alt+H
Have an improvement suggestion for this page? Select the text that could be improved and press Ctrl+Enter to send it to the editors.