proxy.get

Description

integer/array proxy.get(object parameters)

The method allows to retrieve proxies according to the given parameters.

This method is available to users of any 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
proxyidsstring/arrayReturn only proxies with the given IDs.
selectHostsqueryReturn a hosts property with the hosts monitored by the proxy.
selectInterfacequeryReturn an interface property with the proxy interface used by a passive proxy.
sortfieldstring/arraySort the result by the given properties.

Possible values: hostid, host, status.
countOutputbooleanThese parameters being common for all get methods are described in detail in the reference commentary.
editableboolean
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.

Examples

Retrieve all proxies

Retrieve all configured proxies and their interfaces.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "proxy.get",
  4. "params": {
  5. "output": "extend",
  6. "selectInterface": "extend"
  7. },
  8. "id": 1
  9. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": [
  4. {
  5. "host": "Active proxy",
  6. "status": "5",
  7. "description": "",
  8. "tls_connect": "1",
  9. "tls_accept": "1",
  10. "tls_issuer": "",
  11. "tls_subject": "",
  12. "proxy_address": "",
  13. "auto_compress": "0",
  14. "version": "60400",
  15. "compatibility": "1",
  16. "proxyid": "30091",
  17. "interface": []
  18. },
  19. {
  20. "host": "Passive proxy",
  21. "status": "6",
  22. "description": "",
  23. "tls_connect": "1",
  24. "tls_accept": "1",
  25. "tls_issuer": "",
  26. "tls_subject": "",
  27. "proxy_address": "",
  28. "auto_compress": "0",
  29. "lastaccess": "0",
  30. "version": "0",
  31. "compatibility": "0",
  32. "proxyid": "30092",
  33. "interface": {
  34. "interfaceid": "30109",
  35. "hostid": "30092",
  36. "main": "1",
  37. "type": "0",
  38. "useip": "1",
  39. "ip": "127.0.0.1",
  40. "dns": "",
  41. "port": "10051",
  42. "available": "0",
  43. "error": "",
  44. "errors_from": "0",
  45. "disable_until": "0",
  46. "details": []
  47. }
  48. }
  49. ],
  50. "id": 1
  51. }

See also

Source

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