templatedashboard.get

説明

integer/array templatedashboard.get(object parameters)

このメソッドは、指定されたパラメータに従ってテンプレートダッシュボードを取得することができます。

このメソッドは、すべての種類のユーザーが利用できます。メソッドの呼び出し権限はユーザーロールの設定で取り消すことができます。詳細はユーザーロールを参照してください。

パラメーター

(object) 望ましい出力を定義するパラメーター。

このメソッドは以下のパラメーターをサポートします。

パラメーター 説明
dashboardids ID/array 指定したIDのテンプレートダッシュボードのみを返します。
templateids ID/array 指定したテンプレートに属するテンプレートダッシュボードのみを返します。
selectPages query テンプレートダッシュボードページを正しい順序で持つpagesプロパティを返します。
sortfield string/array 指定したプロパティで結果をソートします。

可能な値: dashboardid, name
countOutput boolean これらのパラメーターはリファレンス解説で説明されています。
editable boolean
excludeSearch boolean
filter object
limit integer
output query
preservekeys boolean
search object
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch boolean

戻り値

(integer/array) 次のいずれかを返します:

  • オブジェクトの配列
  • countOutputパラメータが使用されている場合、取得されたオブジェクトの数

テンプレートダッシュボードの取得

指定したテンプレートのウィジェット付きテンプレートダッシュボードをすべて取得します。

リクエスト:

{
    "jsonrpc": "2.0",
    "method": "templatedashboard.get",
    "params": {
        "output": "extend",
        "selectPages": "extend",
        "templateids": "10001"
    },
    "id": 1
}

レスポンス:

{
    "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
}

参照

ソース

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