object graphprototype.create(object/array graphPrototypes)
This method allows to create new graph prototypes.
(object/array)
Graph prototypes to create.
Additionally to the standard graph prototype properties, the method accepts the following parameters.
(object)
Returns an object containing the IDs of the created graph prototypes under the graphids
property. The order of the returned IDs matches the order of the passed graph prototypes.
Create a graph prototype with two items.
Request:
{ "jsonrpc": "2.0", "method": "graphprototype.create", "params": { "name": "Disk space usage {#FSNAME}", "width": 900, "height": 200, "gitems": [ { "itemid": "22828", "color": "00AA00" }, { "itemid": "22829", "color": "3333FF" } ] }, "auth": "038e1d7b1735c6a5436ee9eae095879e", "id": 1 }
Response:
{ "jsonrpc": "2.0", "result": { "graphids": [ "652" ] }, "id": 1 }
CGraphPrototype::create() in ui/include/classes/api/services/CGraphPrototype.php.