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

    1. {
    2. "jsonrpc": "2.0",
    3. "result": [
    4. {
    5. "graphid": "612",
    6. "name": "CPU jumps",
    7. "width": "900",
    8. "height": "200",
    9. "yaxismin": "0.0000",
    10. "yaxismax": "100.0000",
    11. "templateid": "439",
    12. "show_work_period": "1",
    13. "show_triggers": "1",
    14. "graphtype": "0",
    15. "show_legend": "1",
    16. "show_3d": "0",
    17. "percent_left": "0.0000",
    18. "percent_right": "0.0000",
    19. "ymin_type": "0",
    20. "ymax_type": "0",
    21. "ymin_itemid": "0",
    22. "ymax_itemid": "0",
    23. "flags": "0"
    24. },
    25. {
    26. "name": "CPU load",
    27. "width": "900",
    28. "height": "200",
    29. "yaxismin": "0.0000",
    30. "yaxismax": "100.0000",
    31. "templateid": "433",
    32. "show_work_period": "1",
    33. "show_triggers": "1",
    34. "graphtype": "0",
    35. "show_legend": "1",
    36. "show_3d": "0",
    37. "percent_left": "0.0000",
    38. "percent_right": "0.0000",
    39. "ymin_type": "1",
    40. "ymax_type": "0",
    41. "ymin_itemid": "0",
    42. "ymax_itemid": "0",
    43. "flags": "0"
    44. },
    45. {
    46. "graphid": "614",
    47. "name": "CPU utilization",
    48. "width": "900",
    49. "height": "200",
    50. "yaxismin": "0.0000",
    51. "yaxismax": "100.0000",
    52. "templateid": "387",
    53. "show_work_period": "1",
    54. "show_triggers": "0",
    55. "graphtype": "1",
    56. "show_legend": "1",
    57. "show_3d": "0",
    58. "percent_left": "0.0000",
    59. "percent_right": "0.0000",
    60. "ymax_type": "1",
    61. "ymin_itemid": "0",
    62. "ymax_itemid": "0",
    63. "flags": "0"
    64. },
    65. {
    66. "graphid": "645",
    67. "name": "Disk space usage /",
    68. "width": "600",
    69. "height": "340",
    70. "yaxismin": "0.0000",
    71. "yaxismax": "0.0000",
    72. "templateid": "0",
    73. "show_work_period": "0",
    74. "show_triggers": "0",
    75. "graphtype": "2",
    76. "show_legend": "1",
    77. "show_3d": "1",
    78. "percent_left": "0.0000",
    79. "percent_right": "0.0000",
    80. "ymin_type": "0",
    81. "ymax_type": "0",
    82. "ymin_itemid": "0",
    83. "ymax_itemid": "0",
    84. "flags": "4"
    85. }
    86. ],
    87. "id": 1
    88. }

    Source来源

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