81 lines
1.8 KiB
GraphQL
81 lines
1.8 KiB
GraphQL
|
|
"""
|
|
(IoT / Edge - ) Devices are hosts having a state containing the "output" / the business data which is exposed
|
|
besides monitoring information.
|
|
"""
|
|
interface Device implements Host {
|
|
hostid: ID!
|
|
"""
|
|
Per convention a uuid is used as hostname to identify devices if they do not have a unique hostname
|
|
"""
|
|
host: String!
|
|
deviceType: String
|
|
hostgroups: [HostGroup!]
|
|
name: String
|
|
tags: DeviceConfig
|
|
state: DeviceState
|
|
}
|
|
|
|
type DeviceConfig {
|
|
deviceWidgetPreview: WidgetPreview
|
|
}
|
|
|
|
type WidgetPreview {
|
|
TOP_LEFT: DisplayFieldSpec
|
|
TOP_RIGHT: DisplayFieldSpec
|
|
BOTTOM_LEFT: DisplayFieldSpec
|
|
BOTTOM_RIGHT: DisplayFieldSpec
|
|
}
|
|
|
|
type DisplayFieldSpec {
|
|
key: String,
|
|
emptyValue: String
|
|
unit: String,
|
|
value_font_size: String
|
|
g_value_transform: String
|
|
unit_font_size: String
|
|
g_unit_transform: String
|
|
}
|
|
|
|
type OperationalDeviceData {
|
|
temperature: Float
|
|
voltage: Float
|
|
signalstrength: Float
|
|
location: Location
|
|
timestamp: DateTime
|
|
error: [ErrorPayload!]
|
|
}
|
|
|
|
type ErrorPayload {
|
|
code: Int!
|
|
message: String
|
|
additionalInfo: JSONObject
|
|
}
|
|
|
|
interface DeviceState {
|
|
operational: OperationalDeviceData
|
|
}
|
|
|
|
# Generic IoT devices with "generic" current state - mapping all "values"
|
|
type GenericDeviceState implements DeviceState {
|
|
operational: OperationalDeviceData
|
|
current: JSONObject
|
|
}
|
|
|
|
|
|
"""
|
|
Device represents generic IoT / Edge - devices providing their state as generic "state.current" - JSON Object
|
|
"""
|
|
type GenericDevice implements Host & Device {
|
|
hostid: ID!
|
|
"""
|
|
Per convention a uuid is used as hostname to identify devices if they do not have a unique hostname
|
|
"""
|
|
host: String!
|
|
deviceType: String
|
|
hostgroups: [HostGroup!]
|
|
name: String
|
|
tags: DeviceConfig
|
|
state: GenericDeviceState
|
|
}
|
|
|