feat: implement template cloning and extended item data retrieval

- Extend Template and ZabbixItem types in GraphQL schema to support full item hierarchy and cloning.

- Update ZabbixQueryTemplatesRequest in src/datasources/zabbix-templates.ts to fetch comprehensive item configurations (type, status, history, delay, units, preprocessing, tags).

- Implement raw value resolvers for ZabbixItem.type_int and ZabbixItem.status_int in src/api/resolvers.ts.

- Add new MCP operations: mcp/operations/getTemplates.graphql and mcp/operations/importTemplates.graphql for template management via AI agents.

- Add 'Cloning a Template with Items' recipe to docs/howtos/cookbook.md.

- Update src/test/template_query.test.ts to ensure compatibility with extended datasource output.
This commit is contained in:
Andreas Hilbig 2026-01-31 12:15:18 +01:00
parent 67357d0bc3
commit ef7afe65ab
8 changed files with 231 additions and 9 deletions

View file

@ -88,9 +88,49 @@ type ZabbixItem {
"""
type: DeviceCommunicationType
"""
Raw Zabbix item type as integer.
"""
type_int: Int
"""
Raw Zabbix item status as integer.
"""
status_int: Int
"""
Hosts that this item is linked to.
"""
hosts: [Host!]
"""
History storage period (e.g. '2d', '90d').
"""
history: String
"""
Update interval.
"""
delay: String
"""
Units of the value.
"""
units: String
"""
Description of the item.
"""
description: String
"""
Preprocessing steps for the item.
"""
preprocessing: [JSONObject!]
"""
Tags assigned to the item.
"""
tags: [JSONObject!]
"""
Master item ID for dependent items.
"""
master_itemid: Int
"""
Master item for dependent items.
"""
master_item: ZabbixItem
}
"""
@ -182,9 +222,17 @@ type Template {
"""
templateid: String!
"""
Technical name of the template.
"""
host: String!
"""
Name of the template.
"""
name: String
"""
List of items for this template.
"""
items: [ZabbixItem!]
}
"""