- Implement pushHistory mutation to support pushing telemetry data to Zabbix trapper items. - Add VERBOSITY and MCP_LOG_* environment variables for controllable request/response logging in both API and MCP server. - Enhance ZabbixRESTDataSource with better session handling and error logging. - Update ZabbixHistory datasource to support history push operations. - Expand documentation with new cookbook recipes and MCP integration guides. - Add integration tests for history pushing (src/test/history_push*). - Reorganize documentation, moving technical product info PDF to docs/use-cases/. - Update GraphQL generated types and VCR templates.
46 lines
1.3 KiB
GraphQL
46 lines
1.3 KiB
GraphQL
### Mutation
|
|
Use this mutation to import a template for a simulated device that pushes GeoJSON data via Zabbix Trapper items.
|
|
|
|
```graphql
|
|
mutation ImportSimulatedBTTemplate($templates: [CreateTemplate!]!) {
|
|
importTemplates(templates: $templates) {
|
|
host
|
|
templateid
|
|
message
|
|
error {
|
|
message
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
### Variables
|
|
The following sample defines the `SIMULATED_BT_DEVICE` template. Note the `deviceType` tag set to `TrackedDevice`, which instructs the GraphQL API to resolve this host using the specialized `TrackedDevice` type.
|
|
|
|
We use the `state.current.json_geojson` key for the trapper item. The `json_` prefix ensures that the JSON string received from Zabbix is automatically parsed into a `JSONObject` by the GraphQL resolver.
|
|
|
|
```json
|
|
{
|
|
"templates": [
|
|
{
|
|
"host": "SIMULATED_BT_DEVICE",
|
|
"name": "Simulated BT Device",
|
|
"groupNames": ["Templates/Roadwork/Devices"],
|
|
"tags": [
|
|
{ "tag": "class", "value": "roadwork" },
|
|
{ "tag": "deviceType", "value": "TrackedDevice" }
|
|
],
|
|
"items": [
|
|
{
|
|
"name": "GeoJSON Data",
|
|
"type": 2,
|
|
"key": "state.current.json_geojson",
|
|
"value_type": 4,
|
|
"history": "7d",
|
|
"description": "Trapper item receiving GeoJSON payloads"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
```
|