templategroup.get

Beschrijving

integer/array templategroup.get(object parameters)

Deze methode maakt het mogelijk om sjabloongroepen op te halen aan de hand van de opgegeven parameters.

Deze methode is beschikbaar voor gebruikers van elk type. Toestemming om de methode op te roepen kan worden ingetrokken in de instellingen van gebruikersrollen. Zie Gebruikersrollen voor meer informatie.

Parameters

(object) Parameters that define the desired output.

The method supports the following parameters.

Parameter Type Description
graphids string/array Return only template groups that contain templates with the given graphs.
groupids string/array Return only template groups with the given template group IDs.
templateids string/array Return only template groups that contain the given templates.
triggerids string/array Return only template groups that contain templates with the given triggers.
with_graphs flag Return only template groups that contain templates with graphs.
with_graph_prototypes flag Return only template groups that contain templates with graph prototypes.
with_httptests flag Return only template groups that contain templates with web checks.
with_items flag Return only template groups that contain templates with items.

Overrides the with_simple_graph_items parameters.
with_item_prototypes flag Return only template groups that contain templates with item prototypes.

Overrides the with_simple_graph_item_prototypes parameter.
with_simple_graph_item_prototypes flag Return only template groups that contain templates with item prototypes, which are enabled for creation and have numeric type of information.
with_simple_graph_items flag Return only template groups that contain templates with numeric items.
with_templates flag Return only template groups that contain templates.
with_triggers flag Return only template groups that contain templates with triggers.
selectTemplates query Return a templates property with the templates that belong to the template group.

Supports count.
limitSelects integer Limit the number of records returned by subselects.

Applies to the following subselects:
selectTemplates - results will be sorted by template.
sortfield string/array Sort the result by the given properties.

Possible values: groupid, name.
countOutput boolean These parameters are common for all get methods and are described in detail in the reference commentary page.
editable boolean
excludeSearch boolean
filter object
limit integer
output query
preservekeys boolean
search object
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch boolean

Retourwaarden

(integer/array) Geeft ofwel:

  • een reeks objecten;
  • het aantal opgehaalde objecten, als de parameter countOutput is gebruikt.

Voorbeelden

Gegevens ophalen op basis van naam

Haal alle gegevens op over twee sjabloon groepen met de naam "Templates/Databases" en "Templates/Modules".

Aanvraag:

{
           "jsonrpc": "2.0",
           "method": "templategroup.get",
           "params": {
               "output": "extend",
               "filter": {
                   "name": [
                       "Templates/Databases",
                       "Templates/Modules"
                   ]
               }
           },
           "id": 1
       }

Reactie:

{
           "jsonrpc": "2.0",
           "result": [
               {
                   "groupid": "13",
                   "name": "Templates/Databases",
                   "uuid": "748ad4d098d447d492bb935c907f652f"
               },
               {
                   "groupid": "8",
                   "name": "Templates/Modules",
                   "uuid": "57b7ae836ca64446ba2c296389c009b7"
               }
           ],
           "id": 1
       }

Zie ook

Bron

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