获取

Description 描述

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

The method allows to retrieve screens according to the given parameters. 此方法允许搜索符合所给参数的聚合图形

Parameters 参数

(object) Parameters defining the desired output. (object) 定义所需输出的参数。

The method supports the following parameters. 此方法支持以下参数

ParameterTypeDescription
screenidsstring/arrayReturn only screens with the given IDs. 返回所给IDs的聚合图形
useridsstring/arrayReturn only screens that belong to the given user IDs. 返回所给用户IDs的聚合图形
screenitemidsstring/arrayReturn only screen that contain the given screen items. 返回所给聚合图形项的的聚合图形
selectUsersqueryReturns users that the screen is shared with in users property. 返回users属性中与聚合图形共享的用户。
selectUserGroupsqueryReturns user groups that the screen is shared with in userGroups property. 返回userGroups属性中与聚合图形共享的用户组。
selectScreenItemsqueryReturn the screen items that are used in the screen. 返回聚合图形上使用的聚合图形项。
sortfieldstring/arraySort the result by the given properties.

Possible values are: screenid and name. 根据所给参数对结果进行排序

可能的值:screenidname
countOutputbooleanThese parameters being common for all get methods are described in detail in the reference commentary page. 这个参数通用与所有的get方法,详细描述在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.

  • 一个数组对象

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

Examples 示例如下

Retrieving a screen by ID 通过ID查看一个聚合图形

Retrieve all data about screen “26” and its screen items. 搜索所有的数据关于聚合图形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

Source

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