这是原厂英文文档的翻译页面. 欢迎帮助我们 完善文档.

获取

描述

integer/array screen.get(object parameters)

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

参数

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

此方法支持以下参数

Parameter Type Description
screenids string/array 返回所给ID // (单个或者多个) // 的聚合图形。
userids string/array 返回所给用户ID // (单个或者多个) // 的聚合图形。
screenitemids string/array 返回所给聚合图形项的的聚合图形。
selectUsers query 返回users属性中与聚合图形共享的用户。
selectUserGroups query 返回userGroups属性中与聚合图形共享的用户组。
selectScreenItems query 返回聚合图形上使用的聚合图形项。
sortfield string/array 根据所给参数对结果进行排序

可能的值:screenidname
countOutput boolean 这个参数通用与所有的get方法,详细描述在reference commentary
editable boolean
excludeSearch boolean
filter object
limit integer
output query
preservekeys boolean
search object
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch boolean

返回值

(integer/array) Returns either:

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

示例如下

通过ID查看一个聚合图形

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

Request:

{
           "jsonrpc": "2.0",
           "method": "screen.get",
           "params": {
               "output": "extend",
               "selectScreenItems": "extend",
               "selectUsers": "extend",
               "selectUserGroups": "extend",
               "screenids": "26"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": [    
               {
                   "screenitems": [
                       {
                           "screenitemid": "67",
                           "screenid": "26",
                           "resourcetype": "0",
                           "resourceid": "612",
                           "width": "320",
                           "height": "200",
                           "x": "0",
                           "y": "0",
                           "colspan": "0",
                           "rowspan": "0",
                           "elements": "25",
                           "valign": "0",
                           "halign": "0",
                           "style": "0",
                           "url": "",
                           "dynamic": "0",
                           "sort_triggers": "0"
                       }
                   ],
                   "users": [
                       {
                           "sysmapuserid": "1",
                           "userid": "2",
                           "permission": "2"
                       }
                   ],
                   "userGroups": [
                       {
                           "screenusrgrpid": "1",
                           "usrgrpid": "7",
                           "permission": "3"
                       }
                   ],
                   "screenid": "26",
                   "name": "CPU Graphs",
                   "hsize": "3",
                   "vsize": "2",
                   "templateid": "0",
                   "userid": "1",
                   "private": "1"
               }
           ],
           "id": 1
       }

See also

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