This is the documentation page for an unsupported version of Zabbix.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

templatedashboard.create

Description

object templatedashboard.create(object/array templateDashboards)

This method allows to create new template dashboards.

This method is only available to Admin and Super admin user types. Permissions to call the method can be revoked in user role settings. See User roles for more information.

Parameters

(object/array) Template dashboards to create.

Additionally to the standard template dashboard properties, the method accepts the following parameters.

Parameter Type Description
pages
(required)
array Template dashboard pages to be created for the dashboard. Dashboard pages will be ordered in the same order as specified. At least one dashboard page object is required for pages property.

Valori di ritorno

(object) Restituisce un oggetto contenente gli ID del modello dashboard creato sotto la proprietà dashboardids. L'ordine degli ID restituiti corrisponde all'ordine dei modelli dashboard passati.

Esempi

Creating a template dashboard

Create a template dashboard named “Graphs” with one Graph widget on a single dashboard page.

Request:

{
           "jsonrpc": "2.0",
           "method": "templatedashboard.create",
           "params": {
               "templateid": "10318",
               "name": "Graphs",
               "pages": [
                   {
                       "widgets": [
                           {
                               "type": "graph",
                               "x": 0,
                               "y": 0,
                               "width": 12,
                               "height": 5,
                               "view_mode": 0,
                               "fields": [
                                   {
                                       "type": 6,
                                       "name": "graphid",
                                       "value": "1123"
                                   }
                               ]
                           }
                       ]
                       
                   }
               ]
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "dashboardids": [
                   "32"
               ]
           },
           "id": 1
       }

Guarda anche

Fonte

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