proxy.get

Description

integer/array proxy.get(object parameters)

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

Parameters

(object) Parameters defining the desired output.

The method supports the following parameters.

Parameter Type Description
proxyids string/array Return only proxies with the given IDs.
selectHosts query Return hosts monitored by the proxy in the hosts property.
selectInterface query Return the proxy interface used by a passive proxy in the interface property.
sortfield string/array Sort the result by the given properties. Possible values are: hostid, host and status.
countOutput flagThese parameters being common for all get methods are described in detail in the reference commentary.
editable boolean
excludeSearch flag
filter object
limit integer
output query
preservekeys flag
search object
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch flag

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. "interface": [],
  6. "host": "Active proxy",
  7. "status": "5",
  8. "lastaccess": "0",
  9. "proxyid": "30091",
  10. "description": "",
  11. "tls_connect": "1",
  12. "tls_accept": "1",
  13. "tls_issuer": "",
  14. "tls_subject": "",
  15. "tls_psk_identity": "",
  16. "tls_psk": ""
  17. },
  18. {
  19. "interface": {
  20. "interfaceid": "30109",
  21. "hostid": "30092",
  22. "useip": "1",
  23. "ip": "127.0.0.1",
  24. "dns": "",
  25. "port": "10051"
  26. ],
  27. "host": "Passive proxy",
  28. "status": "6",
  29. "lastaccess": "0",
  30. "proxyid": "30092",
  31. "description": ""
  32. }
  33. ],
  34. "id": 1
  35. }

See also

Source

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