dashboard.get

Apraksts

integer/array dashboard.get(object parameters)

Metode ļauj izgūt paneļus atbilstoši norādītajiem parametriem.

Šī metode ir pieejama jebkura tipa lietotājiem. Atļaujas izsaukt šo metodi var tikt atsauktas lietotāja lomas iestatījumos. Plašāku informāciju skatiet Lietotāju lomas.

Parametri

(object) Parametri, kas nosaka vēlamo izvadi.

Metode atbalsta šādus parametrus.

Parametrs Tips Apraksts
dashboardids ID/array Atgriezt tikai paneļus ar norādītajiem ID.
selectPages query Atgriezt pages īpašību ar paneļa lapām pareizā secībā.
selectUsers query Atgriezt users īpašību ar lietotājiem, ar kuriem panelis ir koplietots.
selectUserGroups query Atgriezt userGroups īpašību ar lietotāju grupām, ar kurām panelis ir koplietots.
sortfield string/array Kārtot rezultātu pēc norādītajām īpašībām.

Iespējamās vērtības: dashboardid.
countOutput boolean Šie parametri ir aprakstīti atsauces komentārā.
editable boolean
excludeSearch boolean
filter object
limit integer
output query
preservekeys boolean
search object
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch boolean

Atgrieztās vērtības

(integer/array) Atgriež vienu no šīm vērtībām:

  • objektu masīvu;
  • izgūto objektu skaitu, ja ir izmantots parametrs countOutput.

Piemēri

Informācijas izgūšana par paneli pēc ID

Izgūstiet visus datus par paneļiem "1" un "2".

Pieprasījums:

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

Atbilde:

{
    "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": "18",
                            "height": "4",
                            "view_mode": "0",
                            "fields": []
                        },
                        {
                            "widgetid": "5",
                            "type": "web",
                            "name": "",
                            "x": "0",
                            "y": "9",
                            "width": "18",
                            "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": "12",
                            "height": "3",
                            "view_mode": "0",
                            "fields": []
                        },
                        {
                            "widgetid": "1",
                            "type": "favgraphs",
                            "name": "",
                            "x": "0",
                            "y": "0",
                            "width": "12",
                            "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
}

Skatiet arī

Avots

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