Esta é uma tradução da página de documentação original em inglês. Ajude-nos a torná-la melhor.

Método connector.get

##Descrição

integer/array connector.get(object parameters)

O método permite recuperar objetos de conectores de acordo com determinados parâmetros.

:::Nota Este método só está disponível para usuário do tipo Super admin. Permissões para chamar o método podem ser retiradas nas configurações de roles. Veja [User roles] (/manual/web_interface/frontend_sections/users/user_roles) para mais informações.

Parameters

(object) Parameters defining the desired output.

The method supports the following parameters.

Parameter Type Description
connectorids string/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 are: connectorid, name, data_type and 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

Valores de retorno

(integer/array) Retorna:

  • um array (vetor) de objetos, ou;
  • a contagem de objetos recuperados, se o parâmetro countOutput foi usado.

Exemplos

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}",
                   "max_records": "0",
                   "max_senders": "4",
                   "max_attempts": "2",
                   "timeout": "10s",
                   "http_proxy": "{$DATA_EXPORT_VALUES_PROXY}",
                   "authtype": "4",
                   "username": "{$DATA_EXPORT_VALUES_USERNAME}",
                   "password": "{$DATA_EXPORT_VALUES_PASSWORD}",
                   "token": "",
                   "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}",
                   "max_records": "0",
                   "max_senders": "2",
                   "max_attempts": "2",
                   "timeout": "5s",
                   "http_proxy": "",
                   "authtype": "5",
                   "username": "",
                   "password": "",
                   "token": "{$DATA_EXPORT_EVENTS_BEARER_TOKEN}",
                   "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.