更新

Description 说明

object templatescreen.update(object/array **templateScreens**)

This method allows to update existing template screens. 此方法允许更新现有的聚合图形模板。

Parameters 参数

(object/array) Template screen properties to be updated. (object/array)需要更新的聚合图形模板属性。 The screenid property must be defined for each template screen, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged. 必须为每个聚合图形模板定义screenid属性,所有其他属性为可选项。只有通过的属性会被更新,所有其他属性将保持不变。 Additionally to the standard template screen properties, the method accepts the following parameters. 除standard template screen properties之外,该方法接受以下参数。

Parameter 参数Type 类型Description 说明
screenitemsarray 数组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. 聚合图形项通过坐标轴更新,因此每个聚合图形项必须定义xy属性。

Return values 返回值

(object) Returns an object containing the IDs of the updated template screens under the screenids property. (object)返回一个对象,该对象包含在screenids属性中已更新聚合图形模板的ID。

Examples 范例

Rename a template screen 重命名聚合图形模板

Rename the template screen to “Performance graphs”. 将聚合图形模板重命名为“Performance graphs”。

Request 请求:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "templatescreen.update",
  4. "params": {
  5. "screenid": "3",
  6. "name": "Performance graphs"
  7. },
  8. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  9. "id": 1
  10. }

Response 响应:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "screenids": [
  5. "3"
  6. ]
  7. },
  8. "id": 1
  9. }

Source 源码

CTemplateScreen::update() in frontends/php/include/classes/api/services/CTemplateScreen.php. CTemplateScreen::update()方法可在frontends/php/include/classes/api/services/CTemplateScreen.php中参考。