描述

    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. 此方法支持以下参数:

    参数类型描述
    discoveryidsstring/array仅返回属于给定自动发现规则的图形原型.
    graphidsstring/array仅返回含有给定ID的图形原型.
    groupidsstring/array仅返回属于给定主机组的主机的图形原型.
    hostidsstring/array仅返回属于给定主机的图形原型.
    inheritedboolean如果设置此参数为 true ,则仅返回从模板继承的图形原型.
    itemidsstring/array仅返回包含给定监控项原型的图形原型.
    templatedboolean如果设置此参数为 true ,则仅返回属于模板的图形原型.
    templateidsstring/array仅返回属于给定模板的图形原型.
    selectDiscoveryRulequerydiscoveryRule 属性下,返回图形原型所属的低级别发现规则.
    selectGraphItemsquery在 属性下,返回在图形原型中使用的图表监控项.
    selectGroupsquerygroups 属性下,返回图形原型所属的主机组.
    selectHostsqueryhosts 属性下,返回图形原型所属的主机.
    selectItemsqueryitems 属性下,返回在图形原型中使用的监控项以及监控项原型.
    selectTemplatesquerytemplates 属性下,返回图形原型所属的模板.
    filterobject仅返回精确匹配给定过滤器的结果.

    接受一个数组,其中键是属性名称,值是单个值或要匹配的值的数组.

    支持的额外的过滤器:
    host - 图型原型所属主机的技术名称.
    hostid - 图形原型所属主机的ID.
    sortfieldstring/array根据给定属性对结果进行排序.

    可能值: graphid, name 以及 graphtype.
    countOutputboolean以下参数为 get 方法通常参数,在有详细说明…
    editableboolean
    excludeSearchboolean
    limitinteger
    outputquery
    preservekeysboolean
    searchobject
    searchByAnyboolean
    searchWildcardsEnabledboolean
    sortorderstring/array
    startSearchboolean

    返回值

    (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: 响应:

    1. "jsonrpc": "2.0",
    2. "result": [
    3. {
    4. "graphid": "1017",
    5. "parent_itemid": "27426",
    6. "width": "600",
    7. "height": "340",
    8. "yaxismin": "0.0000",
    9. "yaxismax": "0.0000",
    10. "templateid": "442",
    11. "show_work_period": "0",
    12. "show_triggers": "0",
    13. "graphtype": "2",
    14. "show_legend": "1",
    15. "show_3d": "1",
    16. "percent_left": "0.0000",
    17. "percent_right": "0.0000",
    18. "ymax_type": "0",
    19. "ymin_itemid": "0",
    20. "ymax_itemid": "0"
    21. }
    22. ],
    23. "id": 1
    24. }

    参考

    Source

    来源

    CGraphPrototype::get() in frontends/php/include/classes/api/services/CGraphPrototype.php.