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.

ParameterTypeDescription
connectoridsstring/arrayReturn only connectors with the given IDs.
selectTagsqueryReturn a tags property with connector tag filter.

Supports count.
sortfieldstring/arraySort the result by the given properties.

Possible values are: connectorid, name, data_type and status.
countOutputbooleanThese parameters being common for all get methods are described in detail in the reference commentary.
excludeSearchboolean
filterobject
limitinteger
outputquery
preservekeysboolean
searchobject
searchByAnyboolean
searchWildcardsEnabledboolean
sortorderstring/array
startSearchboolean

Return values

(integer/array) Returns either:

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

示例

Retrieving all connectors

Retrieve all data about all connectors and their properties.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "connector.get",
  4. "params": {
  5. "output": "extend",
  6. "selectTags": ["tag", "operator", "value"],
  7. "preservekeys": true
  8. },
  9. "id": 1
  10. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": [
  4. {
  5. "connectorid": "1",
  6. "name": "Export of item values",
  7. "protocol": "0",
  8. "data_type": "0",
  9. "url": "{$DATA_EXPORT_VALUES_URL}",
  10. "max_records": "0",
  11. "max_senders": "4",
  12. "max_attempts": "2",
  13. "timeout": "10s",
  14. "http_proxy": "{$DATA_EXPORT_VALUES_PROXY}",
  15. "authtype": "4",
  16. "username": "{$DATA_EXPORT_VALUES_USERNAME}",
  17. "password": "{$DATA_EXPORT_VALUES_PASSWORD}",
  18. "token": "",
  19. "verify_peer": "1",
  20. "verify_host": "1",
  21. "ssl_cert_file": "{$DATA_EXPORT_VALUES_SSL_CERT_FILE}",
  22. "ssl_key_file": "{$DATA_EXPORT_VALUES_SSL_KEY_FILE}",
  23. "ssl_key_password": "",
  24. "description": "",
  25. "status": "1",
  26. "tags_evaltype": "0",
  27. "tags": [
  28. {
  29. "tag": "component",
  30. "operator": "0",
  31. "value": "memory"
  32. }
  33. ]
  34. },
  35. {
  36. "connectorid": "2",
  37. "name": "Export of events",
  38. "protocol": "0",
  39. "data_type": "1",
  40. "url": "{$DATA_EXPORT_EVENTS_URL}",
  41. "max_records": "0",
  42. "max_senders": "2",
  43. "max_attempts": "2",
  44. "timeout": "5s",
  45. "http_proxy": "",
  46. "authtype": "5",
  47. "username": "",
  48. "password": "",
  49. "token": "{$DATA_EXPORT_EVENTS_BEARER_TOKEN}",
  50. "verify_peer": "1",
  51. "verify_host": "1",
  52. "ssl_cert_file": "",
  53. "ssl_key_file": "",
  54. "ssl_key_password": "",
  55. "description": "",
  56. "status": "1",
  57. "tags_evaltype": "0",
  58. "tags": [
  59. {
  60. "tag": "scope",
  61. "operator": "0",
  62. "value": "performance"
  63. }
  64. ]
  65. }
  66. ],
  67. "id": 1
  68. }

Source

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