描述
The method allows to retrieve graph prototypes according to the given parameters. 此方法用于根据给定的参数来获取图形原型
Parameters
参数
(object)
Parameters defining the desired output. (对象)
定义所需输出的参数.
The method supports the following parameters. 此方法支持以下参数:
参数 | 类型 | 描述 |
---|---|---|
discoveryids | string/array | 仅返回属于给定自动发现规则的图形原型. |
graphids | string/array | 仅返回含有给定ID的图形原型. |
groupids | string/array | 仅返回属于给定主机组的主机的图形原型. |
hostids | string/array | 仅返回属于给定主机的图形原型. |
inherited | boolean | 如果设置此参数为 true ,则仅返回从模板继承的图形原型. |
itemids | string/array | 仅返回包含给定监控项原型的图形原型. |
templated | boolean | 如果设置此参数为 true ,则仅返回属于模板的图形原型. |
templateids | string/array | 仅返回属于给定模板的图形原型. |
selectDiscoveryRule | query | 在 discoveryRule 属性下,返回图形原型所属的低级别发现规则. |
selectGraphItems | query | 在 属性下,返回在图形原型中使用的图表监控项. |
selectGroups | query | 在 groups 属性下,返回图形原型所属的主机组. |
selectHosts | query | 在 hosts 属性下,返回图形原型所属的主机. |
selectItems | query | 在 items 属性下,返回在图形原型中使用的监控项以及监控项原型. |
selectTemplates | query | 在 templates 属性下,返回图形原型所属的模板. |
filter | object | 仅返回精确匹配给定过滤器的结果. 接受一个数组,其中键是属性名称,值是单个值或要匹配的值的数组. 支持的额外的过滤器: host - 图型原型所属主机的技术名称.hostid - 图形原型所属主机的ID. |
sortfield | string/array | 根据给定属性对结果进行排序. 可能值: graphid , name 以及 graphtype . |
countOutput | boolean | 以下参数为 get 方法通常参数,在参考注释有详细说明… |
editable | boolean | |
excludeSearch | boolean | |
limit | integer | |
output | query | |
preservekeys | boolean | |
search | object | |
searchByAny | boolean | |
searchWildcardsEnabled | boolean | |
sortorder | string/array | |
startSearch | boolean |
返回值
(integer/array)
Returns either:
an array of objects;
the count of retrieved objects, if the
countOutput
parameter has been used.
(整数/数组)
返回:
如果使用了
countOutput
参数,返回获取的对象的数量..
Examples
例子
Retrieving graph prototypes from a LLD rule
从低级别发现规则获取图形原型
Retrieve all graph prototypes from an LLD rule. 从低级别发现规则获取所有图形原型。
Request: 请求:
Response: 响应:
"jsonrpc": "2.0",
"result": [
{
"graphid": "1017",
"parent_itemid": "27426",
"width": "600",
"height": "340",
"yaxismin": "0.0000",
"yaxismax": "0.0000",
"templateid": "442",
"show_work_period": "0",
"show_triggers": "0",
"graphtype": "2",
"show_legend": "1",
"show_3d": "1",
"percent_left": "0.0000",
"percent_right": "0.0000",
"ymax_type": "0",
"ymin_itemid": "0",
"ymax_itemid": "0"
}
],
"id": 1
}
参考
Source
来源
CGraphPrototype::get() in frontends/php/include/classes/api/services/CGraphPrototype.php.