更新

Description 描述

object screen.update(object/array screens)

This method allows to update existing screens. 此方法允许更新已存在的聚合图形

Parameters 参数

(object/array) Screen properties to be updated. (object/array) 聚合图形参数将被更新

The screenid property must be defined for each screen, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged. 每个聚合图形必须定义screenid参数,其他参数是可以选择的。仅传递的参数会被更新,其他的的参数将保持不变。

Additionally to the standard screen properties, the method accepts the following parameters. 此外standard screen properties,此方法接受以下参数

Parameter Type Description
screenitems array Screen items to replace existing screen items.

Screen items are updated by coordinates, so each screen item must have the x and y properties defined. 聚合图形项替换已存在的聚合图行项

聚合图形项通过坐标更新,所以每个聚合图形项必须拥定义x and y属性
users array Screen user shares to replace the existing elements. 聚合图形用户共享替换已存在的元素
userGroups array Screen user group shares to replace the existing elements. 聚合图形用户组共享替换已存在的元素

Return values 返回值

(object) Returns an object containing the IDs of the updated screens under the screenids property. (object) 返回一个对象,该对象包含screenids属性下更新聚合图形的id。

Examples 示例如下

Renaming a screen 重命名一个聚合图形

Rename a screen to "CPU Graphs". 重命名一个聚合图形为"CPU Graphs".

Request:

{
           "jsonrpc": "2.0",
           "method": "screen.update",
           "params": {
               "screenid": "26",
               "name": "CPU Graphs"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "screenids": [
                   "26"
               ]
           },
           "id": 1
       }

Change screen owner 改变聚合图形属主

Available only for admins and super admins. 仅仅适用于管理员和超级管理员

Request:

{
           "jsonrpc": "2.0",
           "method": "screen.update",
           "params": {
               "screenid": "83",
               "userid": "1"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 2
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "screenids": [
                   "83"
               ]
           },
           "id": 2
       }

See also

Source

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