object graph.create(object/array graphs)
此方法允许创建新的图表。
此方法只有 Admin(管理员) 和 Super admin(超级管理员)用户可用。可以在用户角色设置中撤销调用该方法的权限。参见用户角色 了解更多信息。
(object/array) 要创建的图表。
除了标准图表属性之外,该方法还接受以下参数。
(object)返回一个对象,包含在graphids属性下创建的图表的ID。返回的ID的顺序与传递的图表的顺序相匹配。
创建一个具有两个监控项的图表。
请求:
{ "jsonrpc": "2.0", "method": "graph.create", "params": { "name": "MySQL bandwidth", "width": 900, "height": 200, "gitems": [ { "itemid": "22828", "color": "00AA00" }, { "itemid": "22829", "color": "3333FF" } ] }, "id": 1 }响应:
ui/include/classes/api/services/CGraph.php 中的 CGraph::create()。