docs: enhance GraphQL schema documentation

- Added comprehensive descriptions to all types, interfaces, and fields in 'schema/api_commons.graphql'.

- Improved documentation for mutations and input/response types in 'schema/mutations.graphql'.

- Added detailed descriptions for all queries and their arguments in 'schema/queries.graphql'.

- Enhanced documentation for core Zabbix types and enums in 'schema/zabbix.graphql'.

- Updated extension schemas under 'schema/extensions/' with proper GraphQL descriptions.

- Verified schema validity via 'graphql-codegen' and ran all tests to ensure consistency.
This commit is contained in:
Andreas Hilbig 2026-01-26 19:18:06 +01:00
parent 59815636ea
commit e61b5f4f11
11 changed files with 1330 additions and 344 deletions

123
.idea/workspace.xml generated
View file

@ -5,15 +5,16 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="d7a71994-2699-4ae4-9fd2-ee13b7f33d35" name="Changes" comment="chore: Add `allDevices` query resolver, update Zabbix device query handling, and enhance schema with `DeviceConfig` and `WidgetPreview` types"> <list default="true" id="d7a71994-2699-4ae4-9fd2-ee13b7f33d35" name="Changes" comment="chore: Add `allDevices` query resolver, update Zabbix device query handling, and enhance schema with `DeviceConfig` and `WidgetPreview` types">
<change afterPath="$PROJECT_DIR$/src/testdata/templates/zbx_default_templates_vcr.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/runConfigurations/index_ts.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/runConfigurations/index_ts.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" /> <change beforePath="$PROJECT_DIR$/schema/api_commons.graphql" beforeDir="false" afterPath="$PROJECT_DIR$/schema/api_commons.graphql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/schema/device_value_commons.graphql" beforeDir="false" afterPath="$PROJECT_DIR$/schema/device_value_commons.graphql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/schema/devices.graphql" beforeDir="false" afterPath="$PROJECT_DIR$/schema/devices.graphql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/schema/extensions/display_devices.graphql" beforeDir="false" afterPath="$PROJECT_DIR$/schema/extensions/display_devices.graphql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/schema/extensions/location_tracker_commons.graphql" beforeDir="false" afterPath="$PROJECT_DIR$/schema/extensions/location_tracker_commons.graphql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/schema/extensions/location_tracker_devices.graphql" beforeDir="false" afterPath="$PROJECT_DIR$/schema/extensions/location_tracker_devices.graphql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/schema/mutations.graphql" beforeDir="false" afterPath="$PROJECT_DIR$/schema/mutations.graphql" afterDir="false" /> <change beforePath="$PROJECT_DIR$/schema/mutations.graphql" beforeDir="false" afterPath="$PROJECT_DIR$/schema/mutations.graphql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/schema/queries.graphql" beforeDir="false" afterPath="$PROJECT_DIR$/schema/queries.graphql" afterDir="false" /> <change beforePath="$PROJECT_DIR$/schema/queries.graphql" beforeDir="false" afterPath="$PROJECT_DIR$/schema/queries.graphql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/api/resolvers.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/api/resolvers.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/schema/zabbix.graphql" beforeDir="false" afterPath="$PROJECT_DIR$/schema/zabbix.graphql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/datasources/zabbix-request.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/datasources/zabbix-request.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/datasources/zabbix-templates.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/datasources/zabbix-templates.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/schema/generated/graphql.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/schema/generated/graphql.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/schema/generated/graphql.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/schema/generated/graphql.ts" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
@ -29,7 +30,24 @@
<option name="fileBasedEmbeddingIndicesEnabled" value="true" /> <option name="fileBasedEmbeddingIndicesEnabled" value="true" />
</component> </component>
<component name="Git.Settings"> <component name="Git.Settings">
<option name="RECENT_BRANCH_BY_REPOSITORY">
<map>
<entry key="$PROJECT_DIR$" value="license" />
</map>
</option>
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
<option name="RESET_MODE" value="HARD" />
<option name="SWAP_SIDES_IN_COMPARE_BRANCHES" value="true" />
</component>
<component name="GitRewordedCommitMessages">
<option name="commitMessagesMapping">
<RewordedCommitMessageMapping>
<option name="originalMessage" value="docs: add README.md and LICENSE file&#10;&#10;- Created README.md with project purpose, features, installation guide, and usage samples.&#10;&#10;- Added LICENSE file with GNU General Public License v2.0 to match Zabbix license.&#10;&#10;(cherry picked from commit 825cb4d918eabfc7ce2319c5839b7f6125a3e1d6)" />
<option name="rewordedMessage" value="docs: add README.md and LICENSE file&#10;&#10;- Created README.md with project purpose, features, installation guide, and usage samples.&#10;&#10;- Added LICENSE file with GNU Affero General Public License v3.0 to match Zabbix license.&#10;&#10;- Added license field to package.json." />
</RewordedCommitMessageMapping>
</option>
<option name="currentCommit" value="1" />
<option name="onto" value="fdfd5f1e0eab0ff10a5acde7c4574b794dcd2292" />
</component> </component>
<component name="McpProjectServerCommands"> <component name="McpProjectServerCommands">
<commands /> <commands />
@ -46,43 +64,43 @@
<option name="openDirectoriesWithSingleClick" value="true" /> <option name="openDirectoriesWithSingleClick" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"NIXITCH_NIXPKGS_CONFIG": "", &quot;NIXITCH_NIXPKGS_CONFIG&quot;: &quot;&quot;,
"NIXITCH_NIX_CONF_DIR": "", &quot;NIXITCH_NIX_CONF_DIR&quot;: &quot;&quot;,
"NIXITCH_NIX_OTHER_STORES": "", &quot;NIXITCH_NIX_OTHER_STORES&quot;: &quot;&quot;,
"NIXITCH_NIX_PATH": "", &quot;NIXITCH_NIX_PATH&quot;: &quot;&quot;,
"NIXITCH_NIX_PROFILES": "", &quot;NIXITCH_NIX_PROFILES&quot;: &quot;&quot;,
"NIXITCH_NIX_REMOTE": "", &quot;NIXITCH_NIX_REMOTE&quot;: &quot;&quot;,
"NIXITCH_NIX_USER_PROFILE_DIR": "", &quot;NIXITCH_NIX_USER_PROFILE_DIR&quot;: &quot;&quot;,
"Node.js.index.ts.executor": "Run", &quot;Node.js.index.ts.executor&quot;: &quot;Run&quot;,
"RunOnceActivity.MCP Project settings loaded": "true", &quot;RunOnceActivity.MCP Project settings loaded&quot;: &quot;true&quot;,
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true", &quot;RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252&quot;: &quot;true&quot;,
"RunOnceActivity.git.unshallow": "true", &quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
"RunOnceActivity.typescript.service.memoryLimit.init": "true", &quot;RunOnceActivity.typescript.service.memoryLimit.init&quot;: &quot;true&quot;,
"com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1": "true", &quot;com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1&quot;: &quot;true&quot;,
"git-widget-placeholder": "main", &quot;git-widget-placeholder&quot;: &quot;main&quot;,
"go.import.settings.migrated": "true", &quot;go.import.settings.migrated&quot;: &quot;true&quot;,
"javascript.preferred.runtime.type.id": "node", &quot;javascript.preferred.runtime.type.id&quot;: &quot;node&quot;,
"junie.onboarding.icon.badge.shown": "true", &quot;junie.onboarding.icon.badge.shown&quot;: &quot;true&quot;,
"last_opened_file_path": "//wsl.localhost/Ubuntu/home/ahilbig/git/vcr/zabbix-graphql-api/src/testdata/templates", &quot;last_opened_file_path&quot;: &quot;//wsl.localhost/Ubuntu/home/ahilbig/git/vcr/zabbix-graphql-api/src/testdata/templates&quot;,
"node.js.detected.package.eslint": "true", &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
"node.js.detected.package.tslint": "true", &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
"node.js.selected.package.eslint": "(autodetect)", &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
"node.js.selected.package.tslint": "(autodetect)", &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
"nodejs_interpreter_path": "wsl://Ubuntu@/home/ahilbig/.nvm/versions/node/v24.12.0/bin/node", &quot;nodejs_interpreter_path&quot;: &quot;wsl://Ubuntu@/home/ahilbig/.nvm/versions/node/v24.12.0/bin/node&quot;,
"nodejs_package_manager_path": "npm", &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
"npm.codegen.executor": "Run", &quot;npm.codegen.executor&quot;: &quot;Run&quot;,
"npm.compile.executor": "Run", &quot;npm.compile.executor&quot;: &quot;Run&quot;,
"npm.copy-schema.executor": "Run", &quot;npm.copy-schema.executor&quot;: &quot;Run&quot;,
"npm.prod.executor": "Run", &quot;npm.prod.executor&quot;: &quot;Run&quot;,
"settings.editor.selected.configurable": "settings.javascript.runtime", &quot;settings.editor.selected.configurable&quot;: &quot;settings.javascript.runtime&quot;,
"to.speed.mode.migration.done": "true", &quot;to.speed.mode.migration.done&quot;: &quot;true&quot;,
"ts.external.directory.path": "\\\\wsl.localhost\\Ubuntu\\home\\ahilbig\\git\\vcr\\zabbix-graphql-api\\node_modules\\typescript\\lib", &quot;ts.external.directory.path&quot;: &quot;\\\\wsl.localhost\\Ubuntu\\home\\ahilbig\\git\\vcr\\zabbix-graphql-api\\node_modules\\typescript\\lib&quot;,
"vue.rearranger.settings.migration": "true" &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
} }
}]]></component> }</component>
<component name="RecapSpentCounter"> <component name="RecapSpentCounter">
<option name="endsOfQuotaMs" value="1768327208764" /> <option name="endsOfQuotaMs" value="1768327208764" />
<option name="spentUsd" value="0.04010335" /> <option name="spentUsd" value="0.04010335" />
@ -101,7 +119,7 @@
<recent name="\\wsl.localhost\Ubuntu\home\ahilbig\git\vcr\zabbix-graphql-api\schema" /> <recent name="\\wsl.localhost\Ubuntu\home\ahilbig\git\vcr\zabbix-graphql-api\schema" />
</key> </key>
</component> </component>
<component name="RunManager" selected="Node.js.index.ts"> <component name="RunManager" selected="npm.codegen">
<configuration name="copy-schema" type="js.build_tools.npm" temporary="true" nameIsGenerated="true"> <configuration name="copy-schema" type="js.build_tools.npm" temporary="true" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/package.json" /> <package-json value="$PROJECT_DIR$/package.json" />
<command value="run" /> <command value="run" />
@ -133,10 +151,21 @@
</EXTENSION> </EXTENSION>
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="test" type="js.build_tools.npm" temporary="true" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="test" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
<list> <list>
<item itemvalue="Node.js.index.ts" /> <item itemvalue="Node.js.index.ts" />
<item itemvalue="npm.compile" /> <item itemvalue="npm.compile" />
<item itemvalue="npm.codegen" /> <item itemvalue="npm.codegen" />
<item itemvalue="npm.test" />
<item itemvalue="npm.copy-schema" /> <item itemvalue="npm.copy-schema" />
<item itemvalue="npm.prod" /> <item itemvalue="npm.prod" />
</list> </list>
@ -144,6 +173,9 @@
<list> <list>
<item itemvalue="npm.prod" /> <item itemvalue="npm.prod" />
<item itemvalue="npm.copy-schema" /> <item itemvalue="npm.copy-schema" />
<item itemvalue="npm.test" />
<item itemvalue="npm.prod" />
<item itemvalue="npm.copy-schema" />
</list> </list>
</recent_temporary> </recent_temporary>
</component> </component>
@ -323,7 +355,8 @@
<MESSAGE value="chore: Update `tags` field schema to use `DeviceConfig`, enhance `isDevice` type check, and adjust IntelliJ workspace" /> <MESSAGE value="chore: Update `tags` field schema to use `DeviceConfig`, enhance `isDevice` type check, and adjust IntelliJ workspace" />
<MESSAGE value="chore: Enhance schema with `DeviceConfig` tags resolver and update IntelliJ workspace adjustments" /> <MESSAGE value="chore: Enhance schema with `DeviceConfig` tags resolver and update IntelliJ workspace adjustments" />
<MESSAGE value="chore: Add `allDevices` query resolver, update Zabbix device query handling, and enhance schema with `DeviceConfig` and `WidgetPreview` types" /> <MESSAGE value="chore: Add `allDevices` query resolver, update Zabbix device query handling, and enhance schema with `DeviceConfig` and `WidgetPreview` types" />
<option name="LAST_COMMIT_MESSAGE" value="chore: Add `allDevices` query resolver, update Zabbix device query handling, and enhance schema with `DeviceConfig` and `WidgetPreview` types" /> <MESSAGE value="docs: add README.md and LICENSE file&#10;&#10;- Created README.md with project purpose, features, installation guide, and usage samples.&#10;&#10;- Added LICENSE file with GNU Affero General Public License v3.0 to match Zabbix license.&#10;&#10;- Added license field to package.json." />
<option name="LAST_COMMIT_MESSAGE" value="docs: add README.md and LICENSE file&#10;&#10;- Created README.md with project purpose, features, installation guide, and usage samples.&#10;&#10;- Added LICENSE file with GNU Affero General Public License v3.0 to match Zabbix license.&#10;&#10;- Added license field to package.json." />
</component> </component>
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager> <breakpoint-manager>
@ -331,13 +364,11 @@
<line-breakpoint enabled="true" type="javascript"> <line-breakpoint enabled="true" type="javascript">
<url>file://$PROJECT_DIR$/src/datasources/zabbix-request.ts</url> <url>file://$PROJECT_DIR$/src/datasources/zabbix-request.ts</url>
<line>133</line> <line>133</line>
<properties lambdaOrdinal="-1" />
<option name="timeStamp" value="5" /> <option name="timeStamp" value="5" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" type="javascript"> <line-breakpoint enabled="true" type="javascript">
<url>file://$PROJECT_DIR$/src/datasources/zabbix-request.ts</url> <url>file://$PROJECT_DIR$/src/datasources/zabbix-request.ts</url>
<line>213</line> <line>213</line>
<properties lambdaOrdinal="-1" />
<option name="timeStamp" value="6" /> <option name="timeStamp" value="6" />
</line-breakpoint> </line-breakpoint>
</breakpoints> </breakpoints>

View file

@ -2,22 +2,61 @@
# Request/response # Request/response
######################################################## ########################################################
"""
Generic response wrapper containing either the result data or an error.
"""
type GenericResponse { type GenericResponse {
"""
The result data, typically a list of JSON objects.
"""
result: [JSONObject!] result: [JSONObject!]
"""
Error information if the operation failed.
"""
error: ApiError error: ApiError
} }
"""
Detailed error information returned by the API.
"""
type ApiError implements Error { type ApiError implements Error {
"""
Error code.
"""
code: Int code: Int
"""
Error message.
"""
message: String message: String
"""
Additional error data.
"""
data: JSONObject data: JSONObject
"""
Path to the field that caused the error.
"""
path: String path: String
"""
Arguments passed to the operation that failed.
"""
args: JSONObject args: JSONObject
} }
"""
Common error interface.
"""
interface Error { interface Error {
"""
Error code.
"""
code: Int code: Int
"""
Error message.
"""
message: String message: String
"""
Additional error data.
"""
data: JSONObject data: JSONObject
} }
@ -26,7 +65,13 @@ interface Error {
# User permissions # User permissions
######################################################## ########################################################
"""
Request for checking specific user permissions.
"""
input PermissionRequest { input PermissionRequest {
"""
The required permission level (DENY, READ, or READ_WRITE).
"""
permission: Permission!, permission: Permission!,
""" """
objectName maps to name / path suffix of the template group representing the permission in Zabbix: objectName maps to name / path suffix of the template group representing the permission in Zabbix:
@ -89,7 +134,13 @@ enum Permission {
READ_WRITE READ_WRITE
} }
"""
Represents a permission assigned to a user for a specific object.
"""
type UserPermission { type UserPermission {
"""
The assigned permission level.
"""
permission: Permission!, permission: Permission!,
""" """
objectName maps to name / path suffix of the template group representing the permission in Zabbix: objectName maps to name / path suffix of the template group representing the permission in Zabbix:

View file

@ -45,5 +45,8 @@ interface DeviceValueMessage {
Marker-interface for device-related data values. Marker-interface for device-related data values.
""" """
interface DeviceValue { interface DeviceValue {
"""
Dummy field to allow for empty interfaces.
"""
_empty: String _empty: String
} }

View file

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

View file

@ -16,60 +16,94 @@ type SinglePanelDevice implements Host & Device {
state: PanelState state: PanelState
} }
"""
Represents the state of a single panel device.
"""
type PanelState implements DeviceState { type PanelState implements DeviceState {
"""Operational data (telemetry)."""
operational: OperationalDeviceData operational: OperationalDeviceData
"""Current display state."""
current: PanelCurrentState current: PanelCurrentState
} }
"""
Represents the current state of a panel.
"""
type PanelCurrentState { type PanelCurrentState {
"""The current values being displayed on the panel."""
values: PanelValues values: PanelValues
} }
"""
Specific values displayed on a panel.
"""
type PanelValues { type PanelValues {
""" """
Index of the bitmap which is displayed Index of the bitmap which is displayed.
""" """
contentIndex: Int contentIndex: Int
""" """
Hash of the bitmap which is displayed Hash of the bitmap which is displayed.
""" """
contentKey: String contentKey: String
""" """
Text representation of what is displayed Text representation of what is displayed.
""" """
contentText: String contentText: String
} }
""" """
The FourPanelDevice is a panel which allows to define pictures in 4 The FourPanelDevice is a panel which allows to define pictures in 4
subpanels, called TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT subpanels, called TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT.
""" """
type FourPanelDevice implements Host & Device { type FourPanelDevice implements Host & Device {
"""Internal Zabbix ID of the device."""
hostid: ID! hostid: ID!
""" """
Per convention a uuid is used as hostname to identify devices if they do not have a unique hostname Per convention a uuid is used as hostname to identify devices if they do not have a unique hostname.
""" """
host: String! host: String!
"""Classification of the device."""
deviceType: String deviceType: String
"""List of host groups this device belongs to."""
hostgroups: [HostGroup!] hostgroups: [HostGroup!]
"""Visible name of the device."""
name: String name: String
"""Device configuration tags."""
tags: DeviceConfig tags: DeviceConfig
"""State of the four-panel device."""
state: FourPanelState state: FourPanelState
} }
"""
Represents the state of a four-panel device.
"""
type FourPanelState implements DeviceState { type FourPanelState implements DeviceState {
"""Operational data (telemetry)."""
operational: OperationalDeviceData operational: OperationalDeviceData
"""Current state of all four panels."""
current: FourPanelCurrentState current: FourPanelCurrentState
} }
"""
Represents the combined current state of four panels.
"""
type FourPanelCurrentState { type FourPanelCurrentState {
"""The values for each of the four panels."""
values: FourPanelValues values: FourPanelValues
} }
"""
Values for each of the four panels in a FourPanelDevice.
"""
type FourPanelValues { type FourPanelValues {
"""State of the top-left panel."""
TOP_LEFT: PanelValues TOP_LEFT: PanelValues
"""State of the top-right panel."""
TOP_RIGHT: PanelValues TOP_RIGHT: PanelValues
"""State of the bottom-left panel."""
BOTTOM_LEFT: PanelValues BOTTOM_LEFT: PanelValues
"""State of the bottom-right panel."""
BOTTOM_RIGHT: PanelValues BOTTOM_RIGHT: PanelValues
} }

View file

@ -27,6 +27,9 @@ type SensorDistanceValue implements DeviceValue {
""" """
time: String time: String
"""
Dummy field to allow for empty interfaces.
"""
_empty: String _empty: String
} }
@ -34,8 +37,11 @@ type SensorDistanceValue implements DeviceValue {
Represents a coordinate in 3D space with x, y, and z components. Represents a coordinate in 3D space with x, y, and z components.
""" """
type Position { type Position {
"""X coordinate."""
x: Float x: Float
"""Y coordinate."""
y: Float y: Float
"""Z coordinate."""
z: Float z: Float
} }
@ -43,7 +49,9 @@ type Position {
Represents the result of a position calculation, including the calculated position and accuracy. Represents the result of a position calculation, including the calculated position and accuracy.
""" """
type PositionCalculatorResult { type PositionCalculatorResult {
"""The calculated 3D position."""
position: Position position: Position
"""The estimated accuracy of the calculation."""
accuracy: Float accuracy: Float
} }
@ -51,10 +59,16 @@ type PositionCalculatorResult {
Concrete implementation of a DeviceValueMessage for sensor distance data. Concrete implementation of a DeviceValueMessage for sensor distance data.
""" """
type SensorDistanceMessage implements DeviceValueMessage { type SensorDistanceMessage implements DeviceValueMessage {
"""The unique identifier of the device."""
deviceKey: String deviceKey: String
"""Timestamp of the message."""
timestamp: String timestamp: String
"""Name of the attribute."""
attributeName: String attributeName: String
"""Name of the topic."""
topicName: String topicName: String
"""Type of the device."""
deviceType: String deviceType: String
"""The sensor distance value payload."""
value: SensorDistanceValue value: SensorDistanceValue
} }

View file

@ -1,45 +1,55 @@
""" """
DistanceTracker represents a device which can detect other devices around itself and estimate DistanceTracker represents a device which can detect other devices around itself and estimate
the distances, e.g. by using Bluetooth scanning technology and estimating the distance. the distances, e.g. by using Bluetooth scanning technology and estimating the distance.
""" """
type DistanceTrackerDevice implements Host & Device { type DistanceTrackerDevice implements Host & Device {
"""Internal Zabbix ID of the device."""
hostid: ID! hostid: ID!
""" """
Per convention a uuid is used as hostname to identify devices if they do not have a unique hostname Per convention a uuid is used as hostname to identify devices if they do not have a unique hostname.
""" """
host: String! host: String!
"""Classification of the device."""
deviceType: String deviceType: String
"""List of host groups this device belongs to."""
hostgroups: [HostGroup!] hostgroups: [HostGroup!]
"""Visible name of the device."""
name: String name: String
"""Device configuration tags."""
tags: DeviceConfig tags: DeviceConfig
"""State of the distance tracker device."""
state: DistanceTrackerState state: DistanceTrackerState
} }
"""
Represents the state of a distance tracker device.
"""
type DistanceTrackerState implements DeviceState { type DistanceTrackerState implements DeviceState {
"""Operational data (telemetry)."""
operational: OperationalDeviceData operational: OperationalDeviceData
"""Current business values (detected devices and distances)."""
current: DistanceTrackerValues current: DistanceTrackerValues
} }
""" """
Aggregated information of devices detected around the tracker Aggregated information of devices detected around the tracker.
""" """
type DistanceTrackerValues { type DistanceTrackerValues {
""" """
Start of time interval for the delivered device counting value Start of time interval for the delivered device counting value.
""" """
timeFrom: Time timeFrom: Time
""" """
End of time interval for the delivered device counting value End of time interval for the delivered device counting value.
""" """
timeUntil: Time timeUntil: Time
""" """
Number of unique deviceKeys detected between timeFrom and timeUnti Number of unique device keys detected between timeFrom and timeUntil.
""" """
count: Int count: Int
""" """
Detailed information about devices detected nearby Detailed information about devices detected nearby.
""" """
distances: [SensorDistanceValue!] distances: [SensorDistanceValue!]
} }

View file

@ -1,311 +1,647 @@
type Mutation { type Mutation {
""" """
Authentication: By zbx_session - cookie or zabbix-auth-token - header Creates a single host in Zabbix.
Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
""" """
createHost(host: String!, hostgroupids:[Int!]!, templateids: [Int!]!, createHost(
location: LocationInput): CreateHostResponse """Hostname of the new host."""
host: String!,
"""List of host group IDs to assign the host to."""
hostgroupids:[Int!]!,
"""List of template IDs to link to the host."""
templateids: [Int!]!,
"""Optional location information for the host inventory."""
location: LocationInput
): CreateHostResponse
""" """
(Mass) Import zabbix groups (Mass) Import Zabbix host groups and assign them to the corresponding hosts by groupid or groupName.
and assign them to the corresponding hosts by groupid or groupName.
Return value: If no error occurs a groupid be returned for each created group, Return value: If no error occurs, a groupid is returned for each created group; otherwise, the return object contains an error message.
otherwise the return object will contain an error message
Authentication: By zbx_session - cookie or zabbix-auth-token - header Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
""" """
importHostGroups(hostGroups: [CreateHostGroup!]!):[CreateHostGroupResponse!] importHostGroups(
"""List of host groups to import."""
hostGroups: [CreateHostGroup!]!
):[CreateHostGroupResponse!]
""" """
(Mass) Import hosts and assign them to host groups by groupid or groupName. (Mass) Import hosts and assign them to host groups by groupid or groupName.
Return value: If no error occurs a hostid will be returned for each created host, Return value: If no error occurs, a hostid is returned for each created host; otherwise, the return object contains an error message.
otherwise the return object will contain an error message.
Authentication: By zbx_session - cookie or zabbix-auth-token - header Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
""" """
importHosts(hosts: [CreateHost!]!):[ImportHostResponse!] importHosts(
"""List of hosts to import."""
importUserRights(input: UserRightsInput!, dryRun: Boolean! = true): ImportUserRightsResult hosts: [CreateHost!]!
):[ImportHostResponse!]
""" """
(Mass) Import template groups Import user rights (roles and groups) into Zabbix.
and assign them by groupid or name.
Return value: If no error occurs a groupid be returned for each created group, Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
otherwise the return object will contain an error message
Authentication: By zbx_session - cookie or zabbix-auth-token - header
""" """
importTemplateGroups(templateGroups: [CreateTemplateGroup!]!):[CreateTemplateGroupResponse!] importUserRights(
"""User rights configuration to import."""
input: UserRightsInput!,
"""If true, only validates the input without applying changes."""
dryRun: Boolean! = true
): ImportUserRightsResult
"""
(Mass) Import template groups and assign them by groupid or name.
Return value: If no error occurs, a groupid is returned for each created group; otherwise, the return object contains an error message.
Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
"""
importTemplateGroups(
"""List of template groups to import."""
templateGroups: [CreateTemplateGroup!]!
):[CreateTemplateGroupResponse!]
""" """
(Mass) Import templates. (Mass) Import templates.
Return value: If no error occurs a templateid will be returned for each created template, Return value: If no error occurs, a templateid is returned for each created template; otherwise, the return object contains an error message.
otherwise the return object will contain an error message.
Authentication: By zbx_session - cookie or zabbix-auth-token - header Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
""" """
importTemplates(templates: [CreateTemplate!]!):[ImportTemplateResponse!] importTemplates(
"""List of templates to import."""
templates: [CreateTemplate!]!
):[ImportTemplateResponse!]
""" """
Delete templates. Delete templates by their IDs or by a name pattern.
Authentication: By zbx_session - cookie or zabbix-auth-token - header Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
""" """
deleteTemplates(templateids: [Int!], name_pattern: String): [DeleteResponse!] deleteTemplates(
"""List of template IDs to delete."""
templateids: [Int!],
"""Wildcard name pattern for templates to delete (e.g., 'Template%')."""
name_pattern: String
): [DeleteResponse!]
""" """
Delete template groups. Delete template groups by their IDs or by a name pattern.
Authentication: By zbx_session - cookie or zabbix-auth-token - header Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
""" """
deleteTemplateGroups(groupids: [Int!], name_pattern: String): [DeleteResponse!] deleteTemplateGroups(
"""List of template group IDs to delete."""
groupids: [Int!],
"""Wildcard name pattern for template groups to delete."""
name_pattern: String
): [DeleteResponse!]
} }
#################################################################### ####################################################################
# Input types used for importXXX - and storeXXX - Mutations # Input types used for importXXX - and storeXXX - Mutations
#################################################################### ####################################################################
"""
Response object for delete operations.
"""
type DeleteResponse { type DeleteResponse {
"""
ID of the deleted entity.
"""
id: Int! id: Int!
"""
Status message for the delete operation.
"""
message: String message: String
"""
Error information if the deletion failed.
"""
error: ApiError error: ApiError
} }
"""
Input for creating or identifying a template group.
"""
input CreateTemplateGroup { input CreateTemplateGroup {
""" """
Name of the template group Name of the template group.
""" """
groupName: String! groupName: String!
""" """
Internally used unique id Internally used unique id (will be assigned by Zabbix if empty).
(will be assigned by Zabbix if empty)
""" """
uuid: String uuid: String
} }
"""
Input for creating or updating a template.
"""
input CreateTemplate { input CreateTemplate {
""" """
Name of the template Technical name of the template.
""" """
host: String! host: String!
""" """
Visible name of the template Visible name of the template.
""" """
name: String name: String
""" """
groupNames is used to assign the created object List of template group names to assign the template to.
to a template group.
""" """
groupNames: [String!]! groupNames: [String!]!
""" """
Optionally the internal groupids can be passed - in this case the Optionally, internal group IDs can be provided instead of group names.
groupName is ignored
""" """
groupids: [Int] groupids: [Int]
""" """
Internally used unique id Internally used unique id (will be assigned by Zabbix if empty).
(will be assigned by Zabbix if empty)
""" """
uuid: String uuid: String
""" """
Template items List of items to create within the template.
""" """
items: [CreateTemplateItem!] items: [CreateTemplateItem!]
""" """
Linked templates List of other templates to link to this template.
""" """
templates: [CreateLinkedTemplate!] templates: [CreateLinkedTemplate!]
""" """
Template tags Tags to assign to the template.
""" """
tags: [CreateTag!] tags: [CreateTag!]
} }
"""
Input for creating an item within a template.
"""
input CreateTemplateItem { input CreateTemplateItem {
"""
Internally used unique id.
"""
uuid: String uuid: String
"""
Name of the item.
"""
name: String! name: String!
"""
Zabbix item type (e.g., 0 for Zabbix Agent, 18 for Dependent).
"""
type: Int type: Int
"""
Technical key of the item.
"""
key: String! key: String!
"""
Type of information (e.g., 0 for Float, 3 for Int, 4 for Text).
"""
value_type: Int value_type: Int
"""
History storage period (e.g., '2d', '90d').
"""
history: String history: String
"""
Units of the value.
"""
units: String units: String
"""
Update interval.
"""
delay: String delay: String
"""
Description of the item.
"""
description: String description: String
"""
Preprocessing steps for the item values.
"""
preprocessing: [CreateItemPreprocessing!] preprocessing: [CreateItemPreprocessing!]
"""
Tags to assign to the item.
"""
tags: [CreateTag!] tags: [CreateTag!]
"""
Reference to a master item if this is a dependent item.
"""
master_item: CreateMasterItem master_item: CreateMasterItem
} }
"""
Reference to a master item for dependent items.
"""
input CreateMasterItem { input CreateMasterItem {
"""
The technical key of the master item.
"""
key: String! key: String!
} }
"""
Input for an item preprocessing step.
"""
input CreateItemPreprocessing { input CreateItemPreprocessing {
"""
Type of preprocessing step (e.g., 12 for JSONPath, 21 for JavaScript).
"""
type: Int! type: Int!
"""
Parameters for the preprocessing step.
"""
params: [String!]! params: [String!]!
"""
Error handling behavior.
"""
error_handler: Int error_handler: Int
"""
Error handling parameters.
"""
error_handler_params: String error_handler_params: String
} }
"""
Reference to a template to be linked.
"""
input CreateLinkedTemplate { input CreateLinkedTemplate {
"""
The technical name of the template to link.
"""
name: String! name: String!
} }
"""
Input for a tag.
"""
input CreateTag { input CreateTag {
"""
Tag name.
"""
tag: String! tag: String!
"""
Tag value.
"""
value: String value: String
} }
"""
Response for a template import operation.
"""
type ImportTemplateResponse { type ImportTemplateResponse {
"""
The technical name of the imported template.
"""
host: String! host: String!
"""
The Zabbix template ID assigned to the template.
"""
templateid: String templateid: String
"""
Status message for the import.
"""
message: String message: String
"""
Error information if the import failed.
"""
error: ApiError error: ApiError
} }
"""
Response for a template group import operation.
"""
type CreateTemplateGroupResponse { type CreateTemplateGroupResponse {
"""
Name of the imported template group.
"""
groupName: String! groupName: String!
"""
The Zabbix group ID assigned to the group.
"""
groupid: Int groupid: Int
"""
Status message for the import.
"""
message: String message: String
"""
Error information if the import failed.
"""
error: ApiError error: ApiError
} }
"""
Input for creating or identifying a host group.
"""
input CreateHostGroup { input CreateHostGroup {
""" """
Name of the host group Name of the host group.
""" """
groupName: String! groupName: String!
""" """
Internally used unique id Internally used unique id (will be assigned by Zabbix if empty).
(will be assigned by Zabbix if empty)
""" """
uuid: String uuid: String
} }
"""
Response for a host import operation.
"""
type ImportHostResponse { type ImportHostResponse {
deviceKey: String! """
hostid: String The device key (technical name) of the imported host.
message: String """
error: ApiError
}
type CreateHostGroupResponse {
groupName: String!
groupid: Int
message: String
error: ApiError
}
input CreateHost {
deviceKey: String! deviceKey: String!
""" """
Optional display name of the device (must be unique if provided - default is to set display name to deviceKey) The Zabbix host ID assigned to the host.
"""
hostid: String
"""
Status message for the import.
"""
message: String
"""
Error information if the import failed.
"""
error: ApiError
}
"""
Response for a host group import operation.
"""
type CreateHostGroupResponse {
"""
Name of the imported host group.
"""
groupName: String!
"""
The Zabbix group ID assigned to the group.
"""
groupid: Int
"""
Status message for the import.
"""
message: String
"""
Error information if the import failed.
"""
error: ApiError
}
"""
Input for creating a new host.
"""
input CreateHost {
"""
Technical name of the host/device.
"""
deviceKey: String!
"""
Optional display name of the device (must be unique if provided - default is to set display name to deviceKey).
""" """
name: String name: String
"""
Classification or category of the device.
"""
deviceType: String! deviceType: String!
""" """
groupNames is used to assign the created object List of host group names to assign the host to.
to a host group. It is mandatory but
can also be blank. This is usefull in case of
passing a groupid instead which is
the zabbix internal key for storing the group.
If a groupid is provided the passed groupName is ignored
""" """
groupNames: [String!]! groupNames: [String!]!
""" """
Optionally the internal groupids can be passed - in this case the Optionally, internal group IDs can be provided instead of group names.
groupName is ignored
""" """
groupids: [Int] groupids: [Int]
"""
Location information for the host.
"""
location: LocationInput location: LocationInput
} }
"""
Response for a single host creation operation.
"""
type CreateHostResponse { type CreateHostResponse {
"""
List of created host IDs.
"""
hostids: [Int] hostids: [Int]
"""
List of created item IDs.
"""
itemids: [Int] itemids: [Int]
"""
Error information if the creation failed.
"""
error: ApiError error: ApiError
} }
"""
Input for host location information.
"""
input LocationInput { input LocationInput {
"""
Name of the location.
"""
name: String name: String
"""
Latitude coordinate.
"""
location_lat: String location_lat: String
"""
Longitude coordinate.
"""
location_lon: String location_lon: String
} }
####################################### """
# Permission related input Input for importing user rights.
####################################### """
input UserRightsInput { input UserRightsInput {
"""
List of user roles to import.
"""
userRoles: [UserRoleInput!] userRoles: [UserRoleInput!]
"""
List of user groups to import.
"""
userGroups: [UserGroupInput!] userGroups: [UserGroupInput!]
} }
"""
Input for a user role.
"""
input UserRoleInput { input UserRoleInput {
"""
Name of the role.
"""
name: String name: String
"""
Type of role (e.g., 1 for User, 2 for Admin, 3 for Super Admin).
"""
type: Int type: Int
"""
Whether the role is read-only (1) or not (0).
"""
readonly: Int readonly: Int
"""
Specific rules for the role.
"""
rules: UserRoleRulesInput rules: UserRoleRulesInput
} }
"""
Input for user role rules.
"""
input UserRoleRulesInput { input UserRoleRulesInput {
"""
UI access rules.
"""
ui: [UserRoleRuleInput!] ui: [UserRoleRuleInput!]
"""
Default access for UI elements.
"""
ui_default_access: Int ui_default_access: Int
"""
Module access rules.
"""
modules:[UserRoleModuleInput!] modules:[UserRoleModuleInput!]
"""
Default access for modules.
"""
modules_default_access: Int modules_default_access: Int
"""
Whether API access is enabled (1) or not (0).
"""
api_access: Int api_access: Int
"""
API mode (e.g., 0 for white-list, 1 for black-list).
"""
api_mode: Int api_mode: Int
"""
List of API methods allowed/denied.
"""
api: [String!] api: [String!]
"""
Action rules.
"""
actions: [UserRoleRuleInput!] actions: [UserRoleRuleInput!]
"""
Default access for actions.
"""
actions_default_access: Int actions_default_access: Int
} }
"""
Input for a single user role rule.
"""
input UserRoleRuleInput { input UserRoleRuleInput {
"""
Name of the rule/element.
"""
name: String name: String
"""
Status (e.g., 1 for enabled, 0 for disabled).
"""
status: Int status: Int
} }
"""
Input for user role module access.
"""
input UserRoleModuleInput { input UserRoleModuleInput {
"""
The internal Zabbix module ID.
"""
moduleid: String moduleid: String
"""
Status of the module.
"""
status: Int status: Int
"""
Technical ID of the module.
"""
id: String id: String
} }
"""
Input for a user group.
"""
input UserGroupInput { input UserGroupInput {
"""
Name of the user group.
"""
name: String! name: String!
"""
Frontend access level.
"""
gui_access: Int gui_access: Int
"""
Status of the users in the group.
"""
users_status: Int users_status: Int
"""
Permissions for host groups.
"""
hostgroup_rights: [ZabbixGroupRightInput!] hostgroup_rights: [ZabbixGroupRightInput!]
"""
Permissions for template groups.
"""
templategroup_rights: [ZabbixGroupRightInput!] templategroup_rights: [ZabbixGroupRightInput!]
} }
"""
Input for a Zabbix group permission right.
"""
input ZabbixGroupRightInput { input ZabbixGroupRightInput {
"""
The unique ID of the group.
"""
uuid: String uuid: String
""" """
name may optionally be specified for documentation purpose, Name may optionally be specified for documentation purpose,
but the master for setting the user right is the uuid. but the master for setting the user right is the uuid.
If a uuid is found and the corresponding group
has a deviating name this will be documented within a message
with errorcode = 0 (OK) but the permission will be set (
the reason is that names for groups may deviate between several
instances of the control center although the semantic is the same -
while the semantic is identified by uuid.
""" """
name: String name: String
"""
The permission level to assign.
"""
permission: Permission permission: Permission
} }
"""
Result of a user rights import operation.
"""
type ImportUserRightsResult { type ImportUserRightsResult {
"""
Results for the imported user roles.
"""
userRoles: [ImportUserRightResult!] userRoles: [ImportUserRightResult!]
"""
Results for the imported user groups.
"""
userGroups: [ImportUserRightResult!] userGroups: [ImportUserRightResult!]
} }
"""
Result of a single user right (role or group) import.
"""
type ImportUserRightResult { type ImportUserRightResult {
"""
The ID of the imported/updated entity.
"""
id: String id: String
"""
The name of the entity.
"""
name: String name: String
"""
Status message for the import.
"""
message: String message: String
"""
List of errors encountered during import.
"""
errors: [ApiError!] errors: [ApiError!]
} }

View file

@ -4,124 +4,170 @@ scalar Time
scalar JSONObject scalar JSONObject
type Query { type Query {
"Get api (build) version" """
Returns the API build version.
"""
apiVersion: String! apiVersion: String!
"Get zabbix version"
zabbixVersion: String
"""
Login to zabbix - provided for debugging and testing purpose. The result of the login operation is
authentication token returned may be passed as
header 'zabbix-auth-token' for authenticating future API requests.
As an alternative to the cookie 'zbx_session' may be set which is automatically set after login to
the cockpit - this is the standard way to authenticate api calls initiated by the cockpit frontend
because the frontend is always embedded into the Zabbix portal which is only accessible after logging in and
obtainind the zbx_session - cookie.
"""
login(username: String!, password: String!): String
""" """
Logout from zabbix - provided for debugging and testing purpose. This invalidates the token received by the login Returns the version of the connected Zabbix instance.
operation. Returns true on success """
zabbixVersion: String
"""
Logs in to Zabbix. This is primarily for debugging and testing.
The returned authentication token can be passed in the `zabbix-auth-token` header for future requests.
Alternatively, the `zbx_session` cookie can be used for authentication.
"""
login(
"""Zabbix username."""
username: String!,
"""Zabbix password."""
password: String!
): String
"""
Logs out from Zabbix, invalidating the current session/token.
""" """
logout: Boolean logout: Boolean
""" """
Get all hosts + corresponding items. If with_items==true only hosts with attached items are delivered Returns all hosts and their items.
name_pattern: If provided this will perform a LIKE "%…%" search on the name attribute within the database.
Authentication: By zbx_session - cookie or zabbix-auth-token - header Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
""" """
allHosts(name_pattern: String = "", filter_host: String = null, hostids: Int, allHosts(
groupids:[Int!] = null, with_items: Boolean = false, tag_deviceType:[String]=[], tag_hostType:[String!]): [Host] """Wildcard name pattern for filtering hosts (LIKE '%...%')."""
name_pattern: String = "",
"""Filter hosts by their technical name."""
filter_host: String = null,
"""Filter by a specific host ID."""
hostids: Int,
"""Filter by host group IDs."""
groupids:[Int!] = null,
"""If true, only returns hosts that have items attached."""
with_items: Boolean = false,
"""Filter by `deviceType` tag."""
tag_deviceType:[String]=[],
"""Filter by `hostType` tag."""
tag_hostType:[String!]
): [Host]
""" """
Get all devices + corresponding items. Devices are modelled as hosts having a device type + a state. Returns all devices and their items. Devices are hosts with a `deviceType` and a state.
If with_items==true only hosts with attached items are delivered
name_pattern: If provided this will perform a LIKE "%…%" search on the name attribute within the database.
Authentication: By zbx_session - cookie or zabbix-auth-token - header Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
""" """
allDevices(name_pattern: String = "", filter_host: String = null, hostids: Int, allDevices(
groupids:[Int!] = null, with_items: Boolean = false, tag_deviceType:[String]=[], tag_hostType:[String!]): [Device] """Wildcard name pattern for filtering devices (LIKE '%...%')."""
name_pattern: String = "",
"""Filter devices by their technical name."""
filter_host: String = null,
"""Filter by a specific host ID."""
hostids: Int,
"""Filter by host group IDs."""
groupids:[Int!] = null,
"""If true, only returns devices that have items attached."""
with_items: Boolean = false,
"""Filter by `deviceType` tag."""
tag_deviceType:[String]=[],
"""Filter by `hostType` tag."""
tag_hostType:[String!]
): [Device]
""" """
Get all host groups. Returns all host groups.
If with_hosts==true only groups with attached hosts are delivered.
Authentication: By zbx_session - cookie or zabbix-auth-token - header Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
""" """
allHostGroups(search_name: String, with_hosts: Boolean = true): [HostGroup] allHostGroups(
"""Search for host groups by name (supports wildcards)."""
search_name: String,
"""If true, only returns groups that have hosts attached."""
with_hosts: Boolean = true
): [HostGroup]
""" """
Get all locations used by hosts. Returns all locations used by hosts.
distinct_by_name=true means that the result is filtered for distinct names (default)
name_pattern: If provided this will perform a Regex search on the name attribute within the database.
Authentication: By zbx_session - cookie or zabbix-auth-token - header Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
""" """
locations(name_pattern: String = "", distinct_by_name: Boolean = true, templateids:[String] = null): [Location] locations(
"""Regex name pattern for filtering locations."""
name_pattern: String = "",
"""If true, filters the result for distinct names."""
distinct_by_name: Boolean = true,
"""Filter by template IDs used by the hosts."""
templateids:[String] = null
): [Location]
""" """
Export history from Zabbix items Exports value history for Zabbix items.
Authentication: By zbx_session - cookie or zabbix-auth-token - header Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
""" """
exportHostValueHistory( exportHostValueHistory(
"(Optional) list of hostnames to be included in the result" """Optional list of hostnames to be included in the result."""
host_filter: [String!], host_filter: [String!],
"(Optional) list of item keys to be included in the result" """Optional list of item keys to be included in the result."""
itemKey_filter: [String!], itemKey_filter: [String!],
""" """Timestamp of the earliest value to include."""
(Optional) timestamp of earliest value"""
time_from: DateTime, time_from: DateTime,
"""(Optional) timestamp of last value """ """Timestamp of the last value to include."""
time_until: DateTime, time_until: DateTime,
"""Results are sorted by timestamps - ascending or descending order may be specified """Sort order for the results (asc or desc)."""
using this parameter"""
sortOrder: SortOrder=desc, sortOrder: SortOrder=desc,
""" """Maximum number of records to return."""
Maximum number of records to be delivered. Hint: This might be useful, because the limit: Int,
current version of Zabbix delivers a 500 - error in case of requesting too much data """The data type of the values being retrieved."""
"""
limit: Int
"""
As values are stored in different data structures depending on their type
the type information must be specified in advance, although
each value (also if number) is converted into a string afterwards
"""
type: StorageItemType = FLOAT type: StorageItemType = FLOAT
): GenericResponse
):GenericResponse
""" """
Return all user permissions. If objectNames is provided return only the permissions related to the objects within Returns all user permissions.
the objectNames - list If `objectNames` is provided, returns only the permissions related to those objects.
""" """
userPermissions(objectNames: [String!]): [UserPermission!] userPermissions(
"""Optional list of object names to filter by."""
objectNames: [String!]
): [UserPermission!]
""" """
Return true if and only if the current user (identified by token / cookie) Checks if the current user has the requested permissions.
has all requested permissions (minimum - if READ is requested and the user has READ_WRITE
the response will be true)
""" """
hasPermissions(permissions: [PermissionRequest!]!): Boolean hasPermissions(
"""List of permissions to check."""
permissions: [PermissionRequest!]!
): Boolean
""" """
name_pattern: If provided this will perform a LIKE "%…%" search on the name attribute within the database. Exports user rights (roles and groups).
exclude_groups_pattern: Regex allowing to exclude all matching hostgroups from group permissions
""" """
exportUserRights(name_pattern: String = "" exclude_hostgroups_pattern: String = ""): UserRights exportUserRights(
"""Wildcard name pattern for filtering (LIKE '%...%')."""
name_pattern: String = ""
"""Regex to exclude matching host groups from group permissions."""
exclude_hostgroups_pattern: String = ""
): UserRights
""" """
Get templates. Returns templates.
""" """
templates(hostids: [Int], name_pattern: String): [Template] templates(
"""Filter by specific template IDs."""
hostids: [Int],
"""Wildcard name pattern for filtering templates."""
name_pattern: String
): [Template]
""" """
Get template groups. Returns all template groups.
""" """
allTemplateGroups(name_pattern: String): [HostGroup] allTemplateGroups(
"""Wildcard name pattern for filtering template groups."""
name_pattern: String
): [HostGroup]
} }

View file

@ -2,18 +2,39 @@
# Hosts, items + groups, templates # Hosts, items + groups, templates
################################### ###################################
"""
Represents a host group in Zabbix.
"""
type HostGroup { type HostGroup {
"""
Internal Zabbix ID of the host group.
"""
groupid: ID! groupid: ID!
"""
Name of the host group.
"""
name: String name: String
} }
"""
Common interface for all host-like entities in Zabbix.
"""
interface Host { interface Host {
"""
Internal Zabbix ID of the host.
"""
hostid: ID! hostid: ID!
""" """
The host field contains the "hostname" in Zabbix Technical name of the host (the 'hostname' in Zabbix).
""" """
host: String! host: String!
"""
List of host groups this host belongs to.
"""
hostgroups: [HostGroup!] hostgroups: [HostGroup!]
"""
Visible name of the host.
"""
name: String name: String
""" """
Specifies the type or category of the device. Used to define the classification Specifies the type or category of the device. Used to define the classification
@ -22,42 +43,113 @@ interface Host {
deviceType: String deviceType: String
} }
"""
Represents a Zabbix item (a single data point being monitored).
"""
type ZabbixItem { type ZabbixItem {
"""
Internal Zabbix ID of the item.
"""
itemid: Int! itemid: Int!
"""
Visible name of the item.
"""
name: String! name: String!
"""
Technical key of the item.
"""
key_: String! key_: String!
"""
Internal Zabbix ID of the host this item belongs to.
"""
hostid: Int hostid: Int
"""
Unix timestamp of the last time the item value was updated.
"""
lastclock: Int lastclock: Int
"""
Last value retrieved for this item.
"""
lastvalue: String lastvalue: String
"""
Type of information (e.g., 0 for Float, 3 for Int, 4 for Text).
"""
value_type: Int! value_type: Int!
"""
Attribute name if this item is part of a hierarchical mapping.
"""
attributeName: String attributeName: String
"""
Status of the item (ENABLED or DISABLED).
"""
status: DeviceStatus status: DeviceStatus
"""
Communication type used by the item.
"""
type: DeviceCommunicationType type: DeviceCommunicationType
"""
Hosts that this item is linked to.
"""
hosts: [Host!] hosts: [Host!]
} }
"""
Enum representing the different communication methods Zabbix uses to collect data.
"""
enum DeviceCommunicationType { enum DeviceCommunicationType {
"""Zabbix agent."""
ZABBIX_AGENT ZABBIX_AGENT
"""Zabbix agent (active)."""
ZABBIX_AGENT_ACTIVE ZABBIX_AGENT_ACTIVE
"""Zabbix trapper."""
ZABBIX_TRAP ZABBIX_TRAP
"""Zabbix internal."""
ZABBIX_INTERNAL_ITEM ZABBIX_INTERNAL_ITEM
"""Simple check."""
SIMPLE_CHECK SIMPLE_CHECK
"""Dependent item."""
DEPENDANT_ITEM DEPENDANT_ITEM
"""Calculated item."""
SIMULATOR_CALCULATED SIMULATOR_CALCULATED
"""JavaScript item."""
SIMULATOR_JAVASCRIPT SIMULATOR_JAVASCRIPT
"""HTTP agent."""
HTTP_AGENT HTTP_AGENT
"""IPMI agent."""
IPMI_AGENT IPMI_AGENT
"""JMX agent."""
JMX_AGENT JMX_AGENT
"""SNMP agent."""
SNMP_AGENT SNMP_AGENT
"""SNMP trap."""
SNMP_TRAP SNMP_TRAP
"""Database monitor."""
DATABASE_MONITOR DATABASE_MONITOR
} }
"""
Concrete implementation of a Zabbix host.
"""
type ZabbixHost implements Host { type ZabbixHost implements Host {
"""
Internal Zabbix ID of the host.
"""
hostid: ID! hostid: ID!
"""
Technical name of the host.
"""
host: String! host: String!
"""
List of host groups this host belongs to.
"""
hostgroups: [HostGroup!] hostgroups: [HostGroup!]
"""
Visible name of the host.
"""
name: String name: String
"""
Tags assigned to the host as a JSON object.
"""
tags: JSONObject tags: JSONObject
""" """
@ -66,36 +158,85 @@ type ZabbixHost implements Host {
""" """
deviceType: String deviceType: String
"""
List of monitored items for this host.
"""
items: [ZabbixItem!] items: [ZabbixItem!]
"""
Host inventory data.
"""
inventory: Inventory inventory: Inventory
"""
List of templates linked to this host.
"""
parentTemplates: [Template!] parentTemplates: [Template!]
} }
"""
Represents a Zabbix template.
"""
type Template { type Template {
"""
Internal Zabbix ID of the template.
"""
templateid: String! templateid: String!
"""
Name of the template.
"""
name: String name: String
} }
"""
Represents host inventory information.
"""
type Inventory { type Inventory {
"""
Location data for the host.
"""
location: Location location: Location
} }
""" """
Hint: WGS84[dd.ddddd] coordinates are used Interface for entities that have GPS coordinates.
Hint: WGS84[dd.ddddd] coordinates are used.
""" """
interface GpsPosition { interface GpsPosition {
"""
Latitude coordinate.
"""
latitude: Float latitude: Float
longitude: Float """
} Longitude coordinate.
type Location implements GpsPosition { """
name: String
latitude: Float
longitude: Float longitude: Float
} }
"""
Represents a geographical location.
"""
type Location implements GpsPosition {
"""
Name of the location.
"""
name: String
"""
Latitude coordinate.
"""
latitude: Float
"""
Longitude coordinate.
"""
longitude: Float
}
"""
Status of a Zabbix device/item.
"""
enum DeviceStatus { enum DeviceStatus {
"""The device/item is enabled."""
ENABLED ENABLED
"""The device/item is disabled."""
DISABLED DISABLED
} }
@ -103,62 +244,124 @@ enum DeviceStatus {
# History / Values # History / Values
######################################################## ########################################################
"""
Enum representing the storage data types for monitored items.
"""
enum StorageItemType { enum StorageItemType {
"""Floating point number."""
FLOAT FLOAT
"""Unsigned integer."""
INT INT
"""Textual data."""
TEXT TEXT
} }
############################ ############################
# Permissions # Permissions
############################ ############################
"""
Represents the combined user rights (groups and roles).
"""
type UserRights { type UserRights {
"""List of user groups."""
userGroups: [UserGroup!] userGroups: [UserGroup!]
"""List of user roles."""
userRoles: [UserRole!] userRoles: [UserRole!]
} }
"""
Represents a Zabbix user role.
"""
type UserRole { type UserRole {
"""Internal Zabbix ID of the role."""
roleid: Int! roleid: Int!
"""Name of the role."""
name: String name: String
"""Type of the role."""
type: Int type: Int
"""Whether the role is read-only."""
readonly: Int readonly: Int
"""Rules assigned to the role."""
rules: UserRoleRules rules: UserRoleRules
} }
"""
Represents the rules assigned to a user role.
"""
type UserRoleRules { type UserRoleRules {
"""UI access rules."""
ui: [UserRoleRule!] ui: [UserRoleRule!]
"""Default access for UI elements."""
ui_default_access: Int ui_default_access: Int
"""Module access rules."""
modules:[UserRoleModule!] modules:[UserRoleModule!]
"""Default access for modules."""
modules_default_access: Int modules_default_access: Int
"""Whether API access is enabled."""
api_access: Int api_access: Int
"""API mode."""
api_mode: Int api_mode: Int
"""List of API methods allowed/denied."""
api: [String!] api: [String!]
"""Action rules."""
actions: [UserRoleRule!] actions: [UserRoleRule!]
"""Default access for actions."""
actions_default_access: Int actions_default_access: Int
} }
"""
Represents a single rule within a user role.
"""
type UserRoleRule { type UserRoleRule {
"""Name of the rule."""
name: String name: String
"""Status of the rule."""
status: Int status: Int
} }
"""
Represents a module assigned to a user role.
"""
type UserRoleModule { type UserRoleModule {
"""Internal Zabbix module ID."""
moduleid: String moduleid: String
"""Status of the module."""
status: Int status: Int
"""Technical ID of the module."""
id: String id: String
"""Relative path to the module."""
relative_path: String relative_path: String
} }
"""
Represents a Zabbix user group.
"""
type UserGroup { type UserGroup {
"""Internal Zabbix ID of the user group."""
usrgrpid: Int! usrgrpid: Int!
"""Name of the user group."""
name: String! name: String!
"""Frontend access level."""
gui_access: Int gui_access: Int
"""Status of users in the group."""
users_status: Int users_status: Int
"""Permissions for host groups."""
hostgroup_rights: [ZabbixGroupRight!] hostgroup_rights: [ZabbixGroupRight!]
"""Permissions for template groups."""
templategroup_rights: [ZabbixGroupRight!] templategroup_rights: [ZabbixGroupRight!]
} }
"""
Represents a specific permission right for a group.
"""
type ZabbixGroupRight { type ZabbixGroupRight {
"""ID of the group the right applies to."""
id: Int! id: Int!
"""Unique ID of the group."""
uuid: String uuid: String
"""Name of the group."""
name: String name: String
"""Assigned permission level."""
permission: Permission permission: Permission
} }

View file

@ -25,147 +25,178 @@ export interface Scalars {
Time: { input: any; output: any; } Time: { input: any; output: any; }
} }
/** Detailed error information returned by the API. */
export interface ApiError extends Error { export interface ApiError extends Error {
__typename?: 'ApiError'; __typename?: 'ApiError';
/** Arguments passed to the operation that failed. */
args?: Maybe<Scalars['JSONObject']['output']>; args?: Maybe<Scalars['JSONObject']['output']>;
/** Error code. */
code?: Maybe<Scalars['Int']['output']>; code?: Maybe<Scalars['Int']['output']>;
/** Additional error data. */
data?: Maybe<Scalars['JSONObject']['output']>; data?: Maybe<Scalars['JSONObject']['output']>;
/** Error message. */
message?: Maybe<Scalars['String']['output']>; message?: Maybe<Scalars['String']['output']>;
/** Path to the field that caused the error. */
path?: Maybe<Scalars['String']['output']>; path?: Maybe<Scalars['String']['output']>;
} }
/** Input for creating a new host. */
export interface CreateHost { export interface CreateHost {
/** Technical name of the host/device. */
deviceKey: Scalars['String']['input']; deviceKey: Scalars['String']['input'];
/** Classification or category of the device. */
deviceType: Scalars['String']['input']; deviceType: Scalars['String']['input'];
/** /** List of host group names to assign the host to. */
* groupNames is used to assign the created object
* to a host group. It is mandatory but
* can also be blank. This is usefull in case of
* passing a groupid instead which is
* the zabbix internal key for storing the group.
* If a groupid is provided the passed groupName is ignored
*/
groupNames: Array<Scalars['String']['input']>; groupNames: Array<Scalars['String']['input']>;
/** /** Optionally, internal group IDs can be provided instead of group names. */
* Optionally the internal groupids can be passed - in this case the
* groupName is ignored
*/
groupids?: InputMaybe<Array<InputMaybe<Scalars['Int']['input']>>>; groupids?: InputMaybe<Array<InputMaybe<Scalars['Int']['input']>>>;
/** Location information for the host. */
location?: InputMaybe<LocationInput>; location?: InputMaybe<LocationInput>;
/** Optional display name of the device (must be unique if provided - default is to set display name to deviceKey) */ /** Optional display name of the device (must be unique if provided - default is to set display name to deviceKey). */
name?: InputMaybe<Scalars['String']['input']>; name?: InputMaybe<Scalars['String']['input']>;
} }
/** Input for creating or identifying a host group. */
export interface CreateHostGroup { export interface CreateHostGroup {
/** Name of the host group */ /** Name of the host group. */
groupName: Scalars['String']['input']; groupName: Scalars['String']['input'];
/** /** Internally used unique id (will be assigned by Zabbix if empty). */
* Internally used unique id
* (will be assigned by Zabbix if empty)
*/
uuid?: InputMaybe<Scalars['String']['input']>; uuid?: InputMaybe<Scalars['String']['input']>;
} }
/** Response for a host group import operation. */
export interface CreateHostGroupResponse { export interface CreateHostGroupResponse {
__typename?: 'CreateHostGroupResponse'; __typename?: 'CreateHostGroupResponse';
/** Error information if the import failed. */
error?: Maybe<ApiError>; error?: Maybe<ApiError>;
/** Name of the imported host group. */
groupName: Scalars['String']['output']; groupName: Scalars['String']['output'];
/** The Zabbix group ID assigned to the group. */
groupid?: Maybe<Scalars['Int']['output']>; groupid?: Maybe<Scalars['Int']['output']>;
/** Status message for the import. */
message?: Maybe<Scalars['String']['output']>; message?: Maybe<Scalars['String']['output']>;
} }
/** Response for a single host creation operation. */
export interface CreateHostResponse { export interface CreateHostResponse {
__typename?: 'CreateHostResponse'; __typename?: 'CreateHostResponse';
/** Error information if the creation failed. */
error?: Maybe<ApiError>; error?: Maybe<ApiError>;
/** List of created host IDs. */
hostids?: Maybe<Array<Maybe<Scalars['Int']['output']>>>; hostids?: Maybe<Array<Maybe<Scalars['Int']['output']>>>;
/** List of created item IDs. */
itemids?: Maybe<Array<Maybe<Scalars['Int']['output']>>>; itemids?: Maybe<Array<Maybe<Scalars['Int']['output']>>>;
} }
/** Input for an item preprocessing step. */
export interface CreateItemPreprocessing { export interface CreateItemPreprocessing {
/** Error handling behavior. */
error_handler?: InputMaybe<Scalars['Int']['input']>; error_handler?: InputMaybe<Scalars['Int']['input']>;
/** Error handling parameters. */
error_handler_params?: InputMaybe<Scalars['String']['input']>; error_handler_params?: InputMaybe<Scalars['String']['input']>;
/** Parameters for the preprocessing step. */
params: Array<Scalars['String']['input']>; params: Array<Scalars['String']['input']>;
/** Type of preprocessing step (e.g., 12 for JSONPath, 21 for JavaScript). */
type: Scalars['Int']['input']; type: Scalars['Int']['input'];
} }
/** Reference to a template to be linked. */
export interface CreateLinkedTemplate { export interface CreateLinkedTemplate {
/** The technical name of the template to link. */
name: Scalars['String']['input']; name: Scalars['String']['input'];
} }
/** Reference to a master item for dependent items. */
export interface CreateMasterItem { export interface CreateMasterItem {
/** The technical key of the master item. */
key: Scalars['String']['input']; key: Scalars['String']['input'];
} }
/** Input for a tag. */
export interface CreateTag { export interface CreateTag {
/** Tag name. */
tag: Scalars['String']['input']; tag: Scalars['String']['input'];
/** Tag value. */
value?: InputMaybe<Scalars['String']['input']>; value?: InputMaybe<Scalars['String']['input']>;
} }
/** Input for creating or updating a template. */
export interface CreateTemplate { export interface CreateTemplate {
/** /** List of template group names to assign the template to. */
* groupNames is used to assign the created object
* to a template group.
*/
groupNames: Array<Scalars['String']['input']>; groupNames: Array<Scalars['String']['input']>;
/** /** Optionally, internal group IDs can be provided instead of group names. */
* Optionally the internal groupids can be passed - in this case the
* groupName is ignored
*/
groupids?: InputMaybe<Array<InputMaybe<Scalars['Int']['input']>>>; groupids?: InputMaybe<Array<InputMaybe<Scalars['Int']['input']>>>;
/** Name of the template */ /** Technical name of the template. */
host: Scalars['String']['input']; host: Scalars['String']['input'];
/** Template items */ /** List of items to create within the template. */
items?: InputMaybe<Array<CreateTemplateItem>>; items?: InputMaybe<Array<CreateTemplateItem>>;
/** Visible name of the template */ /** Visible name of the template. */
name?: InputMaybe<Scalars['String']['input']>; name?: InputMaybe<Scalars['String']['input']>;
/** Template tags */ /** Tags to assign to the template. */
tags?: InputMaybe<Array<CreateTag>>; tags?: InputMaybe<Array<CreateTag>>;
/** Linked templates */ /** List of other templates to link to this template. */
templates?: InputMaybe<Array<CreateLinkedTemplate>>; templates?: InputMaybe<Array<CreateLinkedTemplate>>;
/** /** Internally used unique id (will be assigned by Zabbix if empty). */
* Internally used unique id
* (will be assigned by Zabbix if empty)
*/
uuid?: InputMaybe<Scalars['String']['input']>; uuid?: InputMaybe<Scalars['String']['input']>;
} }
/** Input for creating or identifying a template group. */
export interface CreateTemplateGroup { export interface CreateTemplateGroup {
/** Name of the template group */ /** Name of the template group. */
groupName: Scalars['String']['input']; groupName: Scalars['String']['input'];
/** /** Internally used unique id (will be assigned by Zabbix if empty). */
* Internally used unique id
* (will be assigned by Zabbix if empty)
*/
uuid?: InputMaybe<Scalars['String']['input']>; uuid?: InputMaybe<Scalars['String']['input']>;
} }
/** Response for a template group import operation. */
export interface CreateTemplateGroupResponse { export interface CreateTemplateGroupResponse {
__typename?: 'CreateTemplateGroupResponse'; __typename?: 'CreateTemplateGroupResponse';
/** Error information if the import failed. */
error?: Maybe<ApiError>; error?: Maybe<ApiError>;
/** Name of the imported template group. */
groupName: Scalars['String']['output']; groupName: Scalars['String']['output'];
/** The Zabbix group ID assigned to the group. */
groupid?: Maybe<Scalars['Int']['output']>; groupid?: Maybe<Scalars['Int']['output']>;
/** Status message for the import. */
message?: Maybe<Scalars['String']['output']>; message?: Maybe<Scalars['String']['output']>;
} }
/** Input for creating an item within a template. */
export interface CreateTemplateItem { export interface CreateTemplateItem {
/** Update interval. */
delay?: InputMaybe<Scalars['String']['input']>; delay?: InputMaybe<Scalars['String']['input']>;
/** Description of the item. */
description?: InputMaybe<Scalars['String']['input']>; description?: InputMaybe<Scalars['String']['input']>;
/** History storage period (e.g., '2d', '90d'). */
history?: InputMaybe<Scalars['String']['input']>; history?: InputMaybe<Scalars['String']['input']>;
/** Technical key of the item. */
key: Scalars['String']['input']; key: Scalars['String']['input'];
/** Reference to a master item if this is a dependent item. */
master_item?: InputMaybe<CreateMasterItem>; master_item?: InputMaybe<CreateMasterItem>;
/** Name of the item. */
name: Scalars['String']['input']; name: Scalars['String']['input'];
/** Preprocessing steps for the item values. */
preprocessing?: InputMaybe<Array<CreateItemPreprocessing>>; preprocessing?: InputMaybe<Array<CreateItemPreprocessing>>;
/** Tags to assign to the item. */
tags?: InputMaybe<Array<CreateTag>>; tags?: InputMaybe<Array<CreateTag>>;
/** Zabbix item type (e.g., 0 for Zabbix Agent, 18 for Dependent). */
type?: InputMaybe<Scalars['Int']['input']>; type?: InputMaybe<Scalars['Int']['input']>;
/** Units of the value. */
units?: InputMaybe<Scalars['String']['input']>; units?: InputMaybe<Scalars['String']['input']>;
/** Internally used unique id. */
uuid?: InputMaybe<Scalars['String']['input']>; uuid?: InputMaybe<Scalars['String']['input']>;
/** Type of information (e.g., 0 for Float, 3 for Int, 4 for Text). */
value_type?: InputMaybe<Scalars['Int']['input']>; value_type?: InputMaybe<Scalars['Int']['input']>;
} }
/** Response object for delete operations. */
export interface DeleteResponse { export interface DeleteResponse {
__typename?: 'DeleteResponse'; __typename?: 'DeleteResponse';
/** Error information if the deletion failed. */
error?: Maybe<ApiError>; error?: Maybe<ApiError>;
/** ID of the deleted entity. */
id: Scalars['Int']['output']; id: Scalars['Int']['output'];
/** Status message for the delete operation. */
message?: Maybe<Scalars['String']['output']>; message?: Maybe<Scalars['String']['output']>;
} }
@ -174,24 +205,34 @@ export interface DeleteResponse {
* besides monitoring information. * besides monitoring information.
*/ */
export interface Device { export interface Device {
/** Classification of the device. */
deviceType?: Maybe<Scalars['String']['output']>; deviceType?: Maybe<Scalars['String']['output']>;
/** Per convention a uuid is used as hostname to identify devices if they do not have a unique hostname */ /** Per convention a uuid is used as hostname to identify devices if they do not have a unique hostname. */
host: Scalars['String']['output']; host: Scalars['String']['output'];
/** List of host groups this device belongs to. */
hostgroups?: Maybe<Array<HostGroup>>; hostgroups?: Maybe<Array<HostGroup>>;
/** Internal Zabbix ID of the device. */
hostid: Scalars['ID']['output']; hostid: Scalars['ID']['output'];
/** Visible name of the device. */
name?: Maybe<Scalars['String']['output']>; name?: Maybe<Scalars['String']['output']>;
/** State of the device. */
state?: Maybe<DeviceState>; state?: Maybe<DeviceState>;
/** Device configuration tags. */
tags?: Maybe<DeviceConfig>; tags?: Maybe<DeviceConfig>;
} }
export { DeviceCommunicationType }; export { DeviceCommunicationType };
/** Configuration settings for a device. */
export interface DeviceConfig { export interface DeviceConfig {
__typename?: 'DeviceConfig'; __typename?: 'DeviceConfig';
/** Configuration for the device widget preview in the cockpit. */
deviceWidgetPreview?: Maybe<WidgetPreview>; deviceWidgetPreview?: Maybe<WidgetPreview>;
} }
/** Common interface for device state. */
export interface DeviceState { export interface DeviceState {
/** Operational data (telemetry). */
operational?: Maybe<OperationalDeviceData>; operational?: Maybe<OperationalDeviceData>;
} }
@ -199,6 +240,7 @@ export { DeviceStatus };
/** Marker-interface for device-related data values. */ /** Marker-interface for device-related data values. */
export interface DeviceValue { export interface DeviceValue {
/** Dummy field to allow for empty interfaces. */
_empty?: Maybe<Scalars['String']['output']>; _empty?: Maybe<Scalars['String']['output']>;
} }
@ -238,182 +280,253 @@ export interface DeviceValueMessage {
value?: Maybe<DeviceValue>; value?: Maybe<DeviceValue>;
} }
/** Specification for a display field in a widget. */
export interface DisplayFieldSpec { export interface DisplayFieldSpec {
__typename?: 'DisplayFieldSpec'; __typename?: 'DisplayFieldSpec';
/** Value to display if the data is missing. */
emptyValue?: Maybe<Scalars['String']['output']>; emptyValue?: Maybe<Scalars['String']['output']>;
/** Optional transformation for the unit. */
g_unit_transform?: Maybe<Scalars['String']['output']>; g_unit_transform?: Maybe<Scalars['String']['output']>;
/** Optional transformation for the value. */
g_value_transform?: Maybe<Scalars['String']['output']>; g_value_transform?: Maybe<Scalars['String']['output']>;
/** Key of the data to display. */
key?: Maybe<Scalars['String']['output']>; key?: Maybe<Scalars['String']['output']>;
/** Unit string to append to the value. */
unit?: Maybe<Scalars['String']['output']>; unit?: Maybe<Scalars['String']['output']>;
/** Font size for the unit. */
unit_font_size?: Maybe<Scalars['String']['output']>; unit_font_size?: Maybe<Scalars['String']['output']>;
/** Font size for the value. */
value_font_size?: Maybe<Scalars['String']['output']>; value_font_size?: Maybe<Scalars['String']['output']>;
} }
/** Common error interface. */
export interface Error { export interface Error {
/** Error code. */
code?: Maybe<Scalars['Int']['output']>; code?: Maybe<Scalars['Int']['output']>;
/** Additional error data. */
data?: Maybe<Scalars['JSONObject']['output']>; data?: Maybe<Scalars['JSONObject']['output']>;
/** Error message. */
message?: Maybe<Scalars['String']['output']>; message?: Maybe<Scalars['String']['output']>;
} }
/** Payload for a single error or status message. */
export interface ErrorPayload { export interface ErrorPayload {
__typename?: 'ErrorPayload'; __typename?: 'ErrorPayload';
/** Additional contextual information about the error. */
additionalInfo?: Maybe<Scalars['JSONObject']['output']>; additionalInfo?: Maybe<Scalars['JSONObject']['output']>;
/** Error code. */
code: Scalars['Int']['output']; code: Scalars['Int']['output'];
/** Human-readable error message. */
message?: Maybe<Scalars['String']['output']>; message?: Maybe<Scalars['String']['output']>;
} }
/** Device represents generic IoT / Edge - devices providing their state as generic "state.current" - JSON Object */ /** Device represents generic IoT / Edge - devices providing their state as generic "state.current" - JSON Object. */
export interface GenericDevice extends Device, Host { export interface GenericDevice extends Device, Host {
__typename?: 'GenericDevice'; __typename?: 'GenericDevice';
/** Classification of the device. */
deviceType?: Maybe<Scalars['String']['output']>; deviceType?: Maybe<Scalars['String']['output']>;
/** Per convention a uuid is used as hostname to identify devices if they do not have a unique hostname */ /** Per convention a uuid is used as hostname to identify devices if they do not have a unique hostname. */
host: Scalars['String']['output']; host: Scalars['String']['output'];
/** List of host groups this device belongs to. */
hostgroups?: Maybe<Array<HostGroup>>; hostgroups?: Maybe<Array<HostGroup>>;
/** Internal Zabbix ID of the device. */
hostid: Scalars['ID']['output']; hostid: Scalars['ID']['output'];
/** Visible name of the device. */
name?: Maybe<Scalars['String']['output']>; name?: Maybe<Scalars['String']['output']>;
/** State of the generic device. */
state?: Maybe<GenericDeviceState>; state?: Maybe<GenericDeviceState>;
/** Device configuration tags. */
tags?: Maybe<DeviceConfig>; tags?: Maybe<DeviceConfig>;
} }
/** Generic implementation of device state using a JSON object for current values. */
export interface GenericDeviceState extends DeviceState { export interface GenericDeviceState extends DeviceState {
__typename?: 'GenericDeviceState'; __typename?: 'GenericDeviceState';
/** Current business data as a generic JSON object. */
current?: Maybe<Scalars['JSONObject']['output']>; current?: Maybe<Scalars['JSONObject']['output']>;
/** Operational data (telemetry). */
operational?: Maybe<OperationalDeviceData>; operational?: Maybe<OperationalDeviceData>;
} }
/** Generic response wrapper containing either the result data or an error. */
export interface GenericResponse { export interface GenericResponse {
__typename?: 'GenericResponse'; __typename?: 'GenericResponse';
/** Error information if the operation failed. */
error?: Maybe<ApiError>; error?: Maybe<ApiError>;
/** The result data, typically a list of JSON objects. */
result?: Maybe<Array<Scalars['JSONObject']['output']>>; result?: Maybe<Array<Scalars['JSONObject']['output']>>;
} }
/** Hint: WGS84[dd.ddddd] coordinates are used */ /**
* Interface for entities that have GPS coordinates.
* Hint: WGS84[dd.ddddd] coordinates are used.
*/
export interface GpsPosition { export interface GpsPosition {
/** Latitude coordinate. */
latitude?: Maybe<Scalars['Float']['output']>; latitude?: Maybe<Scalars['Float']['output']>;
/** Longitude coordinate. */
longitude?: Maybe<Scalars['Float']['output']>; longitude?: Maybe<Scalars['Float']['output']>;
} }
/** Common interface for all host-like entities in Zabbix. */
export interface Host { export interface Host {
/** /**
* Specifies the type or category of the device. Used to define the classification * Specifies the type or category of the device. Used to define the classification
* of a device in the system (capabilities, functionalities, or purpose). * of a device in the system (capabilities, functionalities, or purpose).
*/ */
deviceType?: Maybe<Scalars['String']['output']>; deviceType?: Maybe<Scalars['String']['output']>;
/** The host field contains the "hostname" in Zabbix */ /** Technical name of the host (the 'hostname' in Zabbix). */
host: Scalars['String']['output']; host: Scalars['String']['output'];
/** List of host groups this host belongs to. */
hostgroups?: Maybe<Array<HostGroup>>; hostgroups?: Maybe<Array<HostGroup>>;
/** Internal Zabbix ID of the host. */
hostid: Scalars['ID']['output']; hostid: Scalars['ID']['output'];
/** Visible name of the host. */
name?: Maybe<Scalars['String']['output']>; name?: Maybe<Scalars['String']['output']>;
} }
/** Represents a host group in Zabbix. */
export interface HostGroup { export interface HostGroup {
__typename?: 'HostGroup'; __typename?: 'HostGroup';
/** Internal Zabbix ID of the host group. */
groupid: Scalars['ID']['output']; groupid: Scalars['ID']['output'];
/** Name of the host group. */
name?: Maybe<Scalars['String']['output']>; name?: Maybe<Scalars['String']['output']>;
} }
/** Response for a host import operation. */
export interface ImportHostResponse { export interface ImportHostResponse {
__typename?: 'ImportHostResponse'; __typename?: 'ImportHostResponse';
/** The device key (technical name) of the imported host. */
deviceKey: Scalars['String']['output']; deviceKey: Scalars['String']['output'];
/** Error information if the import failed. */
error?: Maybe<ApiError>; error?: Maybe<ApiError>;
/** The Zabbix host ID assigned to the host. */
hostid?: Maybe<Scalars['String']['output']>; hostid?: Maybe<Scalars['String']['output']>;
/** Status message for the import. */
message?: Maybe<Scalars['String']['output']>; message?: Maybe<Scalars['String']['output']>;
} }
/** Response for a template import operation. */
export interface ImportTemplateResponse { export interface ImportTemplateResponse {
__typename?: 'ImportTemplateResponse'; __typename?: 'ImportTemplateResponse';
/** Error information if the import failed. */
error?: Maybe<ApiError>; error?: Maybe<ApiError>;
/** The technical name of the imported template. */
host: Scalars['String']['output']; host: Scalars['String']['output'];
/** Status message for the import. */
message?: Maybe<Scalars['String']['output']>; message?: Maybe<Scalars['String']['output']>;
/** The Zabbix template ID assigned to the template. */
templateid?: Maybe<Scalars['String']['output']>; templateid?: Maybe<Scalars['String']['output']>;
} }
/** Result of a single user right (role or group) import. */
export interface ImportUserRightResult { export interface ImportUserRightResult {
__typename?: 'ImportUserRightResult'; __typename?: 'ImportUserRightResult';
/** List of errors encountered during import. */
errors?: Maybe<Array<ApiError>>; errors?: Maybe<Array<ApiError>>;
/** The ID of the imported/updated entity. */
id?: Maybe<Scalars['String']['output']>; id?: Maybe<Scalars['String']['output']>;
/** Status message for the import. */
message?: Maybe<Scalars['String']['output']>; message?: Maybe<Scalars['String']['output']>;
/** The name of the entity. */
name?: Maybe<Scalars['String']['output']>; name?: Maybe<Scalars['String']['output']>;
} }
/** Result of a user rights import operation. */
export interface ImportUserRightsResult { export interface ImportUserRightsResult {
__typename?: 'ImportUserRightsResult'; __typename?: 'ImportUserRightsResult';
/** Results for the imported user groups. */
userGroups?: Maybe<Array<ImportUserRightResult>>; userGroups?: Maybe<Array<ImportUserRightResult>>;
/** Results for the imported user roles. */
userRoles?: Maybe<Array<ImportUserRightResult>>; userRoles?: Maybe<Array<ImportUserRightResult>>;
} }
/** Represents host inventory information. */
export interface Inventory { export interface Inventory {
__typename?: 'Inventory'; __typename?: 'Inventory';
/** Location data for the host. */
location?: Maybe<Location>; location?: Maybe<Location>;
} }
/** Represents a geographical location. */
export interface Location extends GpsPosition { export interface Location extends GpsPosition {
__typename?: 'Location'; __typename?: 'Location';
/** Latitude coordinate. */
latitude?: Maybe<Scalars['Float']['output']>; latitude?: Maybe<Scalars['Float']['output']>;
/** Longitude coordinate. */
longitude?: Maybe<Scalars['Float']['output']>; longitude?: Maybe<Scalars['Float']['output']>;
/** Name of the location. */
name?: Maybe<Scalars['String']['output']>; name?: Maybe<Scalars['String']['output']>;
} }
/** Input for host location information. */
export interface LocationInput { export interface LocationInput {
/** Latitude coordinate. */
location_lat?: InputMaybe<Scalars['String']['input']>; location_lat?: InputMaybe<Scalars['String']['input']>;
/** Longitude coordinate. */
location_lon?: InputMaybe<Scalars['String']['input']>; location_lon?: InputMaybe<Scalars['String']['input']>;
/** Name of the location. */
name?: InputMaybe<Scalars['String']['input']>; name?: InputMaybe<Scalars['String']['input']>;
} }
export interface Mutation { export interface Mutation {
__typename?: 'Mutation'; __typename?: 'Mutation';
/** Authentication: By zbx_session - cookie or zabbix-auth-token - header */ /**
* Creates a single host in Zabbix.
*
* Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
*/
createHost?: Maybe<CreateHostResponse>; createHost?: Maybe<CreateHostResponse>;
/** /**
* Delete template groups. * Delete template groups by their IDs or by a name pattern.
* *
* Authentication: By zbx_session - cookie or zabbix-auth-token - header * Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
*/ */
deleteTemplateGroups?: Maybe<Array<DeleteResponse>>; deleteTemplateGroups?: Maybe<Array<DeleteResponse>>;
/** /**
* Delete templates. * Delete templates by their IDs or by a name pattern.
* *
* Authentication: By zbx_session - cookie or zabbix-auth-token - header * Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
*/ */
deleteTemplates?: Maybe<Array<DeleteResponse>>; deleteTemplates?: Maybe<Array<DeleteResponse>>;
/** /**
* (Mass) Import zabbix groups * (Mass) Import Zabbix host groups and assign them to the corresponding hosts by groupid or groupName.
* and assign them to the corresponding hosts by groupid or groupName.
* *
* Return value: If no error occurs a groupid be returned for each created group, * Return value: If no error occurs, a groupid is returned for each created group; otherwise, the return object contains an error message.
* otherwise the return object will contain an error message
* *
* Authentication: By zbx_session - cookie or zabbix-auth-token - header * Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
*/ */
importHostGroups?: Maybe<Array<CreateHostGroupResponse>>; importHostGroups?: Maybe<Array<CreateHostGroupResponse>>;
/** /**
* (Mass) Import hosts and assign them to host groups by groupid or groupName. * (Mass) Import hosts and assign them to host groups by groupid or groupName.
* *
* Return value: If no error occurs a hostid will be returned for each created host, * Return value: If no error occurs, a hostid is returned for each created host; otherwise, the return object contains an error message.
* otherwise the return object will contain an error message.
* *
* Authentication: By zbx_session - cookie or zabbix-auth-token - header * Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
*/ */
importHosts?: Maybe<Array<ImportHostResponse>>; importHosts?: Maybe<Array<ImportHostResponse>>;
/** /**
* (Mass) Import template groups * (Mass) Import template groups and assign them by groupid or name.
* and assign them by groupid or name.
* *
* Return value: If no error occurs a groupid be returned for each created group, * Return value: If no error occurs, a groupid is returned for each created group; otherwise, the return object contains an error message.
* otherwise the return object will contain an error message
* *
* Authentication: By zbx_session - cookie or zabbix-auth-token - header * Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
*/ */
importTemplateGroups?: Maybe<Array<CreateTemplateGroupResponse>>; importTemplateGroups?: Maybe<Array<CreateTemplateGroupResponse>>;
/** /**
* (Mass) Import templates. * (Mass) Import templates.
* *
* Return value: If no error occurs a templateid will be returned for each created template, * Return value: If no error occurs, a templateid is returned for each created template; otherwise, the return object contains an error message.
* otherwise the return object will contain an error message.
* *
* Authentication: By zbx_session - cookie or zabbix-auth-token - header * Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
*/ */
importTemplates?: Maybe<Array<ImportTemplateResponse>>; importTemplates?: Maybe<Array<ImportTemplateResponse>>;
/**
* Import user rights (roles and groups) into Zabbix.
*
* Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
*/
importUserRights?: Maybe<ImportUserRightsResult>; importUserRights?: Maybe<ImportUserRightsResult>;
} }
@ -463,103 +576,92 @@ export interface MutationImportUserRightsArgs {
input: UserRightsInput; input: UserRightsInput;
} }
/** Operational data common to most devices. */
export interface OperationalDeviceData { export interface OperationalDeviceData {
__typename?: 'OperationalDeviceData'; __typename?: 'OperationalDeviceData';
/** List of active errors or status messages. */
error?: Maybe<Array<ErrorPayload>>; error?: Maybe<Array<ErrorPayload>>;
/** Current location of the device. */
location?: Maybe<Location>; location?: Maybe<Location>;
/** Signal strength (e.g., WiFi or GSM). */
signalstrength?: Maybe<Scalars['Float']['output']>; signalstrength?: Maybe<Scalars['Float']['output']>;
/** Device temperature. */
temperature?: Maybe<Scalars['Float']['output']>; temperature?: Maybe<Scalars['Float']['output']>;
/** Timestamp of the operational data. */
timestamp?: Maybe<Scalars['DateTime']['output']>; timestamp?: Maybe<Scalars['DateTime']['output']>;
/** Device voltage. */
voltage?: Maybe<Scalars['Float']['output']>; voltage?: Maybe<Scalars['Float']['output']>;
} }
export { Permission }; export { Permission };
/** Request for checking specific user permissions. */
export interface PermissionRequest { export interface PermissionRequest {
/** /**
* objectName maps to name / path suffix of the template group representing the permission in Zabbix: * objectName maps to name / path suffix of the template group representing the permission in Zabbix:
* Permissions/{objectName} * Permissions/{objectName}
*/ */
objectName: Scalars['String']['input']; objectName: Scalars['String']['input'];
/** The required permission level (DENY, READ, or READ_WRITE). */
permission: Permission; permission: Permission;
} }
export interface Query { export interface Query {
__typename?: 'Query'; __typename?: 'Query';
/** /**
* Get all devices + corresponding items. Devices are modelled as hosts having a device type + a state. * Returns all devices and their items. Devices are hosts with a `deviceType` and a state.
* If with_items==true only hosts with attached items are delivered
* name_pattern: If provided this will perform a LIKE "%…%" search on the name attribute within the database.
* *
* Authentication: By zbx_session - cookie or zabbix-auth-token - header * Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
*/ */
allDevices?: Maybe<Array<Maybe<Device>>>; allDevices?: Maybe<Array<Maybe<Device>>>;
/** /**
* Get all host groups. * Returns all host groups.
* If with_hosts==true only groups with attached hosts are delivered.
* *
* Authentication: By zbx_session - cookie or zabbix-auth-token - header * Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
*/ */
allHostGroups?: Maybe<Array<Maybe<HostGroup>>>; allHostGroups?: Maybe<Array<Maybe<HostGroup>>>;
/** /**
* Get all hosts + corresponding items. If with_items==true only hosts with attached items are delivered * Returns all hosts and their items.
* name_pattern: If provided this will perform a LIKE "%…%" search on the name attribute within the database.
* *
* Authentication: By zbx_session - cookie or zabbix-auth-token - header * Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
*/ */
allHosts?: Maybe<Array<Maybe<Host>>>; allHosts?: Maybe<Array<Maybe<Host>>>;
/** Get template groups. */ /** Returns all template groups. */
allTemplateGroups?: Maybe<Array<Maybe<HostGroup>>>; allTemplateGroups?: Maybe<Array<Maybe<HostGroup>>>;
/** Get api (build) version */ /** Returns the API build version. */
apiVersion: Scalars['String']['output']; apiVersion: Scalars['String']['output'];
/** /**
* Export history from Zabbix items * Exports value history for Zabbix items.
* *
* Authentication: By zbx_session - cookie or zabbix-auth-token - header * Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
*/ */
exportHostValueHistory?: Maybe<GenericResponse>; exportHostValueHistory?: Maybe<GenericResponse>;
/** /** Exports user rights (roles and groups). */
* name_pattern: If provided this will perform a LIKE "%…%" search on the name attribute within the database.
* exclude_groups_pattern: Regex allowing to exclude all matching hostgroups from group permissions
*/
exportUserRights?: Maybe<UserRights>; exportUserRights?: Maybe<UserRights>;
/** /** Checks if the current user has the requested permissions. */
* Return true if and only if the current user (identified by token / cookie)
* has all requested permissions (minimum - if READ is requested and the user has READ_WRITE
* the response will be true)
*/
hasPermissions?: Maybe<Scalars['Boolean']['output']>; hasPermissions?: Maybe<Scalars['Boolean']['output']>;
/** /**
* Get all locations used by hosts. * Returns all locations used by hosts.
* distinct_by_name=true means that the result is filtered for distinct names (default)
* name_pattern: If provided this will perform a Regex search on the name attribute within the database.
* *
* Authentication: By zbx_session - cookie or zabbix-auth-token - header * Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
*/ */
locations?: Maybe<Array<Maybe<Location>>>; locations?: Maybe<Array<Maybe<Location>>>;
/** /**
* Login to zabbix - provided for debugging and testing purpose. The result of the login operation is * Logs in to Zabbix. This is primarily for debugging and testing.
* authentication token returned may be passed as * The returned authentication token can be passed in the `zabbix-auth-token` header for future requests.
* header 'zabbix-auth-token' for authenticating future API requests. * Alternatively, the `zbx_session` cookie can be used for authentication.
* As an alternative to the cookie 'zbx_session' may be set which is automatically set after login to
* the cockpit - this is the standard way to authenticate api calls initiated by the cockpit frontend
* because the frontend is always embedded into the Zabbix portal which is only accessible after logging in and
* obtainind the zbx_session - cookie.
*/ */
login?: Maybe<Scalars['String']['output']>; login?: Maybe<Scalars['String']['output']>;
/** /** Logs out from Zabbix, invalidating the current session/token. */
* Logout from zabbix - provided for debugging and testing purpose. This invalidates the token received by the login
* operation. Returns true on success
*/
logout?: Maybe<Scalars['Boolean']['output']>; logout?: Maybe<Scalars['Boolean']['output']>;
/** Get templates. */ /** Returns templates. */
templates?: Maybe<Array<Maybe<Template>>>; templates?: Maybe<Array<Maybe<Template>>>;
/** /**
* Return all user permissions. If objectNames is provided return only the permissions related to the objects within * Returns all user permissions.
* the objectNames - list * If `objectNames` is provided, returns only the permissions related to those objects.
*/ */
userPermissions?: Maybe<Array<UserPermission>>; userPermissions?: Maybe<Array<UserPermission>>;
/** Get zabbix version */ /** Returns the version of the connected Zabbix instance. */
zabbixVersion?: Maybe<Scalars['String']['output']>; zabbixVersion?: Maybe<Scalars['String']['output']>;
} }
@ -651,30 +753,47 @@ export enum SortOrder {
export { StorageItemType }; export { StorageItemType };
/** Represents a Zabbix template. */
export interface Template { export interface Template {
__typename?: 'Template'; __typename?: 'Template';
/** Name of the template. */
name?: Maybe<Scalars['String']['output']>; name?: Maybe<Scalars['String']['output']>;
/** Internal Zabbix ID of the template. */
templateid: Scalars['String']['output']; templateid: Scalars['String']['output'];
} }
/** Represents a Zabbix user group. */
export interface UserGroup { export interface UserGroup {
__typename?: 'UserGroup'; __typename?: 'UserGroup';
/** Frontend access level. */
gui_access?: Maybe<Scalars['Int']['output']>; gui_access?: Maybe<Scalars['Int']['output']>;
/** Permissions for host groups. */
hostgroup_rights?: Maybe<Array<ZabbixGroupRight>>; hostgroup_rights?: Maybe<Array<ZabbixGroupRight>>;
/** Name of the user group. */
name: Scalars['String']['output']; name: Scalars['String']['output'];
/** Permissions for template groups. */
templategroup_rights?: Maybe<Array<ZabbixGroupRight>>; templategroup_rights?: Maybe<Array<ZabbixGroupRight>>;
/** Status of users in the group. */
users_status?: Maybe<Scalars['Int']['output']>; users_status?: Maybe<Scalars['Int']['output']>;
/** Internal Zabbix ID of the user group. */
usrgrpid: Scalars['Int']['output']; usrgrpid: Scalars['Int']['output'];
} }
/** Input for a user group. */
export interface UserGroupInput { export interface UserGroupInput {
/** Frontend access level. */
gui_access?: InputMaybe<Scalars['Int']['input']>; gui_access?: InputMaybe<Scalars['Int']['input']>;
/** Permissions for host groups. */
hostgroup_rights?: InputMaybe<Array<ZabbixGroupRightInput>>; hostgroup_rights?: InputMaybe<Array<ZabbixGroupRightInput>>;
/** Name of the user group. */
name: Scalars['String']['input']; name: Scalars['String']['input'];
/** Permissions for template groups. */
templategroup_rights?: InputMaybe<Array<ZabbixGroupRightInput>>; templategroup_rights?: InputMaybe<Array<ZabbixGroupRightInput>>;
/** Status of the users in the group. */
users_status?: InputMaybe<Scalars['Int']['input']>; users_status?: InputMaybe<Scalars['Int']['input']>;
} }
/** Represents a permission assigned to a user for a specific object. */
export interface UserPermission { export interface UserPermission {
__typename?: 'UserPermission'; __typename?: 'UserPermission';
/** /**
@ -682,118 +801,179 @@ export interface UserPermission {
* Permissions/{objectName} * Permissions/{objectName}
*/ */
objectName: Scalars['String']['output']; objectName: Scalars['String']['output'];
/** The assigned permission level. */
permission: Permission; permission: Permission;
} }
/** Represents the combined user rights (groups and roles). */
export interface UserRights { export interface UserRights {
__typename?: 'UserRights'; __typename?: 'UserRights';
/** List of user groups. */
userGroups?: Maybe<Array<UserGroup>>; userGroups?: Maybe<Array<UserGroup>>;
/** List of user roles. */
userRoles?: Maybe<Array<UserRole>>; userRoles?: Maybe<Array<UserRole>>;
} }
/** Input for importing user rights. */
export interface UserRightsInput { export interface UserRightsInput {
/** List of user groups to import. */
userGroups?: InputMaybe<Array<UserGroupInput>>; userGroups?: InputMaybe<Array<UserGroupInput>>;
/** List of user roles to import. */
userRoles?: InputMaybe<Array<UserRoleInput>>; userRoles?: InputMaybe<Array<UserRoleInput>>;
} }
/** Represents a Zabbix user role. */
export interface UserRole { export interface UserRole {
__typename?: 'UserRole'; __typename?: 'UserRole';
/** Name of the role. */
name?: Maybe<Scalars['String']['output']>; name?: Maybe<Scalars['String']['output']>;
/** Whether the role is read-only. */
readonly?: Maybe<Scalars['Int']['output']>; readonly?: Maybe<Scalars['Int']['output']>;
/** Internal Zabbix ID of the role. */
roleid: Scalars['Int']['output']; roleid: Scalars['Int']['output'];
/** Rules assigned to the role. */
rules?: Maybe<UserRoleRules>; rules?: Maybe<UserRoleRules>;
/** Type of the role. */
type?: Maybe<Scalars['Int']['output']>; type?: Maybe<Scalars['Int']['output']>;
} }
/** Input for a user role. */
export interface UserRoleInput { export interface UserRoleInput {
/** Name of the role. */
name?: InputMaybe<Scalars['String']['input']>; name?: InputMaybe<Scalars['String']['input']>;
/** Whether the role is read-only (1) or not (0). */
readonly?: InputMaybe<Scalars['Int']['input']>; readonly?: InputMaybe<Scalars['Int']['input']>;
/** Specific rules for the role. */
rules?: InputMaybe<UserRoleRulesInput>; rules?: InputMaybe<UserRoleRulesInput>;
/** Type of role (e.g., 1 for User, 2 for Admin, 3 for Super Admin). */
type?: InputMaybe<Scalars['Int']['input']>; type?: InputMaybe<Scalars['Int']['input']>;
} }
/** Represents a module assigned to a user role. */
export interface UserRoleModule { export interface UserRoleModule {
__typename?: 'UserRoleModule'; __typename?: 'UserRoleModule';
/** Technical ID of the module. */
id?: Maybe<Scalars['String']['output']>; id?: Maybe<Scalars['String']['output']>;
/** Internal Zabbix module ID. */
moduleid?: Maybe<Scalars['String']['output']>; moduleid?: Maybe<Scalars['String']['output']>;
/** Relative path to the module. */
relative_path?: Maybe<Scalars['String']['output']>; relative_path?: Maybe<Scalars['String']['output']>;
/** Status of the module. */
status?: Maybe<Scalars['Int']['output']>; status?: Maybe<Scalars['Int']['output']>;
} }
/** Input for user role module access. */
export interface UserRoleModuleInput { export interface UserRoleModuleInput {
/** Technical ID of the module. */
id?: InputMaybe<Scalars['String']['input']>; id?: InputMaybe<Scalars['String']['input']>;
/** The internal Zabbix module ID. */
moduleid?: InputMaybe<Scalars['String']['input']>; moduleid?: InputMaybe<Scalars['String']['input']>;
/** Status of the module. */
status?: InputMaybe<Scalars['Int']['input']>; status?: InputMaybe<Scalars['Int']['input']>;
} }
/** Represents a single rule within a user role. */
export interface UserRoleRule { export interface UserRoleRule {
__typename?: 'UserRoleRule'; __typename?: 'UserRoleRule';
/** Name of the rule. */
name?: Maybe<Scalars['String']['output']>; name?: Maybe<Scalars['String']['output']>;
/** Status of the rule. */
status?: Maybe<Scalars['Int']['output']>; status?: Maybe<Scalars['Int']['output']>;
} }
/** Input for a single user role rule. */
export interface UserRoleRuleInput { export interface UserRoleRuleInput {
/** Name of the rule/element. */
name?: InputMaybe<Scalars['String']['input']>; name?: InputMaybe<Scalars['String']['input']>;
/** Status (e.g., 1 for enabled, 0 for disabled). */
status?: InputMaybe<Scalars['Int']['input']>; status?: InputMaybe<Scalars['Int']['input']>;
} }
/** Represents the rules assigned to a user role. */
export interface UserRoleRules { export interface UserRoleRules {
__typename?: 'UserRoleRules'; __typename?: 'UserRoleRules';
/** Action rules. */
actions?: Maybe<Array<UserRoleRule>>; actions?: Maybe<Array<UserRoleRule>>;
/** Default access for actions. */
actions_default_access?: Maybe<Scalars['Int']['output']>; actions_default_access?: Maybe<Scalars['Int']['output']>;
/** List of API methods allowed/denied. */
api?: Maybe<Array<Scalars['String']['output']>>; api?: Maybe<Array<Scalars['String']['output']>>;
/** Whether API access is enabled. */
api_access?: Maybe<Scalars['Int']['output']>; api_access?: Maybe<Scalars['Int']['output']>;
/** API mode. */
api_mode?: Maybe<Scalars['Int']['output']>; api_mode?: Maybe<Scalars['Int']['output']>;
/** Module access rules. */
modules?: Maybe<Array<UserRoleModule>>; modules?: Maybe<Array<UserRoleModule>>;
/** Default access for modules. */
modules_default_access?: Maybe<Scalars['Int']['output']>; modules_default_access?: Maybe<Scalars['Int']['output']>;
/** UI access rules. */
ui?: Maybe<Array<UserRoleRule>>; ui?: Maybe<Array<UserRoleRule>>;
/** Default access for UI elements. */
ui_default_access?: Maybe<Scalars['Int']['output']>; ui_default_access?: Maybe<Scalars['Int']['output']>;
} }
/** Input for user role rules. */
export interface UserRoleRulesInput { export interface UserRoleRulesInput {
/** Action rules. */
actions?: InputMaybe<Array<UserRoleRuleInput>>; actions?: InputMaybe<Array<UserRoleRuleInput>>;
/** Default access for actions. */
actions_default_access?: InputMaybe<Scalars['Int']['input']>; actions_default_access?: InputMaybe<Scalars['Int']['input']>;
/** List of API methods allowed/denied. */
api?: InputMaybe<Array<Scalars['String']['input']>>; api?: InputMaybe<Array<Scalars['String']['input']>>;
/** Whether API access is enabled (1) or not (0). */
api_access?: InputMaybe<Scalars['Int']['input']>; api_access?: InputMaybe<Scalars['Int']['input']>;
/** API mode (e.g., 0 for white-list, 1 for black-list). */
api_mode?: InputMaybe<Scalars['Int']['input']>; api_mode?: InputMaybe<Scalars['Int']['input']>;
/** Module access rules. */
modules?: InputMaybe<Array<UserRoleModuleInput>>; modules?: InputMaybe<Array<UserRoleModuleInput>>;
/** Default access for modules. */
modules_default_access?: InputMaybe<Scalars['Int']['input']>; modules_default_access?: InputMaybe<Scalars['Int']['input']>;
/** UI access rules. */
ui?: InputMaybe<Array<UserRoleRuleInput>>; ui?: InputMaybe<Array<UserRoleRuleInput>>;
/** Default access for UI elements. */
ui_default_access?: InputMaybe<Scalars['Int']['input']>; ui_default_access?: InputMaybe<Scalars['Int']['input']>;
} }
/** Represents the configuration for a 4-field widget preview. */
export interface WidgetPreview { export interface WidgetPreview {
__typename?: 'WidgetPreview'; __typename?: 'WidgetPreview';
/** Bottom-left field specification. */
BOTTOM_LEFT?: Maybe<DisplayFieldSpec>; BOTTOM_LEFT?: Maybe<DisplayFieldSpec>;
/** Bottom-right field specification. */
BOTTOM_RIGHT?: Maybe<DisplayFieldSpec>; BOTTOM_RIGHT?: Maybe<DisplayFieldSpec>;
/** Top-left field specification. */
TOP_LEFT?: Maybe<DisplayFieldSpec>; TOP_LEFT?: Maybe<DisplayFieldSpec>;
/** Top-right field specification. */
TOP_RIGHT?: Maybe<DisplayFieldSpec>; TOP_RIGHT?: Maybe<DisplayFieldSpec>;
} }
/** Represents a specific permission right for a group. */
export interface ZabbixGroupRight { export interface ZabbixGroupRight {
__typename?: 'ZabbixGroupRight'; __typename?: 'ZabbixGroupRight';
/** ID of the group the right applies to. */
id: Scalars['Int']['output']; id: Scalars['Int']['output'];
/** Name of the group. */
name?: Maybe<Scalars['String']['output']>; name?: Maybe<Scalars['String']['output']>;
/** Assigned permission level. */
permission?: Maybe<Permission>; permission?: Maybe<Permission>;
/** Unique ID of the group. */
uuid?: Maybe<Scalars['String']['output']>; uuid?: Maybe<Scalars['String']['output']>;
} }
/** Input for a Zabbix group permission right. */
export interface ZabbixGroupRightInput { export interface ZabbixGroupRightInput {
/** /**
* name may optionally be specified for documentation purpose, * Name may optionally be specified for documentation purpose,
* but the master for setting the user right is the uuid. * but the master for setting the user right is the uuid.
* If a uuid is found and the corresponding group
* has a deviating name this will be documented within a message
* with errorcode = 0 (OK) but the permission will be set (
* the reason is that names for groups may deviate between several
* instances of the control center although the semantic is the same -
* while the semantic is identified by uuid.
*/ */
name?: InputMaybe<Scalars['String']['input']>; name?: InputMaybe<Scalars['String']['input']>;
/** The permission level to assign. */
permission?: InputMaybe<Permission>; permission?: InputMaybe<Permission>;
/** The unique ID of the group. */
uuid?: InputMaybe<Scalars['String']['input']>; uuid?: InputMaybe<Scalars['String']['input']>;
} }
/** Concrete implementation of a Zabbix host. */
export interface ZabbixHost extends Host { export interface ZabbixHost extends Host {
__typename?: 'ZabbixHost'; __typename?: 'ZabbixHost';
/** /**
@ -801,28 +981,48 @@ export interface ZabbixHost extends Host {
* of a device in the system (capabilities, functionalities, or purpose). * of a device in the system (capabilities, functionalities, or purpose).
*/ */
deviceType?: Maybe<Scalars['String']['output']>; deviceType?: Maybe<Scalars['String']['output']>;
/** Technical name of the host. */
host: Scalars['String']['output']; host: Scalars['String']['output'];
/** List of host groups this host belongs to. */
hostgroups?: Maybe<Array<HostGroup>>; hostgroups?: Maybe<Array<HostGroup>>;
/** Internal Zabbix ID of the host. */
hostid: Scalars['ID']['output']; hostid: Scalars['ID']['output'];
/** Host inventory data. */
inventory?: Maybe<Inventory>; inventory?: Maybe<Inventory>;
/** List of monitored items for this host. */
items?: Maybe<Array<ZabbixItem>>; items?: Maybe<Array<ZabbixItem>>;
/** Visible name of the host. */
name?: Maybe<Scalars['String']['output']>; name?: Maybe<Scalars['String']['output']>;
/** List of templates linked to this host. */
parentTemplates?: Maybe<Array<Template>>; parentTemplates?: Maybe<Array<Template>>;
/** Tags assigned to the host as a JSON object. */
tags?: Maybe<Scalars['JSONObject']['output']>; tags?: Maybe<Scalars['JSONObject']['output']>;
} }
/** Represents a Zabbix item (a single data point being monitored). */
export interface ZabbixItem { export interface ZabbixItem {
__typename?: 'ZabbixItem'; __typename?: 'ZabbixItem';
/** Attribute name if this item is part of a hierarchical mapping. */
attributeName?: Maybe<Scalars['String']['output']>; attributeName?: Maybe<Scalars['String']['output']>;
/** Internal Zabbix ID of the host this item belongs to. */
hostid?: Maybe<Scalars['Int']['output']>; hostid?: Maybe<Scalars['Int']['output']>;
/** Hosts that this item is linked to. */
hosts?: Maybe<Array<Host>>; hosts?: Maybe<Array<Host>>;
/** Internal Zabbix ID of the item. */
itemid: Scalars['Int']['output']; itemid: Scalars['Int']['output'];
/** Technical key of the item. */
key_: Scalars['String']['output']; key_: Scalars['String']['output'];
/** Unix timestamp of the last time the item value was updated. */
lastclock?: Maybe<Scalars['Int']['output']>; lastclock?: Maybe<Scalars['Int']['output']>;
/** Last value retrieved for this item. */
lastvalue?: Maybe<Scalars['String']['output']>; lastvalue?: Maybe<Scalars['String']['output']>;
/** Visible name of the item. */
name: Scalars['String']['output']; name: Scalars['String']['output'];
/** Status of the item (ENABLED or DISABLED). */
status?: Maybe<DeviceStatus>; status?: Maybe<DeviceStatus>;
/** Communication type used by the item. */
type?: Maybe<DeviceCommunicationType>; type?: Maybe<DeviceCommunicationType>;
/** Type of information (e.g., 0 for Float, 3 for Int, 4 for Text). */
value_type: Scalars['Int']['output']; value_type: Scalars['Int']['output'];
} }