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 are: hostid, host and 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. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  9. "id": 1
  10. }

Response:

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

See also

Source

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