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.
selectWidgetsqueryReturn a widgets property containing template dashboard widgets.
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. "selectWidgets": "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. "widgets": [
  9. {
  10. "widgetid": "220",
  11. "type": "graph",
  12. "name": "",
  13. "x": "0",
  14. "y": "0",
  15. "width": "12",
  16. "height": "5",
  17. "view_mode": "0",
  18. "fields": [
  19. {
  20. "type": "6",
  21. "name": "graphid",
  22. "value": "1125"
  23. }
  24. ]
  25. },
  26. {
  27. "widgetid": "221",
  28. "type": "graph",
  29. "name": "",
  30. "x": "12",
  31. "y": "0",
  32. "width": "12",
  33. "height": "5",
  34. "view_mode": "0",
  35. "fields": [
  36. {
  37. "type": "6",
  38. "name": "graphid",
  39. "value": "1129"
  40. }
  41. ]
  42. },
  43. {
  44. "widgetid": "222",
  45. "type": "graph",
  46. "name": "",
  47. "x": "0",
  48. "y": "5",
  49. "width": "12",
  50. "height": "5",
  51. "view_mode": "0",
  52. "fields": [
  53. {
  54. "type": "6",
  55. "name": "graphid",
  56. "value": "1128"
  57. }
  58. ]
  59. },
  60. {
  61. "widgetid": "223",
  62. "type": "graph",
  63. "name": "",
  64. "x": "12",
  65. "y": "5",
  66. "width": "12",
  67. "height": "5",
  68. "view_mode": "0",
  69. "fields": [
  70. {
  71. "type": "6",
  72. "name": "graphid",
  73. "value": "1126"
  74. }
  75. ]
  76. },
  77. {
  78. "widgetid": "224",
  79. "type": "graph",
  80. "name": "",
  81. "x": "0",
  82. "y": "10",
  83. "width": "12",
  84. "height": "5",
  85. "view_mode": "0",
  86. "fields": [
  87. {
  88. "type": "6",
  89. "name": "graphid",
  90. "value": "1127"
  91. }
  92. ]
  93. }
  94. ]
  95. }
  96. ],
  97. "id": 1
  98. }

Source

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