获取

描述

integer/array screen.get(object **parameters**)

此方法允许搜索符合所给参数的聚合图形

参数

(object) 定义所需输出的参数。

此方法支持以下参数

ParameterTypeDescription
screenidsstring/array返回所给ID (单个或者多个) 的聚合图形。
useridsstring/array返回所给用户ID (单个或者多个) 的聚合图形。
screenitemidsstring/array返回所给聚合图形项的的聚合图形。
selectUsersquery返回users属性中与聚合图形共享的用户。
selectUserGroupsquery返回userGroups属性中与聚合图形共享的用户组。
selectScreenItemsquery返回聚合图形上使用的聚合图形项。
sortfieldstring/array根据所给参数对结果进行排序

可能的值:screenidname
countOutputboolean这个参数通用与所有的get方法,详细描述在reference commentary
editableboolean
excludeSearchboolean
filterobject
limitinteger
outputquery
preservekeysboolean
searchobject
searchByAnyboolean
searchWildcardsEnabledboolean
sortorderstring/array
startSearchboolean

返回值

(integer/array) Returns either:

  • 一个数组对象

  • 查看对象的个数,如果countOutput参数被使用

示例如下

通过ID查看一个聚合图形

搜索所有的数据关于聚合图形ID是26和他的聚合图形项

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "screen.get",
  4. "params": {
  5. "output": "extend",
  6. "selectScreenItems": "extend",
  7. "selectUsers": "extend",
  8. "selectUserGroups": "extend",
  9. "screenids": "26"
  10. },
  11. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  12. "id": 1
  13. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": [
  4. {
  5. "screenitems": [
  6. {
  7. "screenitemid": "67",
  8. "screenid": "26",
  9. "resourcetype": "0",
  10. "resourceid": "612",
  11. "width": "320",
  12. "height": "200",
  13. "x": "0",
  14. "y": "0",
  15. "colspan": "0",
  16. "rowspan": "0",
  17. "elements": "25",
  18. "valign": "0",
  19. "halign": "0",
  20. "style": "0",
  21. "url": "",
  22. "dynamic": "0",
  23. "sort_triggers": "0"
  24. }
  25. ],
  26. "users": [
  27. {
  28. "sysmapuserid": "1",
  29. "userid": "2",
  30. "permission": "2"
  31. }
  32. ],
  33. "userGroups": [
  34. {
  35. "screenusrgrpid": "1",
  36. "usrgrpid": "7",
  37. "permission": "3"
  38. }
  39. ],
  40. "screenid": "26",
  41. "name": "CPU Graphs",
  42. "hsize": "3",
  43. "vsize": "2",
  44. "templateid": "0",
  45. "userid": "1",
  46. "private": "1"
  47. }
  48. ],
  49. "id": 1
  50. }

See also

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