templatedashboard.get

Description

integer/array templatedashboard.get(object parameters)

The method allows to retrieve template dashboards according to the given parameters.

This method is available to users of any type. Permissions to call the method can be revoked in user role settings. See User roles for more information.

Parameters

(object) Parameters defining the desired output.

The method supports the following parameters.

ParameterTypeDescription
dashboardidsstring/arrayReturn only template dashboards with the given IDs.
templateidsstring/araryReturn only template dashboards that belong to the given templates.
selectPagesqueryReturn a pages property with template dashboard pages, correctly ordered.
sortfieldstring/arraySort the result by the given properties.

Possible values are: dashboardid and name.
countOutputbooleanThese parameters being common for all get methods are described in detail in the reference commentary.
editableboolean
excludeSearchboolean
filterobject
limitinteger
outputquery
preservekeysboolean
searchobject
searchByAnyboolean
searchWildcardsEnabledboolean
sortorderstring/array
startSearchboolean

Return values

(integer/array) Returns either:

  • an array of objects;
  • the count of retrieved objects, if the countOutput parameter has been used.

Examples

Retrieving template dashboards

Retrieve all template dashboards with widgets for a specified template.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "templatedashboard.get",
  4. "params": {
  5. "output": "extend",
  6. "selectPages": "extend",
  7. "templateids": "10001"
  8. },
  9. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  10. "id": 1
  11. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": [
  4. {
  5. "dashboardid": "23",
  6. "name": "Docker overview",
  7. "templateid": "10001",
  8. "display_period": "30",
  9. "auto_start": "1",
  10. "uuid": "6dfcbe0bc5ad400ea9c1c2dd7649282f",
  11. "pages": [
  12. {
  13. "dashboard_pageid": "1",
  14. "name": "",
  15. "display_period": "0",
  16. "widgets": [
  17. {
  18. "widgetid": "220",
  19. "type": "graph",
  20. "name": "",
  21. "x": "0",
  22. "y": "0",
  23. "width": "12",
  24. "height": "5",
  25. "view_mode": "0",
  26. "fields": [
  27. {
  28. "type": "6",
  29. "name": "graphid",
  30. "value": "1125"
  31. }
  32. ]
  33. },
  34. {
  35. "widgetid": "221",
  36. "type": "graph",
  37. "name": "",
  38. "x": "12",
  39. "y": "0",
  40. "width": "12",
  41. "height": "5",
  42. "view_mode": "0",
  43. "fields": [
  44. {
  45. "type": "6",
  46. "name": "graphid",
  47. "value": "1129"
  48. }
  49. ]
  50. },
  51. {
  52. "widgetid": "222",
  53. "type": "graph",
  54. "name": "",
  55. "x": "0",
  56. "y": "5",
  57. "width": "12",
  58. "height": "5",
  59. "view_mode": "0",
  60. "fields": [
  61. {
  62. "type": "6",
  63. "name": "graphid",
  64. "value": "1128"
  65. }
  66. ]
  67. },
  68. {
  69. "widgetid": "223",
  70. "type": "graph",
  71. "name": "",
  72. "x": "12",
  73. "y": "5",
  74. "width": "12",
  75. "height": "5",
  76. "view_mode": "0",
  77. "fields": [
  78. {
  79. "type": "6",
  80. "name": "graphid",
  81. "value": "1126"
  82. }
  83. ]
  84. },
  85. {
  86. "widgetid": "224",
  87. "type": "graph",
  88. "name": "",
  89. "x": "0",
  90. "y": "10",
  91. "width": "12",
  92. "height": "5",
  93. "view_mode": "0",
  94. "fields": [
  95. {
  96. "type": "6",
  97. "name": "graphid",
  98. "value": "1127"
  99. }
  100. ]
  101. }
  102. ]
  103. }
  104. ]
  105. }
  106. ],
  107. "id": 1
  108. }

See also

Source

CTemplateDashboard::get() in ui/include/classes/api/services/CTemplateDashboard.php.