zabbix-graphql-api/schema/devices.graphql
Andreas Hilbig a01bfabfba docs: refactor documentation and upgrade to Node.js 24
This commit upgrades the project to Node.js 24 (LTS) and performs a major refactoring of the documentation to support both advanced users and AI-based automation (MCP).

Changes:
- Environment & CI/CD:
  - Set Node.js version to >=24 in package.json and .nvmrc.
  - Updated Dockerfile to use Node 24 base image.
  - Updated @types/node to ^24.10.9.
- Documentation:
  - Refactored README.md with comprehensive technical reference, configuration details, and Zabbix-to-GraphQL mapping.
  - Created docs/howtos/cookbook.md with practical recipes for common tasks and AI test generation.
  - Updated docs/howtos/mcp.md to emphasize GraphQL's advantages for AI agents and Model Context Protocol.
  - Added readme.improvement.plan.md to track documentation evolution.
  - Enhanced all how-to guides with improved cross-references and up-to-date information.
- Guidelines:
  - Updated .junie/guidelines.md with Node 24 requirements and enhanced commit message standards (Conventional Commits 1.0.0).
- Infrastructure & Code:
  - Updated docker-compose.yml with Apollo MCP server integration.
  - Refined configuration and schema handling in src/api/ and src/datasources/.
  - Synchronized generated TypeScript types with schema updates.
2026-01-30 14:35:31 +01:00

139 lines
3.6 KiB
GraphQL

"""
(IoT / Edge - ) Devices are hosts having a state containing the "output" / the business data which is exposed
besides monitoring information.
"""
interface Device implements Host {
"""Internal Zabbix ID of the device."""
hostid: ID!
"""
Per convention a uuid is used as hostname to identify devices if they do not have a unique hostname.
"""
host: String!
"""Classification of the device."""
deviceType: String
"""List of host groups this device belongs to."""
hostgroups: [HostGroup!]
"""Visible name of the device."""
name: String
"""Device configuration tags."""
tags: DeviceConfig
"""State of the device."""
state: DeviceState
}
"""
Configuration settings for a device.
"""
type DeviceConfig {
"""
Configuration for the device widget preview in the cockpit.
"""
deviceWidgetPreview: WidgetPreview
}
"""
Represents the configuration for a 4-field widget preview.
"""
type WidgetPreview {
"""Top-left field specification."""
TOP_LEFT: DisplayFieldSpec
"""Top-right field specification."""
TOP_RIGHT: DisplayFieldSpec
"""Bottom-left field specification."""
BOTTOM_LEFT: DisplayFieldSpec
"""Bottom-right field specification."""
BOTTOM_RIGHT: DisplayFieldSpec
}
"""
Specification for a display field in a widget.
"""
type DisplayFieldSpec {
"""Key of the data to display."""
key: String,
"""Value to display if the data is missing."""
emptyValue: String
"""Unit string to append to the value."""
unit: String,
"""Font size for the value."""
value_font_size: String
"""Optional transformation for the value."""
g_value_transform: String
"""Font size for the unit."""
unit_font_size: String
"""Optional transformation for the unit."""
g_unit_transform: String
}
"""
Operational data common to most devices.
"""
type OperationalDeviceData {
"""Device temperature."""
temperature: Float
"""Device voltage."""
voltage: Float
"""Signal strength (e.g. WiFi or GSM)."""
signalstrength: Float
"""Current location of the device."""
location: Location
"""Timestamp of the operational data."""
timestamp: DateTime
"""List of active errors or status messages."""
error: [ErrorPayload!]
}
"""
Payload for a single error or status message.
"""
type ErrorPayload {
"""Error code."""
code: Int!
"""Human-readable error message."""
message: String
"""Additional contextual information about the error."""
additionalInfo: JSONObject
}
"""
Common interface for device state.
"""
interface DeviceState {
"""Operational data (telemetry)."""
operational: OperationalDeviceData
}
"""
Generic implementation of device state using a JSON object for current values.
"""
type GenericDeviceState implements DeviceState {
"""Operational data (telemetry)."""
operational: OperationalDeviceData
"""Current business data as a generic JSON object."""
current: JSONObject
}
"""
Device represents generic IoT / Edge - devices providing their state as generic "state.current" - JSON Object.
"""
type GenericDevice implements Host & Device {
"""Internal Zabbix ID of the device."""
hostid: ID!
"""
Per convention a uuid is used as hostname to identify devices if they do not have a unique hostname.
"""
host: String!
"""Classification of the device."""
deviceType: String
"""List of host groups this device belongs to."""
hostgroups: [HostGroup!]
"""Visible name of the device."""
name: String
"""Device configuration tags."""
tags: DeviceConfig
"""State of the generic device."""
state: GenericDeviceState
}