github.com/simpleiot/simpleiot@v0.18.3/data/schema.go (about)

     1  package data
     2  
     3  // define common node and point types that have special meaning in
     4  // the system.
     5  const (
     6  	// general point types
     7  	PointTypeChannel      = "channel"
     8  	PointTypeDevice       = "device"
     9  	PointTypeDescription  = "description"
    10  	PointTypeFilePath     = "filePath"
    11  	PointTypeNodeType     = "nodeType"
    12  	PointTypeTombstone    = "tombstone"
    13  	PointTypeScale        = "scale"
    14  	PointTypeOffset       = "offset"
    15  	PointTypeUnits        = "units"
    16  	PointTypeValue        = "value"
    17  	PointTypeValueSet     = "valueSet"
    18  	PointTypeIndex        = "index"
    19  	PointTypeTagPointType = "tagPointType"
    20  	PointTypeTag          = "tag"
    21  	// PointTypeID typically refers to Node ID
    22  	PointTypeID                 = "id"
    23  	PointTypeDebug              = "debug"
    24  	PointTypeInitialized        = "initialized"
    25  	PointTypePollPeriod         = "pollPeriod"
    26  	PointTypeError              = "error"
    27  	PointTypeErrorCount         = "errorCount"
    28  	PointTypeErrorCountReset    = "errorCountReset"
    29  	PointTypeErrorCountEOF      = "errorCountEOF"
    30  	PointTypeErrorCountEOFReset = "errorCountEOFReset"
    31  	PointTypeErrorCountCRC      = "errorCountCRC"
    32  	PointTypeErrorCountCRCReset = "errorCountCRCReset"
    33  	PointTypeErrorCountHR       = "errorCountHR"
    34  	PointTypeErrorCountResetHR  = "errorCountResetHR"
    35  	PointTypeSyncCount          = "syncCount"
    36  	PointTypeSyncCountReset     = "syncCountReset"
    37  	PointTypeReadOnly           = "readOnly"
    38  	PointTypeURI                = "uri"
    39  	PointTypeDisabled           = "disabled"
    40  	PointTypeControlled         = "controlled"
    41  
    42  	PointTypePeriod = "period"
    43  
    44  	// An device node describes an phyical device -- it may be the
    45  	// cloud server, gateway, etc
    46  	NodeTypeDevice         = "device"
    47  	PointTypeCmdPending    = "cmdPending"
    48  	PointTypeSwUpdateState = "swUpdateState"
    49  	PointTypeStartApp      = "startApp"
    50  	PointTypeStartSystem   = "startSystem"
    51  	PointTypeUpdateOS      = "updateOS"
    52  	PointTypeUpdateApp     = "updateApp"
    53  	PointTypeSysState      = "sysState"
    54  
    55  	PointValueSysStateUnknown  = "unknown"
    56  	PointValueSysStatePowerOff = "powerOff"
    57  	PointValueSysStateOffline  = "offline"
    58  	PointValueSysStateOnline   = "online"
    59  
    60  	PointTypeSwUpdateRunning      = "swUpdateRunning"
    61  	PointTypeSwUpdateError        = "swUpdateError"
    62  	PointTypeSwUpdatePercComplete = "swUpdatePercComplete"
    63  	PointTypeVersionOS            = "versionOS"
    64  	PointTypeVersionApp           = "versionApp"
    65  	PointTypeVersionHW            = "versionHW"
    66  
    67  	// user node describes a system user and is used to control
    68  	// access to the system (typically through web UI)
    69  	NodeTypeUser       = "user"
    70  	PointTypeFirstName = "firstName"
    71  	PointTypeLastName  = "lastName"
    72  	PointTypePhone     = "phone"
    73  	PointTypeEmail     = "email"
    74  	PointTypePass      = "pass"
    75  
    76  	// user edge points
    77  	PointTypeRole       = "role"
    78  	PointValueRoleAdmin = "admin"
    79  	PointValueRoleUser  = "user"
    80  
    81  	// User Authentication
    82  	NodeTypeJWT    = "jwt"
    83  	PointTypeToken = "token"
    84  
    85  	// modbus nodes
    86  	// in modbus land, terminology is a big backwards, client is master,
    87  	// and server is slave.
    88  	NodeTypeModbus = "modbus"
    89  
    90  	PointTypeClientServer = "clientServer"
    91  	PointValueClient      = "client"
    92  	PointValueServer      = "server"
    93  
    94  	PointTypePort   = "port"
    95  	PointTypeBaud   = "baud"
    96  	PointTypeHRDest = "hrDest"
    97  
    98  	PointTypeProtocol = "protocol"
    99  	PointValueRTU     = "RTU"
   100  	PointValueTCP     = "TCP"
   101  
   102  	NodeTypeModbusIO = "modbusIo"
   103  
   104  	// FIXME, should we change modbusIoType to ioType?
   105  	PointTypeModbusIOType           = "modbusIoType"
   106  	PointValueModbusDiscreteInput   = "modbusDiscreteInput"
   107  	PointValueModbusCoil            = "modbusCoil"
   108  	PointValueModbusInputRegister   = "modbusInputRegister"
   109  	PointValueModbusHoldingRegister = "modbusHoldingRegister"
   110  
   111  	PointTypeDataFormat = "dataFormat"
   112  	PointValueUINT16    = "uint16"
   113  	PointValueINT16     = "int16"
   114  	PointValueUINT32    = "uint32"
   115  	PointValueINT32     = "int32"
   116  	PointValueFLOAT32   = "float32"
   117  
   118  	NodeTypeOneWire   = "oneWire"
   119  	NodeTypeOneWireIO = "oneWireIO"
   120  
   121  	// A group node is used to group users and devices
   122  	// or generally to add structure to the node graph.
   123  	NodeTypeGroup = "group"
   124  
   125  	NodeTypeDb = "db"
   126  
   127  	PointTypeBucket = "bucket"
   128  	PointTypeOrg    = "org"
   129  
   130  	// a rule node describes a rule that may run on the system
   131  	NodeTypeRule = "rule"
   132  
   133  	PointTypeActive = "active"
   134  
   135  	NodeTypeCondition = "condition"
   136  
   137  	PointTypeConditionType = "conditionType"
   138  	PointValuePointValue   = "pointValue"
   139  	PointValueSchedule     = "schedule"
   140  
   141  	PointTypeNodeID = "nodeID"
   142  
   143  	PointTypeTrigger = "trigger"
   144  
   145  	PointTypeStart   = "start"
   146  	PointTypeEnd     = "end"
   147  	PointTypeWeekday = "weekday"
   148  	PointTypeDate    = "date"
   149  
   150  	PointTypePointID    = "pointID"
   151  	PointTypePointKey   = "pointKey"
   152  	PointTypePointType  = "pointType"
   153  	PointTypePointIndex = "pointIndex"
   154  	PointTypeValueType  = "valueType"
   155  	PointValueNumber    = "number"
   156  	PointValueOnOff     = "onOff"
   157  	PointValueText      = "text"
   158  
   159  	PointTypeOperator     = "operator"
   160  	PointValueGreaterThan = ">"
   161  	PointValueLessThan    = "<"
   162  	PointValueEqual       = "="
   163  	PointValueNotEqual    = "!="
   164  	PointValueOn          = "on"
   165  	PointValueOff         = "off"
   166  	PointValueContains    = "contains"
   167  
   168  	PointTypeValueText = "valueText"
   169  
   170  	PointTypeMinActive = "minActive"
   171  
   172  	NodeTypeAction         = "action"
   173  	NodeTypeActionInactive = "actionInactive"
   174  
   175  	PointTypeAction = "action"
   176  
   177  	PointValueNotify    = "notify"
   178  	PointValueSetValue  = "setValue"
   179  	PointValuePlayAudio = "playAudio"
   180  
   181  	// Transient points that are used for notifications, etc.
   182  	// These points are not stored in the state of any node,
   183  	// but are recorded in the time series database to record history.
   184  	PointMsgAll  = "msgAll"
   185  	PointMsgUser = "msgUser"
   186  
   187  	NodeTypeMsgService = "msgService"
   188  
   189  	PointTypeService = "service"
   190  
   191  	PointValueTwilio = "twilio"
   192  	PointValueSMTP   = "smtp"
   193  
   194  	PointTypeSID       = "sid"
   195  	PointTypeAuthToken = "authToken"
   196  	PointTypeFrom      = "from"
   197  
   198  	NodeTypeVariable      = "variable"
   199  	PointTypeVariableType = "variableType"
   200  
   201  	NodeTypeSync = "sync"
   202  
   203  	PointTypeMetricNatsCycleNodePoint          = "metricNatsCycleNodePoint"
   204  	PointTypeMetricNatsCycleNodeEdgePoint      = "metricNatsCycleNodeEdgePoint"
   205  	PointTypeMetricNatsCycleNode               = "metricNatsCycleNode"
   206  	PointTypeMetricNatsCycleNodeChildren       = "metricNatsCycleNodeChildren"
   207  	PointTypeMetricNatsPendingNodePoint        = "metricNatsPendingNodePoint"
   208  	PointTypeMetricNatsPendingNodeEdgePoint    = "metricNatsPendingNodeEdgePoint"
   209  	PointTypeMetricNatsThroughputNodePoint     = "metricNatsThroughputNodePoint"
   210  	PointTypeMetricNatsThroughputNodeEdgePoint = "metricNatsThroughputNodeEdgePoint"
   211  
   212  	// serial MCU clients
   213  	NodeTypeSerialDev         = "serialDev"
   214  	PointTypeRx               = "rx"
   215  	PointTypeTx               = "tx"
   216  	PointTypeHrRx             = "hrRx"
   217  	PointTypeRxReset          = "rxReset"
   218  	PointTypeTxReset          = "txReset"
   219  	PointTypeHrRxReset        = "hrRxReset"
   220  	PointTypeLog              = "log"
   221  	PointTypeUptime           = "uptime"
   222  	PointTypeMaxMessageLength = "maxMessageLength"
   223  	PointTypeSyncParent       = "syncParent"
   224  
   225  	// CAN bus clients
   226  	NodeTypeCanBus               = "canBus"
   227  	PointTypeBitRate             = "bitRate"
   228  	PointTypeMsgsInDb            = "msgsInDb"
   229  	PointTypeSignalsInDb         = "signalsInDb"
   230  	PointTypeMsgsRecvdDb         = "msgsRecvdDb"
   231  	PointTypeMsgsRecvdDbReset    = "msgsRecvdDbReset"
   232  	PointTypeMsgsRecvdOther      = "msgsRecvdOther"
   233  	PointTypeMsgsRecvdOtherReset = "msgsRecvdOtherReset"
   234  
   235  	NodeTypeSignalGenerator = "signalGenerator"
   236  
   237  	PointTypeSignalType   = "signalType"
   238  	PointTypeMinValue     = "minValue"
   239  	PointTypeMaxValue     = "maxValue"
   240  	PointTypeInitialValue = "initialValue"
   241  	PointTypeRoundTo      = "roundTo"
   242  	PointTypeSampleRate   = "sampleRate"
   243  	PointTypeDestination  = "destination"
   244  	PointTypeBatchPeriod  = "batchPeriod"
   245  	PointTypeFrequency    = "frequency"
   246  	PointTypeMinIncrement = "minIncrement"
   247  	PointTypeMaxIncrement = "maxIncrement"
   248  
   249  	NodeTypeFile      = "file"
   250  	PointTypeName     = "name"
   251  	PointTypeData     = "data"
   252  	PointTypeBinary   = "binary"
   253  	PointTypeSize     = "size"
   254  	PointTypeHash     = "hash"
   255  	PointTypeDownload = "download"
   256  	PointTypeProgress = "progress"
   257  
   258  	PointTypeRate   = "rate"
   259  	PointTypeRateHR = "rateHR"
   260  	NodeTypeMetrics = "metrics"
   261  
   262  	PointTypeType          = "type"
   263  	PointValueApp          = "app"
   264  	PointValueProcess      = "process"
   265  	PointValueAllProcesses = "allProcesses"
   266  	PointValueSystem       = "system"
   267  
   268  	PointTypeCount = "count"
   269  
   270  	// Sys Metrics
   271  	PointTypeMetricSysLoad            = "metricSysLoad"
   272  	PointTypeMetricSysCPUPercent      = "metricSysCPUPercent"
   273  	PointTypeMetricSysMem             = "metricSysMem"
   274  	PointTypeMetricSysMemUsedPercent  = "metricSysMemUsedPercent"
   275  	PointTypeMetricSysDiskUsedPercent = "metricSysDiskUsedPercent"
   276  	PointTypeMetricSysNetBytesRecv    = "metricSysNetBytesRecv"
   277  	PointTypeMetricSysNetBytesSent    = "metricSysNetBytesSent"
   278  	PointTypeMetricSysUptime          = "metricSysUptime"
   279  
   280  	// App Metrics
   281  	PointTypeMetricAppAlloc        = "metricAppAlloc"
   282  	PointTypeMetricAppNumGoroutine = "metricAppNumGoroutine"
   283  
   284  	// process metrics
   285  	PointTypeMetricProcCPUPercent = "metricProcCPUPercent"
   286  	PointTypeMetricProcMemPercent = "metricProcMemPercent"
   287  	PointTypeMetricProcMemRSS     = "metricProcMemRSS"
   288  
   289  	PointTypeHost                = "host"
   290  	PointTypeHostBootTime        = "hostBootTime"
   291  	PointKeyHostname             = "hostname"
   292  	PointKeyOS                   = "os"
   293  	PointKeyPlatform             = "platform"
   294  	PointKeyPlatformFamily       = "platformFamily"
   295  	PointKeyPlatformVersion      = "platformVersion"
   296  	PointKeyKernelVersion        = "kernelVersion"
   297  	PointKeyKernelArch           = "kernelArch"
   298  	PointKeyVirtualizationSystem = "virtualizationSystem"
   299  	PointKeyVirtualizationRole   = "virtualizationRole"
   300  
   301  	PointKeyUsedPercent = "usedPercent"
   302  	PointKeyTotal       = "total"
   303  	PointKeyAvailable   = "available"
   304  	PointKeyUsed        = "used"
   305  	PointKeyFree        = "free"
   306  
   307  	NodeTypeShelly   = "shelly"
   308  	NodeTypeShellyIo = "shellyIo"
   309  
   310  	PointTypeSwitch      = "switch"
   311  	PointTypeSwitchSet   = "switchSet"
   312  	PointTypeInput       = "input"
   313  	PointTypeLight       = "light"
   314  	PointTypeLightSet    = "lightSet"
   315  	PointTypeDeviceID    = "deviceID"
   316  	PointTypeIP          = "ip"
   317  	PointTypeVoltage     = "voltage"
   318  	PointTypeCurrent     = "current"
   319  	PointTypePower       = "power"
   320  	PointTypeTemperature = "temp"
   321  	PointTypeBrightness  = "brightness"
   322  	PointTypeWhite       = "white"
   323  	PointTypeLightTemp   = "lightTemp"
   324  	PointTypeTransition  = "transition"
   325  	PointTypeOffline     = "offline"
   326  
   327  	PointValueShellyTypeBulbDuo = "BulbDuo"
   328  	PointValueShellyTypeRGBW2   = "rgbw2"
   329  	PointValueShellyType1PM     = "1pm"
   330  	PointValueShellyTypePlugUS  = "PlugUS"
   331  	PointValueShellyTypePlugUK  = "PlugUK"
   332  	PointValueShellyTypePlugIT  = "PlugIT"
   333  	PointValueShellyTypePlugS   = "PlugS"
   334  	PointValueShellyTypeI4      = "PlusI4"
   335  	PointValueShellyTypePlus1   = "Plus1"
   336  	PointValueShellyTypePlus2PM = "Plus2PM"
   337  
   338  	PointTypeTimeSync  = "timeSync"
   339  	PointTypeConnected = "connected"
   340  
   341  	NodeTypeNetworkManager       = "networkManager"
   342  	NodeTypeNetworkManagerDevice = "networkManagerDevice"
   343  	NodeTypeNetworkManagerConn   = "networkManagerConn"
   344  
   345  	NodeTypeNTP             = "ntp"
   346  	PointTypeServer         = "server"
   347  	PointTypeFallbackServer = "fallbackServer"
   348  
   349  	NodeTypeUpdate           = "update"
   350  	PointTypeOSUpdate        = "osUpdate"
   351  	PointTypeAppUpdate       = "appUpdate"
   352  	PointTypePrefix          = "prefix"
   353  	PointTypeDownloadOS      = "downloadOS"
   354  	PointTypeOSDownloaded    = "osDownloaded"
   355  	PointTypeDiscardDownload = "discardDownload"
   356  	PointTypeReboot          = "reboot"
   357  	PointTypeAutoReboot      = "autoReboot"
   358  	PointTypeAutoDownload    = "autoDownload"
   359  	PointTypeDirectory       = "directory"
   360  	PointTypeRefresh         = "refresh"
   361  
   362  	// points for networking config
   363  	PointTypeStaticIP = "staticIP"
   364  	PointTypeAddress  = "address"
   365  	PointTypeNetmask  = "netmask"
   366  	PointTypeGateway  = "gateway"
   367  )