integer/array graphprototype.get(object parameters)
The method allows to retrieve graph prototypes according to the given parameters.
This method is available to users of any type. Permissions to call the method can be revoked in user role settings. See User roles for more information.
(object) Parameters defining the desired output.
The method supports the following parameters.
| Parameter | Type | Description | 
|---|---|---|
| discoveryids | ID/array | Return only graph prototypes that belong to the given discovery rules. | 
| graphids | ID/array | Return only graph prototypes with the given IDs. | 
| groupids | ID/array | Return only graph prototypes that belong to hosts or templates in the given host groups or template groups. | 
| hostids | ID/array | Return only graph prototypes that belong to the given hosts. | 
| inherited | boolean | If set to truereturn only graph prototypes inherited from a template. | 
| itemids | ID/array | Return only graph prototypes that contain the given item prototypes. | 
| templated | boolean | If set to truereturn only graph prototypes that belong to templates. | 
| templateids | ID/array | Return only graph prototypes that belong to the given templates. | 
| selectDiscoveryData | query | Return a discoveryDataproperty with the graph prototype discovery object data. The graph prototype discovery object links a discovered graph prototype to a graph prototype from which it was discovered.It has the following properties: parent_graphid-(ID)ID of the graph prototype from which the graph has been created;status-(int)graph discovery status:0 - (default) graph prototype is discovered, 1 - graph prototype is not discovered anymore; ts_delete-(timestamp)time when a graph prototype that is no longer discovered will be deleted. | 
| selectDiscoveryRule | query | Return a discoveryRuleproperty with the LLD rule that the graph prototype belongs to. | 
| selectDiscoveryRulePrototype | query | Return a discoveryRulePrototypeproperty with the parent LLD rule prototype that the graph prototype belongs to. | 
| selectGraphItems | query | Return a gitemsproperty with the graph items used in the graph prototype. | 
| selectHostGroups | query | Return a hostgroupsproperty with the host groups that the graph prototype belongs to. | 
| selectHosts | query | Return a hostsproperty with the hosts that the graph prototype belongs to. | 
| selectItems | query | Return an itemsproperty with the items and item prototypes used in the graph prototype. | 
| selectTemplateGroups | query | Return a templategroupsproperty with the template groups that the graph prototype belongs to. | 
| selectTemplates | query | Return a templatesproperty with the templates that the graph prototype belongs to. | 
| filter | object | Return only those results that exactly match the given filter. Accepts an object, where the keys are property names, and the values are either a single value or an array of values to match against. Does not support properties of textdata type.Supports additional properties: host- technical name of the host that the graph prototype belongs to;hostid- ID of the host that the graph prototype belongs to. | 
| sortfield | string/array | Sort the result by the given properties. Possible values: graphid,name,graphtype,discovered. | 
| countOutput | boolean | These parameters are described in the reference commentary. | 
| editable | boolean | |
| excludeSearch | boolean | |
| limit | integer | |
| output | query | |
| preservekeys | boolean | |
| search | object | |
| searchByAny | boolean | |
| searchWildcardsEnabled | boolean | |
| sortorder | string/array | |
| startSearch | boolean | 
(integer/array) Returns either:
countOutput parameter has been used.Retrieve all graph prototypes from an LLD rule.
{
           "jsonrpc": "2.0",
           "method": "graphprototype.get",
           "params": {
               "output": "extend",
               "discoveryids": "27426"
           },
           "id": 1
       }Response:
{
           "jsonrpc": "2.0",
           "result": [
               {
                   "graphid": "1017",
                   "name": "Disk space usage {#FSNAME}",
                   "width": "600",
                   "height": "340",
                   "yaxismin": "0.0000",
                   "yaxismax": "0.0000",
                   "templateid": "442",
                   "show_work_period": "0",
                   "show_triggers": "0",
                   "graphtype": "2",
                   "show_legend": "1",
                   "show_3d": "1",
                   "percent_left": "0.0000",
                   "percent_right": "0.0000",
                   "ymin_type": "0",
                   "ymax_type": "0",
                   "ymin_itemid": "0",
                   "ymax_itemid": "0",
                   "flags": "2"
                   "discover": "0"
               }
           ],
           "id": 1
       }CGraphPrototype::get() in ui/include/classes/api/services/CGraphPrototype.php.