From 8eb4a2de4f3b12e6fc686f8d585688aa220a1a93 Mon Sep 17 00:00:00 2001 From: PatriceKammognie Date: Tue, 23 Jan 2024 11:40:42 +0100 Subject: [PATCH] add JSON schemas for each config file Signed-off-by: PatriceKammognie --- .../resources/activemqconsumer.schema.json | 35 +++++ .../main/resources/honoconsumer.schema.json | 51 ++++++++ .../main/resources/httpconsumer.schema.json | 22 ++++ .../main/resources/kafkaconsumer.schema.json | 57 +++++++++ .../main/resources/opcuaconsumer.schema.json | 121 ++++++++++++++++++ .../main/resources/plc4xconsumer.schema.json | 60 +++++++++ 6 files changed, 346 insertions(+) create mode 100644 databridge.camel-activemq/src/main/resources/activemqconsumer.schema.json create mode 100644 databridge.camel-hono/src/main/resources/honoconsumer.schema.json create mode 100644 databridge.camel-httppolling/src/main/resources/httpconsumer.schema.json create mode 100644 databridge.camel-kafka/src/main/resources/kafkaconsumer.schema.json create mode 100644 databridge.camel-opcua/src/main/resources/opcuaconsumer.schema.json create mode 100644 databridge.camel-plc4x/src/main/resources/plc4xconsumer.schema.json diff --git a/databridge.camel-activemq/src/main/resources/activemqconsumer.schema.json b/databridge.camel-activemq/src/main/resources/activemqconsumer.schema.json new file mode 100644 index 00000000..6e0f8fed --- /dev/null +++ b/databridge.camel-activemq/src/main/resources/activemqconsumer.schema.json @@ -0,0 +1,35 @@ +{ + "$id": "https://example.com/person.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "activemqconsumer.json", + "type": "object", + "required": [ + "uniqueId", + "queue" + ], + "properties": { + "uniqueId": { + "type": "string", + "description": "Unique ID to match options", + "pattern": "^[a-z0-9-]+$" + }, + "serverUrl": { + "type": "string", + "description": "IP or Hostname of the MQTT Broker", + "default": "127.0.0.1", + "pattern": "^([a-z0-9-_\\.]+\\.[a-z]{1,3}|[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})$" + }, + "serverPort": { + "description": "Port of the MQTT Broker", + "type": "integer", + "minimum": 0, + "maximum": 65535, + "default": "61616" + }, + "queue": { + "type": "string", + "description": "Name of the queue", + "pattern": "[a-z0-9-]+" + } + } +} \ No newline at end of file diff --git a/databridge.camel-hono/src/main/resources/honoconsumer.schema.json b/databridge.camel-hono/src/main/resources/honoconsumer.schema.json new file mode 100644 index 00000000..e9bf394d --- /dev/null +++ b/databridge.camel-hono/src/main/resources/honoconsumer.schema.json @@ -0,0 +1,51 @@ +{ + "$id": "https://example.com/person.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "honoconsumer.json", + "type": "object", + "required": [ + "uniqueId", + "topic", + "userName", + "password", + "tenantId", + "deviceId" + ], + "properties": { + "uniqueId": { + "type": "string", + "description": "Unique ID to match options", + "pattern": "^[a-z0-9-]+$" + }, + "serverUrl": { + "type": "string", + "description": "IP or Hostname of the Kafka Server", + "default": "127.0.0.1", + "pattern": "^([a-z0-9-_\\.]+\\.[a-z]{1,3}|[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})$" + }, + "serverPort": { + "description": "Port of the Kafka Server", + "type": "integer", + "minimum": 0, + "maximum": 65535, + "default": "15672" + }, + "userName": { + "type": "string", + "description": "Username for Hono instance" + }, + "password": { + "type": "string", + "description": "Password for username" + }, + "tenantId": { + "type": "string", + "description": "ID of the tenant which want to use" + }, + "deviceId": { + "type": "string", + "description": "ID of the device", + "pattern": "[a-z0-9-]+" + } + } +} \ No newline at end of file diff --git a/databridge.camel-httppolling/src/main/resources/httpconsumer.schema.json b/databridge.camel-httppolling/src/main/resources/httpconsumer.schema.json new file mode 100644 index 00000000..e0eb1225 --- /dev/null +++ b/databridge.camel-httppolling/src/main/resources/httpconsumer.schema.json @@ -0,0 +1,22 @@ +{ + "$id": "https://example.com/person.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "httpconsumer.json", + "type": "object", + "required": [ + "uniqueId", + "serverUrl" + ], + "properties": { + "uniqueId": { + "type": "string", + "description": "Unique ID to match options", + "pattern": "^[a-z0-9-]+$" + }, + "serverUrl": { + "type": "string", + "description": "IP or Hostname of the MQTT Broker", + "pattern": "[a-zA-Z0-9:/-\\._\\?=&%\\$]+" + } + } +} \ No newline at end of file diff --git a/databridge.camel-kafka/src/main/resources/kafkaconsumer.schema.json b/databridge.camel-kafka/src/main/resources/kafkaconsumer.schema.json new file mode 100644 index 00000000..18b3c475 --- /dev/null +++ b/databridge.camel-kafka/src/main/resources/kafkaconsumer.schema.json @@ -0,0 +1,57 @@ +{ + "$id": "https://example.com/person.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "kafkaconsumer.json", + "type": "object", + "required": [ + "uniqueId", + "topic" + ], + "properties": { + "uniqueId": { + "type": "string", + "description": "Unique ID to match options", + "pattern": "^[a-z0-9-]+$" + }, + "serverUrl": { + "type": "string", + "description": "IP or Hostname of the Kafka Server", + "default": "127.0.0.1", + "pattern": "^([a-z0-9-_\\.]+\\.[a-z]{1,3}|[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})$" + }, + "serverPort": { + "description": "Port of the Kafka Server", + "type": "integer", + "minimum": 0, + "maximum": 65535, + "default": "9092" + }, + "topic": { + "type": "string", + "description": "Topic of the variable in the MQTT Broker" + }, + "maxPollRecords": { + "type": "integer", + "description": "The maximum number of records returned in a single call", + "minimum": 500, + "default": "5000" + }, + "groupId": { + "type": "string", + "description": "A unique identifier of the consumer instance.", + "pattern": "[a-z0-9-]+", + "default": "basyx-updater" + }, + "consumersCount": { + "type": "integer", + "description": "The number of consumers that connect to kafka server. Each consumer is run on a separate thread, that retrieves and process the incoming data.", + "minimum": 1, + "default": "1" + }, + "seekTo": { + "enum": ["BEGINNING", "END"], + "description": "Define where to start reading from", + "default": "BEGINNING" + } + } +} \ No newline at end of file diff --git a/databridge.camel-opcua/src/main/resources/opcuaconsumer.schema.json b/databridge.camel-opcua/src/main/resources/opcuaconsumer.schema.json new file mode 100644 index 00000000..f0948f63 --- /dev/null +++ b/databridge.camel-opcua/src/main/resources/opcuaconsumer.schema.json @@ -0,0 +1,121 @@ +{ + "$id": "https://example.com/person.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "opcuaconsumer.json", + "type": "object", + "required": [ + "uniqueId", + "pathToService", + "nodeInformation" + ], + "properties": { + "uniqueId": { + "title": "Unique ID", + "type": "string", + "description": "Unique ID to match options", + "pattern": "^[a-z0-9-]+$" + }, + "serverUrl": { + "title": "Hostname or IP", + "type": "string", + "description": "IP or Hostname of the OPC UA Server", + "default": "127.0.0.1", + "pattern": "^([a-z0-9-_\\.]+\\.[a-z]{1,3}|[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})$" + }, + "serverPort": { + "title": "Port", + "description": "Port of the OPC UA Server", + "type": "integer", + "minimum": 0, + "maximum": 65535, + "default": "4048" + }, + "pathToService": { + "title": "Path to Service", + "type": "string", + "description": "URI of the Service in the OPC UA Server", + "pattern": "[a-z/]+" + }, + "nodeInformation": { + "title": "OPC UA Node ID", + "type": "string", + "description": "Path to a variable node in the OPC UA Server" + }, + "username": { + "title": "Username", + "type": "string", + "description": "Username to authenticate to the OPC UA Server" + }, + "password": { + "title": "Password", + "type": "string", + "description": "Password to authenticate to the OPC UA Server" + }, + "parameters": { + "title": "Parameters", + "type": "object", + "properties": { + "requestedPublishingInterval": { + "type": "integer", + "description": "Interval to request the value of the variable", + "minimum": 500, + "default": "500" + }, + "clientId": { + "type": "string", + "description": "A virtual client id to force the creation of a new connection instance" + }, + "dataChangeFilterDeadbandType": { + "type": "integer", + "description": "Deadband type for MonitorFilterType DataChangeFilter" + }, + "dataChangeFilterDeadbandValue": { + "type": "number", + "description": "Deadband value for MonitorFilterType DataChangeFilter" + }, + "allowedSecurityPolicies": { + "enum": [ + "None", + "Basic128Rsa15", + "Basic256", + "Basic256Sha256", + "Aes128_Sha256_RsaOaep", + "Aes256_Sha256_RsaPss" + ], + "default": "None", + "description": "A set of allowed security policy URIs. Default is to accept all and use the highest" + }, + "keyAlias": { + "type": "string", + "description": "The name of the key in the keystore file" + }, + "keyPassword": { + "type": "string", + "description": "The key password" + }, + "keyStorePassword": { + "type": "string", + "description": "The keystore password" + }, + "keyStoreType": { + "type": "string", + "description": "The key store type" + }, + "keyStoreUrl": { + "type": "string", + "description": "The URL where the key should be loaded from" + }, + "sessionName": { + "type": "string", + "description": "Session name", + "pattern": "[a-z0-9-]*" + }, + "sessionTimeout": { + "type": "integer", + "description": "Session timeout in milliseconds", + "minimum": 0 + } + } + } + } +} \ No newline at end of file diff --git a/databridge.camel-plc4x/src/main/resources/plc4xconsumer.schema.json b/databridge.camel-plc4x/src/main/resources/plc4xconsumer.schema.json new file mode 100644 index 00000000..cf633339 --- /dev/null +++ b/databridge.camel-plc4x/src/main/resources/plc4xconsumer.schema.json @@ -0,0 +1,60 @@ +{ + "$id": "https://example.com/person.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "plc4xconsumer.json", + "type": "object", + "required": [ + "uniqueId", + "driver", + "tags" + ], + "properties": { + "uniqueId": { + "type": "string", + "description": "Unique ID to match options", + "pattern": "^[a-z0-9-]+$" + }, + "serverUrl": { + "type": "string", + "description": "IP or Hostname of the MQTT Broker", + "default": "127.0.0.1", + "pattern": "^([a-z0-9-_\\.]+\\.[a-z]{1,3}|[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})$" + }, + "serverPort": { + "description": "Port of the MQTT Broker", + "type": "integer", + "minimum": 0, + "maximum": 65535, + "default": "50201" + }, + "driver": { + "enum": ["ADS", "bacnet", "canopen", "eip", "firmata", "knxnet-ip", "logix", "modbus-tcp", "modbus-adu", "modbus-ascii", "opcua", "plc4x", "profinet", "s7", "simulated"], + "description": "Name of the driver" + }, + "servicePath": { + "type": "string", + "description": "Service Path" + }, + "options": { + "type": "string", + "description": "Options; depends on driver" + }, + "tags": { + "title": "Tags", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the Tag" + }, + "value": { + "type": "string", + "description": "Value of the Tag" + } + } + } + } + } +} \ No newline at end of file