integer/array templategroup.get(object parameters)
このメソッドは、指定されたパラメーターに従ってテンプレートグループを取得できます。
このメソッドは、すべてのタイプのユーザーが利用できます。メソッドを呼び出す権限は、ユーザーの役割の設定で取り消すことができます。詳細はユーザーの役割を参照してください。
(object)
Parameters defining 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 | Limits 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 are: groupid , name . |
countOutput | boolean | These parameters being common for all get methods 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 |
(integer/array)
次のいずれかを返します:
countOutput
パラメータが使用されている場合、取得されたオブジェクトの数"Templates/Databases"と"Templates/Modules"という名前の二つのテンプレートグループについて、全てのデータを取得します。
リクエスト :
{
"jsonrpc": "2.0",
"method": "templategroup.get",
"params": {
"output": "extend",
"filter": {
"name": [
"Templates/Databases",
"Templates/Modules"
]
}
},
"id": 1
}
レスポンス :
{
"jsonrpc": "2.0",
"result": [
{
"groupid": "13",
"name": "Templates/Databases",
"uuid": "748ad4d098d447d492bb935c907f652f"
},
{
"groupid": "8",
"name": "Templates/Modules",
"uuid": "57b7ae836ca64446ba2c296389c009b7"
}
],
"id": 1
}
CTemplateGroup::get() in ui/include/classes/api/services/CTemplateGroup.php.