对象 graph.create(object/array graphs)
此方法用于创建新的图表。
(对象)
在 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" } ] }, "auth": "038e1d7b1735c6a5436ee9eae095879e", "id": 1 }
响应:
{ "jsonrpc": "2.0", "result": { "graphids": [ "652" ] }, "id": 1 }
CGraph::create() in frontends/php/include/classes/api/services/CGraph.php.