On this page
templatedashboard.get
Descrizione
integer/array templatedashboard.get(object parameters)
Il metodo consente di recuperare i dashboard del template in base ai parametri specificati.
Questo metodo è disponibile per utenti di qualsiasi tipo. Le autorizzazioni per richiamare il metodo possono essere revocate nelle impostazioni dei ruoli utente. Vedere Ruoli utente per ulteriori informazioni.
Parametri
(object) Parametri che definiscono l'output desiderato.
Il metodo supporta i seguenti parametri.
| Parametro | Type | Descrizione |
|---|---|---|
| dashboardids | ID/array | Restituisce solo i dashboard di template con gli ID specificati. |
| templateids | ID/array | Restituisce solo i dashboard di template che appartengono ai template specificati. |
| selectPages | query | Restituisce una proprietà pages con le pagine del dashboard di template, ordinate correttamente. |
| sortfield | string/array | Ordina il risultato in base alle proprietà specificate. Valori possibili: dashboardid, name. |
| countOutput | boolean | Questi parametri sono descritti nel commento di riferimento. |
| editable | boolean | |
| excludeSearch | boolean | |
| filter | object | |
| limit | integer | |
| output | query | |
| preservekeys | boolean | |
| search | object | |
| searchByAny | boolean | |
| searchWildcardsEnabled | boolean | |
| sortorder | string/array | |
| startSearch | boolean |
Valori restituiti
(integer/array) Restituisce o:
- una matrice di oggetti;
- il conteggio degli oggetti recuperati, se il parametro
countOutputè stato usato.
Esempi
Recupero delle dashboard del template
Recupera tutte le dashboard del template con i widget per un template specificato.
{
"jsonrpc": "2.0",
"method": "templatedashboard.get",
"params": {
"output": "extend",
"selectPages": "extend",
"templateids": "10001"
},
"id": 1
}
Risposta:
{
"jsonrpc": "2.0",
"result": [
{
"dashboardid": "23",
"name": "Docker overview",
"templateid": "10001",
"display_period": "30",
"auto_start": "1",
"uuid": "6dfcbe0bc5ad400ea9c1c2dd7649282f",
"pages": [
{
"dashboard_pageid": "1",
"name": "",
"display_period": "0",
"widgets": [
{
"widgetid": "220",
"type": "graph",
"name": "",
"x": "0",
"y": "0",
"width": "36",
"height": "5",
"view_mode": "0",
"fields": [
{
"type": "6",
"name": "graphid",
"value": "1125"
}
]
},
{
"widgetid": "221",
"type": "graph",
"name": "",
"x": "12",
"y": "0",
"width": "36",
"height": "5",
"view_mode": "0",
"fields": [
{
"type": "6",
"name": "graphid",
"value": "1129"
}
]
},
{
"widgetid": "222",
"type": "graph",
"name": "",
"x": "0",
"y": "5",
"width": "36",
"height": "5",
"view_mode": "0",
"fields": [
{
"type": "6",
"name": "graphid",
"value": "1128"
}
]
},
{
"widgetid": "223",
"type": "graph",
"name": "",
"x": "12",
"y": "5",
"width": "36",
"height": "5",
"view_mode": "0",
"fields": [
{
"type": "6",
"name": "graphid",
"value": "1126"
}
]
},
{
"widgetid": "224",
"type": "graph",
"name": "",
"x": "0",
"y": "10",
"width": "36",
"height": "5",
"view_mode": "0",
"fields": [
{
"type": "6",
"name": "graphid",
"value": "1127"
}
]
}
]
}
]
}
],
"id": 1
}
Vedi anche
- Pagina della dashboard del template
- Widget della dashboard del template
- Campo del widget della dashboard del template
Fonte
CTemplateDashboard::get() in ui/include/classes/api/services/CTemplateDashboard.php.