object graph.create(object/array graphs)
This method allows to create new graphs.
This method is only available to Admin and Super admin user types. Permissions to call the method can be revoked in user role settings. See User roles for more information.
(object/array)
Graphs to create.
Additionally to the standard graph properties, the method accepts the following parameters.
Parameter | Type | Description |
---|---|---|
gitems | array | Graph items to be created for the graph. Parameter behavior: - required |
(object)
Returns an object containing the IDs of the created graphs under the graphids
property. The order of the returned IDs matches the order of the passed graphs.
Create a graph with two items.
{
"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
}
Response:
CGraph::create() in ui/include/classes/api/services/CGraph.php.