The method allows to retrieve graphs according to the given parameters.此方法允许根据给定的参数返回图形
Parameters参数
(object)
Parameters defining the desired output.(对象)
参数定义需要的输出。
The method supports the following parameters.此方法支持如下参数
(integer整数/array数组)
Returns either返回两个中的一个:
the count of retrieved objects, if the parameter has been used.如果
countOutput
参数被使用,将对检索到的对象进行计数。
Examples示例
Retrieving graphs from hosts获取主机的所有图像
Retrieve all graphs from host “10107” and sort them by name.获取所有主机“10107”所有图形并对他们按名称排列。
Request请求:
Response响应:
- {
- "jsonrpc": "2.0",
- "result": [
- {
- "graphid": "612",
- "name": "CPU jumps",
- "width": "900",
- "height": "200",
- "yaxismin": "0.0000",
- "yaxismax": "100.0000",
- "templateid": "439",
- "show_work_period": "1",
- "show_triggers": "1",
- "graphtype": "0",
- "show_legend": "1",
- "show_3d": "0",
- "percent_left": "0.0000",
- "percent_right": "0.0000",
- "ymin_type": "0",
- "ymax_type": "0",
- "ymin_itemid": "0",
- "ymax_itemid": "0",
- "flags": "0"
- },
- {
- "name": "CPU load",
- "width": "900",
- "height": "200",
- "yaxismin": "0.0000",
- "yaxismax": "100.0000",
- "templateid": "433",
- "show_work_period": "1",
- "show_triggers": "1",
- "graphtype": "0",
- "show_legend": "1",
- "show_3d": "0",
- "percent_left": "0.0000",
- "percent_right": "0.0000",
- "ymin_type": "1",
- "ymax_type": "0",
- "ymin_itemid": "0",
- "ymax_itemid": "0",
- "flags": "0"
- },
- {
- "graphid": "614",
- "name": "CPU utilization",
- "width": "900",
- "height": "200",
- "yaxismin": "0.0000",
- "yaxismax": "100.0000",
- "templateid": "387",
- "show_work_period": "1",
- "show_triggers": "0",
- "graphtype": "1",
- "show_legend": "1",
- "show_3d": "0",
- "percent_left": "0.0000",
- "percent_right": "0.0000",
- "ymax_type": "1",
- "ymin_itemid": "0",
- "ymax_itemid": "0",
- "flags": "0"
- },
- {
- "graphid": "645",
- "name": "Disk space usage /",
- "width": "600",
- "height": "340",
- "yaxismin": "0.0000",
- "yaxismax": "0.0000",
- "templateid": "0",
- "show_work_period": "0",
- "show_triggers": "0",
- "graphtype": "2",
- "show_legend": "1",
- "show_3d": "1",
- "percent_left": "0.0000",
- "percent_right": "0.0000",
- "ymin_type": "0",
- "ymax_type": "0",
- "ymin_itemid": "0",
- "ymax_itemid": "0",
- "flags": "4"
- }
- ],
- "id": 1
- }
Source来源
CGraph::get() in frontends/php/include/classes/api/services/CGraph.php.