dashboard.get

Beschrijving

integer/array dashboard.get(objectparameters)

De methode maakt het mogelijk om dashboards op te halen volgens de gegeven parameters.

Deze methode is beschikbaar voor gebruikers van elk type. Rechten om de methode aan te roepen, kunnen worden ingetrokken in de instellingen van de gebruikersrol. Zie Gebruiker rollen voor meer informatie.

Parameters

(object) Parameters die de gewenste uitvoer definiëren.

De methode ondersteunt de volgende parameters.

|Parameter|Type|Beschrijving| |---------|--------------------------------------- ------------|-----------| |dashboardids|string/array|Retourneer alleen dashboards met de opgegeven ID's.| |selectPages|query|Retourneer een pages eigenschap met dashboardpagina's, correct geordend.| |selectUsers|query|Retourneer een eigenschap users met gebruikers met wie het dashboard is gedeeld.| |selectUserGroups|query|Retourneer een eigenschap userGroups met gebruikersgroepen waarmee het dashboard wordt gedeeld.| |sortfield|string/array|Sorteer het resultaat op de gegeven eigenschappen.

Mogelijke waarde is: dashboardid.| |countOutput|boolean|Deze parameters gelden voor alle get-methoden en worden in detail beschreven op de pagina referentiecommentaar.| |editable|booleaans|^| |excludeSearch|boolean|^| |filter|object|^| |limit|geheel getal|^| |output|query|^| |preservekeys|boolean|^| |search|object|^| |searchByAny|boolean|^| |searchWildcardsEnabled|boolean|^| |sortorder|string/array|^| |startSearch|booleaans|^|

Retourwaarden

(integer/array) Retourneert ofwel:

  • een reeks objecten;
  • het aantal opgehaalde objecten, als de parameter countOutput is gebruikt.

Voorbeelden

Ophalen van dashboards via ID

Haal alle data van dashboard "1" en "2" op.

Verzoek:

{
           "jsonrpc": "2.0",
           "method": "dashboard.get",
           "params": {
               "output": "extend",
               "selectPages": "extend",
               "selectUsers": "extend",
               "selectUserGroups": "extend",
               "dashboardids": [
                   "1",
                   "2"
               ]
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Antwoord:

{
           "jsonrpc": "2.0",
           "result": [
               {
                   "dashboardid": "1",
                   "name": "Dashboard",
                   "userid": "1",
                   "private": "0",
                   "display_period": "30",
                   "auto_start": "1",
                   "users": [],
                   "userGroups": [],
                   "pages": [
                       {
                           "dashboard_pageid": "1",
                           "name": "",
                           "display_period": "0",
                           "widgets": [
                               {
                                   "widgetid": "9",
                                   "type": "systeminfo",
                                   "name": "",
                                   "x": "12",
                                   "y": "8",
                                   "width": "12",
                                   "height": "5",
                                   "view_mode": "0",
                                   "fields": []
                               },
                               {
                                   "widgetid": "8",
                                   "type": "problemsbysv",
                                   "name": "",
                                   "x": "12",
                                   "y": "4",
                                   "width": "12",
                                   "height": "4",
                                   "view_mode": "0",
                                   "fields": []
                               },
                               {
                                   "widgetid": "7",
                                   "type": "problemhosts",
                                   "name": "",
                                   "x": "12",
                                   "y": "0",
                                   "width": "12",
                                   "height": "4",
                                   "view_mode": "0",
                                   "fields": []
                               },
                               {
                                   "widgetid": "6",
                                   "type": "discovery",
                                   "name": "",
                                   "x": "6",
                                   "y": "9",
                                   "width": "6",
                                   "height": "4",
                                   "view_mode": "0",
                                   "fields": []
                               },
                               {
                                   "widgetid": "5",
                                   "type": "web",
                                   "name": "",
                                   "x": "0",
                                   "y": "9",
                                   "width": "6",
                                   "height": "4",
                                   "view_mode": "0",
                                   "fields": []
                               },
                               {
                                   "widgetid": "4",
                                   "type": "problems",
                                   "name": "",
                                   "x": "0",
                                   "y": "3",
                                   "width": "12",
                                   "height": "6",
                                   "view_mode": "0",
                                   "fields": []
                               },
                               {
                                   "widgetid": "3",
                                   "type": "favmaps",
                                   "name": "",
                                   "x": "8",
                                   "y": "0",
                                   "width": "4",
                                   "height": "3",
                                   "view_mode": "0",
                                   "fields": []
                               },
                               {
                                   "widgetid": "1",
                                   "type": "favgraphs",
                                   "name": "",
                                   "x": "0",
                                   "y": "0",
                                   "width": "4",
                                   "height": "3",
                                   "view_mode": "0",
                                   "fields": []
                               }
                           ]
                       },
                       {
                           "dashboard_pageid": "2",
                           "name": "",
                           "display_period": "0",
                           "widgets": []
                       },
                       {
                           "dashboard_pageid": "3",
                           "name": "Custom page name",
                           "display_period": "60",
                           "widgets": []
                       }
                   ]
               },
               {
                   "dashboardid": "2",
                   "name": "My dashboard",
                   "userid": "1",
                   "private": "1",
                   "display_period": "60",
                   "auto_start": "1",
                   "users": [
                       {
                           "userid": "4",
                           "permission": "3"
                       }
                   ],
                   "userGroups": [
                       {
                           "usrgrpid": "7",
                           "permission": "2"
                       }
                   ],
                   "pages": [
                       {
                           "dashboard_pageid": "4",
                           "name": "",
                           "display_period": "0",
                           "widgets": [
                               {
                                   "widgetid": "10",
                                   "type": "problems",
                                   "name": "",
                                   "x": "0",
                                   "y": "0",
                                   "width": "12",
                                   "height": "5",
                                   "view_mode": "0",
                                   "fields": [
                                       {
                                           "type": "2",
                                           "name": "groupids",
                                           "value": "4"
                                       }
                                   ]
                               }
                           ]
                       }
                   ]
               }
           ],
           "id": 1
       }

Zie ook

Bron

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