graphprototype.update

Description

描述

object graphprototype.update(object/array graphPrototypes) 对象 graphprototype.update(object/array graphPrototypes)

This method allows to update existing graph prototypes. 此方法用于更新已存在的图形原型。

Parameters

参数

(object/array) Graph prototype properties to be updated. (对象/数组) 需要更新的图形原型.

The graphid property must be defined for each graph prototype, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged. graphid 属性必须定义,其它属性均为可选。只有被传递的属性会被更新,其它都会保持不变。

Additionally to the standard graph prototype properties, the method accepts the following parameters. 除了 标准图形原型属性外,此方法还接受以下参数:

ParameterTypeDescription
gitemsarrayGraph items to replace existing graph items. If a graph item has the gitemid property defined it will be updated, otherwise a new graph item will be created.
参数 类描述
gitemsarray用于替换现有图形监控项的图形监控项. 如果图表项定义了 gitemid 属性,它将被更新,否则将创建一个新的图形监控项.

Return values

返回值

(object) Returns an object containing the IDs of the updated graph prototypes under the graphids property. (对象)graphids 属性下,返回一个已更新的图形原型的对象的ID。

Examples

例子

Changing the size of a graph prototype

更新图形原型大小

Change the size of a graph prototype to 1100 to 400 pixels. 将图形原型的大小从1100更新为400(单位:像素)

Request: 请求:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "graphprototype.update",
  4. "params": {
  5. "graphid": "439",
  6. "width": 1100,
  7. "height": 400
  8. },
  9. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  10. "id": 1
  11. }

Response: 响应:

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

Source

来源

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