From 726c7bac779ae455276856dfdf2d144874947dc5 Mon Sep 17 00:00:00 2001 From: Marc-Philippe Fuller Date: Mon, 27 Mar 2023 19:11:34 -0700 Subject: [PATCH] refactor!:Change configuration profile formats to YAML (#535) * refactor!:Change configuration profile formats to YAML BREAKING CHANGE: Configuration profiles now uses YAML format --- Attribution.txt | 6 - Dockerfile | 2 +- res/external-mqtt-trigger/configuration.toml | 51 ------ res/external-mqtt-trigger/configuration.yaml | 61 +++++++ res/functional-tests/configuration.toml | 85 --------- res/functional-tests/configuration.yaml | 91 ++++++++++ res/http-export/configuration.toml | 90 --------- res/http-export/configuration.yaml | 100 ++++++++++ res/metrics-influxdb/configuration.toml | 47 ----- res/metrics-influxdb/configuration.yaml | 57 ++++++ res/mqtt-export/configuration.toml | 82 --------- res/mqtt-export/configuration.yaml | 92 ++++++++++ res/rules-engine/configuration.toml | 40 ---- res/rules-engine/configuration.yaml | 50 +++++ res/sample/configuration.toml | 181 ------------------- res/sample/configuration.yaml | 163 +++++++++++++++++ snap/local/helper-go/configure.go | 6 +- 17 files changed, 618 insertions(+), 586 deletions(-) delete mode 100644 res/external-mqtt-trigger/configuration.toml create mode 100644 res/external-mqtt-trigger/configuration.yaml delete mode 100644 res/functional-tests/configuration.toml create mode 100644 res/functional-tests/configuration.yaml delete mode 100644 res/http-export/configuration.toml create mode 100644 res/http-export/configuration.yaml delete mode 100644 res/metrics-influxdb/configuration.toml create mode 100644 res/metrics-influxdb/configuration.yaml delete mode 100644 res/mqtt-export/configuration.toml create mode 100644 res/mqtt-export/configuration.yaml delete mode 100644 res/rules-engine/configuration.toml create mode 100644 res/rules-engine/configuration.yaml delete mode 100644 res/sample/configuration.toml create mode 100644 res/sample/configuration.yaml diff --git a/Attribution.txt b/Attribution.txt index 42789ff9..6014b829 100644 --- a/Attribution.txt +++ b/Attribution.txt @@ -33,9 +33,6 @@ https://github.com/edgexfoundry/go-mod-bootstrap/blob/master/LICENSE edgexfoundry/go-mod-secrets (Apache 2.0) https://github.com/edgexfoundry/go-mod-configuration/v3 https://github.com/edgexfoundry/go-mod-configuration/blob/master/LICENSE -BurntSushi/toml (MIT) https://github.com/BurntSushi/toml -https://github.com/BurntSushi/toml/blob/master/COPYING - github.com/go-kit/log (MIT) https://github.com/go-kit/log https://github.com/go-kit/log/blob/master/LICENSE @@ -90,9 +87,6 @@ https://github.com/mitchellh/reflectwalk/blob/master/LICENSE mitchellh/go-homedir (MIT) https://github.com/mitchellh/go-homedir https://github.com/mitchellh/go-homedir/blob/master/LICENSE -pelletier/go-toml (MIT) https://github.com/pelletier/go-toml -https://github.com/pelletier/go-toml/blob/master/LICENSE - pkg/errors (BSD-2) https://github.com/pkg/errors https://github.com/pkg/errors/blob/master/LICENSE diff --git a/Dockerfile b/Dockerfile index 80a5b621..3d01bef0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,7 +55,7 @@ EXPOSE 48095 # or use # command: "-profile=" # If not you will recive error: -# SDK initialization failed: Could not load configuration file (./res/configuration.toml)... +# SDK initialization failed: Could not load configuration file (./res/configuration.yaml)... ENTRYPOINT ["/app-service-configurable"] CMD ["-cp=consul.http://edgex-core-consul:8500", "--registry"] diff --git a/res/external-mqtt-trigger/configuration.toml b/res/external-mqtt-trigger/configuration.toml deleted file mode 100644 index 82fc027e..00000000 --- a/res/external-mqtt-trigger/configuration.toml +++ /dev/null @@ -1,51 +0,0 @@ -[Writable] -LogLevel = "INFO" - - [Writable.Pipeline] - ExecutionOrder = "MQTTExport" - TargetType = "raw" - - [Writable.Pipeline.Functions] - [Writable.Pipeline.Functions.MQTTExport] - [Writable.Pipeline.Functions.MQTTExport.Parameters] - BrokerAddress = "tcp://localhost:1883" # Hive Public Test Broker - # Topic can have place holders in the form "{key-name}" that are replaced with matching Context values. Error occurs if no value match place holder(s). - Topic = "edgex-export" - SecretName = "mqtt" - ClientId = "external-mqtt-export" - QOS="0" - AutoReconnect="false" - KeepAlive = "" # Empty indicates to use default value - ConnectTimeout = "" # Empty indicates to use default value - Retain="false" - SkipVerify = "false" - AuthMode = "none" - PersistOnError = "false" - - # Reporting metrics requires the "edgex-messagebus" Trigger. - # Since this profile uses "external-mqtt" trigger the metrics can not be reported. - [Writable.Telemetry] - Interval = "0s" # Disables reporting - -[Service] -Port = 59706 -StartupMsg = "app-external-mqtt-trigger has Started" - -[MessageBus] -Disabled = true - -[Trigger] -Type="external-mqtt" -SubscribeTopics="external-request/#" -PublishTopic="" # optional if publishing response back to the the External MQTT Broker - [Trigger.ExternalMqtt] - Url = "tcp://localhost:1883" # fully qualified URL to connect to the MQTT broker - ClientId = "external-mqtt-trigger" - ConnectTimeout = "5s" # 5 seconds - AutoReconnect = true - KeepAlive = 10 # Seconds (must be 2 or greater) - QoS = 0 # Quality of Service 0 (At most once), 1 (At least once) or 2 (Exactly once) - Retain = true - SkipCertVerify = false - SecretName = "mqtt-trigger" - AuthMode = "none" diff --git a/res/external-mqtt-trigger/configuration.yaml b/res/external-mqtt-trigger/configuration.yaml new file mode 100644 index 00000000..5e7de7bf --- /dev/null +++ b/res/external-mqtt-trigger/configuration.yaml @@ -0,0 +1,61 @@ +Writable: + LogLevel: "INFO" + + Pipeline: + ExecutionOrder: "MQTTExport" + TargetType: "raw" + + Functions: + MQTTExport: + Parameters: + BrokerAddress: "tcp://localhost:1883" # Hive Public Test Broker + # Topic can have place holders in the form "{key-name}" that are replaced with matching Context values. Error occurs if no value match place holder(s). + Topic: "edgex-export" + SecretName: "mqtt" + ClientId: "external-mqtt-export" + QOS: "0" + AutoReconnect: "false" + KeepAlive: "" # Empty indicates to use default value + ConnectTimeout: "" # Empty indicates to use default value + Retain: "false" + SkipVerify: "false" + AuthMode: "none" + PersistOnError: "false" + + # Metrics can only be reported when the MessageBus (below) is enabled. + Telemetry: + Interval: "0s" # Disables reporting + +Service: + Host: "localhost" + Port: 59706 + StartupMsg: "app-external-mqtt-trigger has Started" + +# uncomment when running from command-line in hybrid mode with -cp -o flags +# Clients: +# core-metadata: +# Host: "localhost" +# Registry: +# Host: "localhost" +# Database: +# Host: "localhost" + +MessageBus: +# Host: localhost # uncomment when running from command-line in hybrid mode + Disabled: true # Set to false when collecting metrics + +Trigger: + Type: "external-mqtt" + SubscribeTopics: "external-request/#" + PublishTopic: "" # optional if publishing response back to the the External MQTT Broker + ExternalMqtt: + Url: "tcp://localhost:1883" # fully qualified URL to connect to the MQTT broker + ClientId: "external-mqtt-trigger" + ConnectTimeout: "5s" # 5 seconds + AutoReconnect: true + KeepAlive: 10 # Seconds (must be 2 or greater) + QoS: 0 # Quality of Service 0 (At most once), 1 (At least once) or 2 (Exactly once) + Retain: true + SkipCertVerify: false + SecretName: "mqtt-trigger" + AuthMode: "none" diff --git a/res/functional-tests/configuration.toml b/res/functional-tests/configuration.toml deleted file mode 100644 index 2dba46a8..00000000 --- a/res/functional-tests/configuration.toml +++ /dev/null @@ -1,85 +0,0 @@ -[Writable] -LogLevel = "INFO" - - [Writable.Pipeline] - TargetType = "event" - ExecutionOrder = "FilterByDeviceName, Transform, SetResponseData" - - [Writable.Pipeline.Functions] - [Writable.Pipeline.Functions.FilterByProfileName] - [Writable.Pipeline.Functions.FilterByProfileName.Parameters] - ProfileNames = "" - FilterOut = "false" - [Writable.Pipeline.Functions.FilterByDeviceName] - [Writable.Pipeline.Functions.FilterByDeviceName.Parameters] - DeviceNames = "Random-Float-Device,Random-Integer-Device" - FilterOut = "false" - [Writable.Pipeline.Functions.FilterBySourceName] - [Writable.Pipeline.Functions.FilterBySourceName.Parameters] - SourceNames = "" - FilterOut = "false" - [Writable.Pipeline.Functions.FilterByResourceName] - [Writable.Pipeline.Functions.FilterByResourceName.Parameters] - ResourceNames = "RandomValue_Int8, RandomValue_Int64" - FilterOut = "false" - [Writable.Pipeline.Functions.AddTags] - [Writable.Pipeline.Functions.AddTags.Parameters] - Tags="" - [Writable.Pipeline.Functions.Transform] - [Writable.Pipeline.Functions.Transform.Parameters] - Type = "xml" - [Writable.Pipeline.Functions.Compress] - [Writable.Pipeline.Functions.Compress.Parameters] - Algorithm = "gzip" - [Writable.Pipeline.Functions.Encrypt] - [Writable.Pipeline.Functions.Encrypt.Parameters] - Algorithm = "aes256" # "aes" has been Deprecated. Please use "aes256" - SecretName = "aes" - SecretValueKey = "key" - [Writable.Pipeline.Functions.SetResponseData] - [Writable.Pipeline.Functions.SetResponseData.Parameters] - ResponseContentType = "" - [Writable.Pipeline.Functions.PushToCore] - [Writable.Pipeline.Functions.PushToCore.Parameters] - DeviceName = "" - ReadingName = "" - [Writable.Pipeline.Functions.HTTPExport] - [Writable.Pipeline.Functions.HTTPExport.Parameters] - Method = "post" - Url = "http://" - MimeType = "" #OPTIONAL - default application/json - [Writable.Pipeline.Functions.MQTTExport] - [Writable.Pipeline.Functions.MQTTExport.Parameters] - BrokerAddress = "tcps://localhost:8883" - Topic = "mytopic" - SecretName = "mqtt" - ClientId = "myclientid" - QOS="0" - AutoReconnect="false" - Retain="false" - SkipVerify = "false" - AuthMode = "none" - PersistOnError = "false" - KeepAlive = "" # Empty value means use default setting - ConnectionTimeout = "" # Empty value means use default setting - - [Writable.InsecureSecrets] - [Writable.InsecureSecrets.AES] - SecretName = "aes" - [Writable.InsecureSecrets.AES.SecretData] - key = "217A24432646294A404E635266556A586E3272357538782F413F442A472D4B6150645367566B59703373367639792442264529482B4D6251655468576D5A7134" - - # Reporting metrics requires the "edgex-messagebus" Trigger. - # Since this profile uses "http" trigger the metrics can not be reported. - [Writable.Telemetry] - Interval = "0s" # Disables reporting - -[Service] -Port = 59705 -StartupMsg = "app-functional-tests Service Started" - -[MessageBus] -Disabled = true - -[Trigger] -Type="http" diff --git a/res/functional-tests/configuration.yaml b/res/functional-tests/configuration.yaml new file mode 100644 index 00000000..7ecd8a2d --- /dev/null +++ b/res/functional-tests/configuration.yaml @@ -0,0 +1,91 @@ +Writable: + LogLevel: "INFO" + + Pipeline: + TargetType: "event" + ExecutionOrder: "FilterByDeviceName, Transform, SetResponseData" + + Functions: + FilterByProfileName: + Parameters: + ProfileNames: "" + FilterOut: "false" + FilterByDeviceName: + Parameters: + DeviceNames: "Random-Float-Device,Random-Integer-Device" + FilterOut: "false" + FilterBySourceName: + Parameters: + SourceNames: "" + FilterOut: "false" + FilterByResourceName: + Parameters: + ResourceNames: "RandomValue_Int8, RandomValue_Int64" + FilterOut: "false" + AddTags: + Parameters: + Tags: "" + Transform: + Parameters: + Type: "xml" + Compress: + Parameters: + Algorithm: "gzip" + Encrypt: + Parameters: + Algorithm: "aes256" + SecretName: "aes" + SecretValueKey: "key" + SetResponseData: + Parameters: + ResponseContentType: "" + HTTPExport: + Parameters: + Method: "post" + Url: "http://" + MimeType: "" #OPTIONAL - default application/json + MQTTExport: + Parameters: + BrokerAddress: "tcps://localhost:8883" + Topic: "mytopic" + SecretName: "mqtt" + ClientId: "myclientid" + QOS: "0" + AutoReconnect: "false" + Retain: "false" + SkipVerify: "false" + AuthMode: "none" + PersistOnError: "false" + KeepAlive: "" # Empty value means use default setting + ConnectionTimeout: "" # Empty value means use default setting + + InsecureSecrets: + aes: + SecretName: "aes" + SecretData: + key: "217A24432646294A404E635266556A586E3272357538782F413F442A472D4B6150645367566B59703373367639792442264529482B4D6251655468576D5A7134" + + # Metrics can only be reported when the MessageBus (below) is enabled. + Telemetry: + Interval: "0s" # Disables reporting + +Service: + Host: "localhost" + Port: 59705 + StartupMsg: "app-functional-tests Service Started" + +# uncomment when running from command-line in hybrid mode with -cp -o flags +# Clients: +# core-metadata: +# Host: "localhost" +# Registry: +# Host: "localhost" +# Database: +# Host: "localhost" + +MessageBus: + # Host: localhost # uncomment when running from command-line in hybrid mode + Disabled: true # Set to false when collecting metrics + +Trigger: + Type: "http" diff --git a/res/http-export/configuration.toml b/res/http-export/configuration.toml deleted file mode 100644 index f9bf91b1..00000000 --- a/res/http-export/configuration.toml +++ /dev/null @@ -1,90 +0,0 @@ -[Writable] - LogLevel = "INFO" - - [Writable.Pipeline] - ExecutionOrder = "HTTPExport" - - [Writable.Pipeline.Functions] - [Writable.Pipeline.Functions.FilterByProfileName] - [Writable.Pipeline.Functions.FilterByProfileName.Parameters] - ProfileNames = "" - FilterOut = "false" - [Writable.Pipeline.Functions.FilterByDeviceName] - [Writable.Pipeline.Functions.FilterByDeviceName.Parameters] - DeviceNames = "" - FilterOut = "false" - [Writable.Pipeline.Functions.FilterBySourceName] - [Writable.Pipeline.Functions.FilterBySourceName.Parameters] - SourceNames = "" - FilterOut = "false" - [Writable.Pipeline.Functions.FilterByResourceName] - [Writable.Pipeline.Functions.FilterByResourceName.Parameters] - ResourceNames = "" - FilterOut = "false" - [Writable.Pipeline.Functions.Transform] - [Writable.Pipeline.Functions.Transform.Parameters] - Type = "json" - [Writable.Pipeline.Functions.Compress] - [Writable.Pipeline.Functions.Compress.Parameters] - Algorithm = "gzip" - [Writable.Pipeline.Functions.Encrypt] - [Writable.Pipeline.Functions.Encrypt.Parameters] - Algorithm = "aes256" # "aes" has been Deprecated. Please use "aes256" - SecretName = "aes" - SecretValueKey = "key" - [Writable.Pipeline.Functions.Batch] - [Writable.Pipeline.Functions.Batch.Parameters] - Mode = "bytimecount" # can be "bycount", "bytime" or "bytimecount" - BatchThreshold = "30" - TimeInterval = "60s" - MergeOnSend = "false" - [Writable.Pipeline.Functions.AddTags] - [Writable.Pipeline.Functions.AddTags.Parameters] - Tags="" - [Writable.Pipeline.Functions.HTTPExport] - [Writable.Pipeline.Functions.HTTPExport.Parameters] - Method = "post" - MimeType = "application/json" - # Url can have place holders in the form "{key-name}" that are replaced with matching Context values. Error occurs if no value match place holder(s). - Url = "https://f095cfcd-a3f6-4885-85ea-7157c6afd17e.mock.pstmn.io" # Postman mock service - PersistOnError = "false" - ContinueOnSendError = "false" # For chained multi destination exports, if true continues after send error so next export function executes. - ReturnInputData = "false" # For chained multi destination exports if true, passes the input data to next export function. - HeaderName = "" # Name of the header key to add to the HTTP header - SecretValueKey = "" # The key of the secret stored in the SecretStore - SecretName = "" # The name of the secret in the SecretStore - # Partial name matching allows multiple instances of same function (configured differently) to be in the function pipeline. - # This supports chaining export functions to export to multiple destinations. Name must start with name that matches built in function. - [Writable.Pipeline.Functions.HTTPExport2] - [Writable.Pipeline.Functions.HTTPExport2.Parameters] - Method = "post" - MimeType = "application/json" - # Url can have place holders in the form "{key-name}" that are replaced with matching Context values. Error occurs if no value match place holder(s). - Url = "https://3ff26601-1945-41e3-96b8-27cf446df696.mock.pstmn.io" # Postman mock service (different link than above) - PersistOnError = "false" - ContinueOnSendError = "false" # For chained multi destination exports, if true continues after send error so next export function executes. - ReturnInputData = "false" # For chained multi destination exports if true, passing the input data to next export function - HeaderName = "" # Name of the header key to add to the HTTP header - SecretValueKey = "" # Name of the secret for the header value in the SecretStore - SecretName = "" # Path to the secret for the header value in the SecretStore - - [Writable.InsecureSecrets] - [Writable.InsecureSecrets.http] - SecretName = "http" - [Writable.InsecureSecrets.http.SecretData] - headervalue = "" - [Writable.InsecureSecrets.AES] - SecretName = "aes" - [Writable.InsecureSecrets.AES.SecretData] - key = "217A24432646294A404E635266556A586E3272357538782F413F442A472D4B6150645367566B59703373367639792442264529482B4D6251655468576D5A7134" - -[Service] -Port = 59704 -StartupMsg = "app-http-export has Started" - -[MessageBus] - [MessageBus.Optional] - # Default MQTT Specific options that need to be here to enable evnironment variable overrides of them - ClientId ="app-http-export" - -# Using default Trigger config from common config \ No newline at end of file diff --git a/res/http-export/configuration.yaml b/res/http-export/configuration.yaml new file mode 100644 index 00000000..b9b0b024 --- /dev/null +++ b/res/http-export/configuration.yaml @@ -0,0 +1,100 @@ +Writable: + LogLevel: "INFO" + + Pipeline: + ExecutionOrder: "HTTPExport" + + Functions: + FilterByProfileName: + Parameters: + ProfileNames: "" + FilterOut: "false" + FilterByDeviceName: + Parameters: + DeviceNames: "" + FilterOut: "false" + FilterBySourceName: + Parameters: + SourceNames: "" + FilterOut: "false" + FilterByResourceName: + Parameters: + ResourceNames: "" + FilterOut: "false" + Transform: + Parameters: + Type: "json" + Compress: + Parameters: + Algorithm: "gzip" + Encrypt: + Parameters: + Algorithm: "aes256" + SecretName: "aes" + SecretValueKey: "key" + Batch: + Parameters: + Mode: "bytimecount" # can be "bycount", "bytime" or "bytimecount" + BatchThreshold: "30" + TimeInterval: "60s" + MergeOnSend: "false" + AddTags: + Parameters: + Tags: "" + HTTPExport: + Parameters: + Method: "post" + MimeType: "application/json" + # Url can have place holders in the form "{key-name}" that are replaced with matching Context values. Error occurs if no value match place holder(s). + Url: "" + PersistOnError: "false" + ContinueOnSendError: "false" # For chained multi destination exports, if true continues after send error so next export function executes. + ReturnInputData: "false" # For chained multi destination exports if true, passes the input data to next export function. + HeaderName: "" # Name of the header key to add to the HTTP header + SecretValueKey: "" # The key of the secret stored in the SecretStore + SecretName: "" # The name of the secret in the SecretStore + # Partial name matching allows multiple instances of same function (configured differently) to be in the function pipeline. + # This supports chaining export functions to export to multiple destinations. Name must start with name that matches built in function. + HTTPExport2: + Parameters: + Method: "post" + MimeType: "application/json" + # Url can have place holders in the form "{key-name}" that are replaced with matching Context values. Error occurs if no value match place holder(s). + Url: "" + PersistOnError: "false" + ContinueOnSendError: "false" # For chained multi destination exports, if true continues after send error so next export function executes. + ReturnInputData: "false" # For chained multi destination exports if true, passing the input data to next export function + HeaderName: "" # Name of the header key to add to the HTTP header + SecretValueKey: "" # Name of the secret for the header value in the SecretStore + SecretName: "" # Path to the secret for the header value in the SecretStore + + InsecureSecrets: + http: + SecretName: "http" + SecretData: + headervalue: "" + aes: + SecretName: "aes" + SecretData: + key: "217A24432646294A404E635266556A586E3272357538782F413F442A472D4B6150645367566B59703373367639792442264529482B4D6251655468576D5A7134" + +Service: + Host: "localhost" + Port: 59704 + StartupMsg: "app-http-export has Started" + +# uncomment when running from command-line in hybrid mode with -cp -o flags +# Clients: +# core-metadata: +# Host: "localhost" +# Registry: +# Host: "localhost" +# Database: +# Host: "localhost" + +MessageBus: + # Host: localhost # uncomment when running from command-line in hybrid mode + Optional: + ClientId: "app-http-export" + +# Using default Trigger config from common config \ No newline at end of file diff --git a/res/metrics-influxdb/configuration.toml b/res/metrics-influxdb/configuration.toml deleted file mode 100644 index 2bee5d65..00000000 --- a/res/metrics-influxdb/configuration.toml +++ /dev/null @@ -1,47 +0,0 @@ -[Writable] - LogLevel = "INFO" - - [Writable.Pipeline] - TargetType = "metric" - ExecutionOrder = "ToLineProtocol, Batch, HTTPExport" - - [Writable.Pipeline.Functions] - [Writable.Pipeline.Functions.ToLineProtocol] - [Writable.Pipeline.Functions.ToLineProtocol.Parameters] - Tags = "" # optional comma separated list of additional tags to add to the metric in to form "tag:value,..." - [Writable.Pipeline.Functions.Batch] - [Writable.Pipeline.Functions.Batch.Parameters] - Mode = "bytimecount" # can be "bycount", "bytime" or "bytimecount" - BatchThreshold = "100" - TimeInterval = "60s" - MergeOnSend = "true" - [Writable.Pipeline.Functions.HTTPExport] - [Writable.Pipeline.Functions.HTTPExport.Parameters] - Method = "post" - MimeType = "raw" - Url = "http:/:8086/api/v2/write?org=&bucket=&precision=ns" - HeaderName = "authorization" # Name of the header key to add to the HTTP header - SecretValueKey = "token" # Name of the secret for the header value in the SecretStore - SecretName = "influxdb" # Path to the secret for the header value in the SecretStore - - [Writable.InsecureSecrets] - [Writable.InsecureSecrets.influxdb] - SecretName = "influxdb" - [Writable.InsecureSecrets.influxdb.SecretData] - token = "Token " - - [Writable.Telemetry] - Interval = "0s" # Don't report any metrics as that would be cyclic with this profiles' processing. - -[Service] -Port = 59707 -StartupMsg = "app-metrics-influxdb has Started" - -[MessageBus] - [MessageBus.Optional] - # Default MQTT Specific options that need to be here to enable evnironment variable overrides of them - ClientId ="app-metrics-influxdb" - -[Trigger] -# Note that the MessageBus connection above is used by edgex-messagebus trigger which is the default set in common config -SubscribeTopics = "telemetry/#" # Base topic is prepened to this topic when using edgex-messagebus diff --git a/res/metrics-influxdb/configuration.yaml b/res/metrics-influxdb/configuration.yaml new file mode 100644 index 00000000..ab50e376 --- /dev/null +++ b/res/metrics-influxdb/configuration.yaml @@ -0,0 +1,57 @@ +Writable: + LogLevel: "INFO" + + Pipeline: + TargetType: "metric" + ExecutionOrder: "ToLineProtocol, Batch, HTTPExport" + + Functions: + ToLineProtocol: + Parameters: + Tags: "" # optional comma separated list of additional tags to add to the metric in to form "tag:value,..." + Batch: + Parameters: + Mode: "bytimecount" # can be "bycount", "bytime" or "bytimecount" + BatchThreshold: "100" + TimeInterval: "60s" + MergeOnSend: "true" + HTTPExport: + Parameters: + Method: "post" + MimeType: "raw" + Url: "http:/:8086/api/v2/write?org:&bucket:&precision:ns" + HeaderName: "authorization" # Name of the header key to add to the HTTP header + SecretValueKey: "token" # Name of the secret for the header value in the SecretStore + SecretName: "influxdb" # Path to the secret for the header value in the SecretStore + + InsecureSecrets: + influxdb: + SecretName: "influxdb" + SecretData: + token: "Token " + + Telemetry: + Interval: "0s" # Don't report any metrics as that would be cyclic with this profiles' processing. + +Service: + Host: "localhost" + Port: 59707 + StartupMsg: "app-metrics-influxdb has Started" + +# uncomment when running from command-line in hybrid mode with -cp -o flags +# Clients: +# core-metadata: +# Host: "localhost" +# Registry: +# Host: "localhost" +# Database: +# Host: "localhost" + +MessageBus: + # Host: localhost # uncomment when running from command-line in hybrid mode + Optional: + ClientId: "app-metrics-influxdb" + +Trigger: + # Note that the MessageBus connection above is used by edgex-messagebus trigger which is the default set in common config + SubscribeTopics: "telemetry/#" # Base topic is prepened to this topic when using edgex-messagebus diff --git a/res/mqtt-export/configuration.toml b/res/mqtt-export/configuration.toml deleted file mode 100644 index 6e8d5dad..00000000 --- a/res/mqtt-export/configuration.toml +++ /dev/null @@ -1,82 +0,0 @@ -[Writable] -LogLevel = "INFO" - - [Writable.Pipeline] - ExecutionOrder = "Transform, MQTTExport" - - [Writable.Pipeline.Functions] - [Writable.Pipeline.Functions.FilterByProfileName] - [Writable.Pipeline.Functions.FilterByProfileName.Parameters] - ProfileNames = "" - FilterOut = "false" - [Writable.Pipeline.Functions.FilterByDeviceName] - [Writable.Pipeline.Functions.FilterByDeviceName.Parameters] - DeviceNames = "" - FilterOut = "false" - [Writable.Pipeline.Functions.FilterBySourceName] - [Writable.Pipeline.Functions.FilterBySourceName.Parameters] - SourceNames = "" - FilterOut = "false" - [Writable.Pipeline.Functions.FilterByResourceName] - [Writable.Pipeline.Functions.FilterByResourceName.Parameters] - ResourceNames = "" - FilterOut = "false" - [Writable.Pipeline.Functions.Transform] - [Writable.Pipeline.Functions.Transform.Parameters] - Type = "json" - [Writable.Pipeline.Functions.Compress] - [Writable.Pipeline.Functions.Compress.Parameters] - Algorithm = "gzip" - [Writable.Pipeline.Functions.Encrypt] - [Writable.Pipeline.Functions.Encrypt.Parameters] - Algorithm = "aes256" # "aes" has been Deprecated. Please use "aes256" - SecretName = "aes" - SecretValueKey = "key" - [Writable.Pipeline.Functions.Batch] - [Writable.Pipeline.Functions.Batch.Parameters] - Mode = "bytimecount" # can be "bycount", "bytime" or "bytimecount" - BatchThreshold = "30" - TimeInterval = "60s" - MergeOnSend = "false" - [Writable.Pipeline.Functions.AddTags] - [Writable.Pipeline.Functions.AddTags.Parameters] - Tags="" - [Writable.Pipeline.Functions.MQTTExport] - [Writable.Pipeline.Functions.MQTTExport.Parameters] - BrokerAddress = "tcp://localhost:1883" - Topic = "edgex-export" - SecretName = "mqtt" - ClientId = "MQTT-Export" - QOS="0" - AutoReconnect="false" - KeepAlive = "" # Empty indicates to use default value - ConnectTimeout = "" # Empty indicates to use default value - Retain="false" - SkipVerify = "false" - AuthMode = "none" - PersistOnError = "false" - - [Writable.InsecureSecrets] - [Writable.InsecureSecrets.mqtt] - SecretName = "mqtt" - [Writable.InsecureSecrets.mqtt.SecretData] - username = "" - password = "" - cacert = "" - clientcert = "" - clientkey = "" - [Writable.InsecureSecrets.AES] - SecretName = "aes" - [Writable.InsecureSecrets.AES.SecretData] - key = "217A24432646294A404E635266556A586E3272357538782F413F442A472D4B6150645367566B59703373367639792442264529482B4D6251655468576D5A7134" - -[Service] -Port = 59703 -StartupMsg = "app-mqtt-export has Started" - -[MessageBus] - [MessageBus.Optional] - # Default MQTT Specific options that need to be here to enable evnironment variable overrides of them - ClientId ="app-mqtt-export" - -# Using default Trigger config from common config \ No newline at end of file diff --git a/res/mqtt-export/configuration.yaml b/res/mqtt-export/configuration.yaml new file mode 100644 index 00000000..5dc8faf1 --- /dev/null +++ b/res/mqtt-export/configuration.yaml @@ -0,0 +1,92 @@ +Writable: + LogLevel: "INFO" + + Pipeline: + ExecutionOrder: "Transform, MQTTExport" + + Functions: + FilterByProfileName: + Parameters: + ProfileNames: "" + FilterOut: "false" + FilterByDeviceName: + Parameters: + DeviceNames: "" + FilterOut: "false" + FilterBySourceName: + Parameters: + SourceNames: "" + FilterOut: "false" + FilterByResourceName: + Parameters: + ResourceNames: "" + FilterOut: "false" + Transform: + Parameters: + Type: "json" + Compress: + Parameters: + Algorithm: "gzip" + Encrypt: + Parameters: + Algorithm: "aes256" + SecretName: "aes" + SecretValueKey: "key" + Batch: + Parameters: + Mode: "bytimecount" # can be "bycount", "bytime" or "bytimecount" + BatchThreshold: "30" + TimeInterval: "60s" + MergeOnSend: "false" + AddTags: + Parameters: + Tags: "" + MQTTExport: + Parameters: + BrokerAddress: "tcp://localhost:1883" + Topic: "edgex-export" + SecretName: "mqtt" + ClientId: "MQTT-Export" + QOS: "0" + AutoReconnect: "false" + KeepAlive: "" # Empty indicates to use default value + ConnectTimeout: "" # Empty indicates to use default value + Retain: "false" + SkipVerify: "false" + AuthMode: "none" + PersistOnError: "false" + + InsecureSecrets: + mqtt: + SecretName: "mqtt" + SecretData: + username: "" + password: "" + cacert: "" + clientcert: "" + clientkey: "" + aes: + SecretName: "aes" + SecretData: + key: "217A24432646294A404E635266556A586E3272357538782F413F442A472D4B6150645367566B59703373367639792442264529482B4D6251655468576D5A7134" + +Service: + Host: "localhost" + Port: 59703 + StartupMsg: "app-mqtt-export has Started" + +# uncomment when running from command-line in hybrid mode with -cp -o flags +# Clients: +# core-metadata: +# Host: "localhost" +# Registry: +# Host: "localhost" +# Database: +# Host: "localhost" + +MessageBus: + # Host: localhost # uncomment when running from command-line in hybrid mode + Optional: + ClientId: "app-mqtt-export" + +# Using default Trigger config from common config \ No newline at end of file diff --git a/res/rules-engine/configuration.toml b/res/rules-engine/configuration.toml deleted file mode 100644 index 160038d9..00000000 --- a/res/rules-engine/configuration.toml +++ /dev/null @@ -1,40 +0,0 @@ -[Writable] -LogLevel = "INFO" - - [Writable.Pipeline] - ExecutionOrder = "SetResponseData" - - [Writable.Pipeline.Functions] - [Writable.Pipeline.Functions.SetResponseData] - [Writable.Pipeline.Functions.SetResponseData.Parameters] - ResponseContentType = "" - [Writable.Pipeline.Functions.FilterByProfileName] - [Writable.Pipeline.Functions.FilterByProfileName.Parameters] - ProfileNames = "" - FilterOut = "false" - [Writable.Pipeline.Functions.FilterByDeviceName] - [Writable.Pipeline.Functions.FilterByDeviceName.Parameters] - DeviceNames = "" - FilterOut = "false" - [Writable.Pipeline.Functions.FilterBySourceName] - [Writable.Pipeline.Functions.FilterBySourceName.Parameters] - SourceNames = "" - FilterOut = "false" - [Writable.Pipeline.Functions.FilterByResourceName] - [Writable.Pipeline.Functions.FilterByResourceName.Parameters] - ResourceNames = "" - FilterOut = "false" - -[Service] -Port = 59701 -StartupMsg = "app-rules-engine has Started" - -[MessageBus] - [MessageBus.Optional] - # Default MQTT Specific options that need to be here to enable evnironment variable overrides of them - ClientId ="app-rules-engine" - -[Trigger] -# Note that the MessageBus connection above is used by edgex-messagebus trigger which is the default set in common config -# Default value for SubscribeTopics is aslo set in common config -PublishTopic="rules-events" # Base topic is prepened to this topic when using edgex-messagebus diff --git a/res/rules-engine/configuration.yaml b/res/rules-engine/configuration.yaml new file mode 100644 index 00000000..27395d45 --- /dev/null +++ b/res/rules-engine/configuration.yaml @@ -0,0 +1,50 @@ +Writable: + LogLevel: "INFO" + + Pipeline: + ExecutionOrder: "SetResponseData" + + Functions: + SetResponseData: + Parameters: + ResponseContentType: "" + FilterByProfileName: + Parameters: + ProfileNames: "" + FilterOut: "false" + FilterByDeviceName: + Parameters: + DeviceNames: "" + FilterOut: "false" + FilterBySourceName: + Parameters: + SourceNames: "" + FilterOut: "false" + FilterByResourceName: + Parameters: + ResourceNames: "" + FilterOut: "false" + +Service: + Host: "localhost" + Port: 59701 + StartupMsg: "app-rules-engine has Started" + +# uncomment when running from command-line in hybrid mode with -cp -o flags +# Clients: +# core-metadata: +# Host: "localhost" +# Registry: +# Host: "localhost" +# Database: +# Host: "localhost" + +MessageBus: + # Host: localhost # uncomment when running from command-line in hybrid mode + Optional: + ClientId: "app-rules-engine" + +Trigger: + # Note that the MessageBus connection above is used by edgex-messagebus trigger which is the default set in common config + # Default value for SubscribeTopics is aslo set in common config + PublishTopic: "rules-events" # Base topic is prepened to this topic when using edgex-messagebus diff --git a/res/sample/configuration.toml b/res/sample/configuration.toml deleted file mode 100644 index 9f51b626..00000000 --- a/res/sample/configuration.toml +++ /dev/null @@ -1,181 +0,0 @@ -[Writable] -LogLevel = "INFO" - # The Pipeline section allows the functions pipeline to be specified via configuration - [Writable.Pipeline] - # If set, must be one of the three values: raw, metric, event. - # If not set it defaults to event - TargetType = "event" - - # ExecutionOrder specifies which functions to run and the order to run them. - # All functions listed must have an entry below in the Pipeline.Functions section - ExecutionOrder = "FilterByProfileName, FilterByDeviceName, FilterByResourceName, TransformXml, SetResponseData" - - # Pipeline.PerTopicPipelines sections allow for multiple pipeline to be defined to get executed when the specified - # Topic match the incoming topic. The Id must be unique, but the Topic does not. - # See https://docs.edgexfoundry.org/2.1/microservices/application/AppServiceConfigurable/#pipeline-per-topic - # for complete details on Pipeline Per Topic. - [Writable.Pipeline.PerTopicPipelines] - [Writable.Pipeline.PerTopicPipelines.float] - Id = "float-pipeline" - Topics = "events/device/device-virtual/Random-Float-Device/#" - ExecutionOrder = "TransformJson, SetResponseData" - [Writable.Pipeline.PerTopicPipelines.int8-16] - Id = "int8-16-pipeline" - Topics = "events/device/device-virtual/+/+/Int8, events/device/device-virtual/+/+/Int16" - ExecutionOrder = "TransformXml, SetResponseData" - - # The Pipeline.Functions sections define the parameter configuration for each specific function. - # These function names must match a function defined in the configurable package of the SDK. - # See the Built-In Transforms/Functions section of the SDK"s README for complete list. - # Some functions do not require any parameters, but still must be listed. - # Also, functions not specified in ExecutionOrder above can still be included which allows for easier - # dynamic changes from Consul. - [Writable.Pipeline.Functions] - [Writable.Pipeline.Functions.FilterByProfileName] - [Writable.Pipeline.Functions.FilterByProfileName.Parameters] - ProfileNames = "Random-Integer-Device" - FilterOut = "false" - [Writable.Pipeline.Functions.FilterByDeviceName] - [Writable.Pipeline.Functions.FilterByDeviceName.Parameters] - DeviceNames = "Random-Integer-Device" - FilterOut = "false" - [Writable.Pipeline.Functions.FilterBySourceName] - [Writable.Pipeline.Functions.FilterBySourceName.Parameters] - SourceNames = "Int8, Int16 Int32, Int64" - FilterOut = "false" - [Writable.Pipeline.Functions.FilterByResourceName] - [Writable.Pipeline.Functions.FilterByResourceName.Parameters] - ResourceNames = "Int8, Int16, Int32, Int64" - FilterOut = "false" - [Writable.Pipeline.Functions.AddTags] - [Writable.Pipeline.Functions.AddTags.Parameters] - Tags="" - [Writable.Pipeline.Functions.JSONLogic] - [Writable.Pipeline.Functions.JSONLogic.Parameters] - Rule = "{ \"and\" : [{\"<\" : [{ \"var\" : \"temp\" }, 110 ]}, {\"==\" : [{ \"var\" : \"sensor.type\" }, \"temperature\" ]} ] }" - [Writable.Pipeline.Functions.TransformXml] - [Writable.Pipeline.Functions.TransformXml.Parameters] - Type = "xml" # can be "xml" or "json" - [Writable.Pipeline.Functions.TransformJson] - [Writable.Pipeline.Functions.TransformJson.Parameters] - Type = "json" # can be "xml" or "json" - [Writable.Pipeline.Functions.Compress] - [Writable.Pipeline.Functions.Compress.Parameters] - Algorithm = "gzip" # can be "gzip" or "zlib" - [Writable.Pipeline.Functions.Encrypt] - [Writable.Pipeline.Functions.Encrypt.Parameters] - Algorithm = "aes256" # "aes" has been Deprecated. Please use "aes256" - SecretName = "aes" - SecretValueKey = "key" - [Writable.Pipeline.Functions.Batch] - [Writable.Pipeline.Functions.Batch.Parameters] - Mode = "bytimecount" # can be "bycount", "bytime" or "bytimecount" - BatchThreshold = "30" - TimeInterval = "60s" - MergeOnSend = "false" - [Writable.Pipeline.Functions.SetResponseData] - [Writable.Pipeline.Functions.SetResponseData.Parameters] - ResponseContentType = "application/xml" - [Writable.Pipeline.Functions.PushToCore] - [Writable.Pipeline.Functions.PushToCore.Parameters] - ProfileName = "MyProfile" - DeviceName = "MyDevice" - ResourceName = "SomeResource" - ValueType = "String" - MediaType = "" # Required only when ValueType=Binary - [Writable.Pipeline.Functions.HTTPExport] - [Writable.Pipeline.Functions.HTTPExport.Parameters] - Method = "post" # can be "post" or "put" - MimeType = "" #OPTIONAL - defaults to "application/json" if not set - # Url can have place holders in the form "{key-name}" that are replaced with matching Context values. Error occurs if no value match place holder(s). - Url = "https://f095cfcd-a3f6-4885-85ea-7157c6afd17e.mock.pstmn.io" # Postman mock service - PersistOnError = "false" - ContinueOnSendError = "false" # For chained multi destination exports, if true continues after send error so next export function executes. - ReturnInputData = "false" # For chained multi destination exports if true, passes the input data to next export function. - HeaderName = "" # Name of the header key to add to the HTTP header - SecretValueKey = "" # Name of the secret for the header value in the SecretStore - SecretName = "" # Path to the secret for the header value in the SecretStore - # Partial name matching allows multiple instances of same function (configured differently) to be in the function pipeline. - # This supports chaining export functions to export to multiple destinations. Name must start with name that matches built in function. - [Writable.Pipeline.Functions.HTTPExport2] - [Writable.Pipeline.Functions.HTTPExport2.Parameters] - Method = "post" # can be "post" or "put" - MimeType = "" #OPTIONAL - defaults to "application/json" if not set - # Url can have place holders in the form "{key-name}" that are replaced with matching Context values. Error occurs if no value match place holder(s). - Url = "https://3ff26601-1945-41e3-96b8-27cf446df696.mock.pstmn.io" # Postman mock service (different link than above) - PersistOnError = "false" - ContinueOnSendError = "false" # For chained multi destination exports, if true continues after send error so next export function executes. - ReturnInputData = "false" # For chained multi destination exports if true, passing the input data to next export function - HeaderName = "" # Name of the header key to add to the HTTP header - SecretValueKey = "" # Name of the secret for the header value in the SecretStore - SecretName = "" # Path to the secret for the header value in the SecretStore - [Writable.Pipeline.Functions.MQTTExport] - [Writable.Pipeline.Functions.MQTTExport.Parameters] - BrokerAddress = "tcps://localhost:8883" - # Topic can have place holders in the form "{key-name}" that are replaced with matching Context values. Error occurs if no value match place holder(s). - Topic = "mytopic" - SecretName = "mqtt" - ClientId = "myclientid" - QOS="0" - AutoReconnect="false" - KeepAlive = "" # Empty value means use default setting - ConnectionTimeout = "" # Empty value means use default setting - Retain="false" - SkipVerify = "false" - AuthMode = "none" - PersistOnError = "false" - -# InsecureSecrets are required for Store and Forward DB access and for authenticated HTTP exports and MQTT exports with -# new MQTTSecretSend function when not using security services, i.e. Vault - [Writable.InsecureSecrets] - [Writable.InsecureSecrets.http] - SecretName = "http" - [Writable.InsecureSecrets.http.SecretData] - headervalue = "" - [Writable.InsecureSecrets.AES] - SecretName = "aes" - [Writable.InsecureSecrets.AES.SecretData] - key = "217A24432646294A404E635266556A586E3272357538782F413F442A472D4B6150645367566B59703373367639792442264529482B4D6251655468576D5A7134" - -[Service] -Port = 59700 -StartupMsg = "app-sample has Started" - -# Note Core Metadata is the only required client as it is now used for the version check -# The other clients are only needed if the client interface is being used by one of the configured functions. -[Clients] - # [Clients.core-metadata] Used for version check on start-up comes from Common Config - # Also used for Device Service, DeviceProfile and Device clients, which are not currently used by any configurable functions - - # Used for Event client which is used by PushToCoreData function - [Clients.core-data] - Protocol = "http" - Host = "localhost" - Port = 59880 - - # Used for Command client, which is not currently used by any configurable functions - [Clients.core-command] - # Protocol = "http" - # Host = "localhost" - # Port = 59882 - # Choose to use new messaging based communication for Command Client. - # Only valid if MessageBus Trigger is used - # If prefer REST, remove below and uncomment above - UseMessageBus = true - - # Used for Notification and Subscription client, which are not currently used by any configurable functions - [Clients.support-notifications] - Protocol = "http" - Host = "localhost" - Port = 59860 - -[MessageBus] -Disabled = false # Set to true if not using edgex-messagebus Trigger below and don't want Metrics or Commands via MessageBus - [MessageBus.Optional] - # Default MQTT Specific options that need to be here to enable evnironment variable overrides of them - ClientId ="app-sample" - -[Trigger] -# Note that the MessageBus connection above is used by edgex-messagebus trigger which is the default set in common config -# Default value for SubscribeTopics is aslo set in common config -PublishTopic="sample" # Base topic is prepened to this topic when using edgex-messagebus diff --git a/res/sample/configuration.yaml b/res/sample/configuration.yaml new file mode 100644 index 00000000..7d486b03 --- /dev/null +++ b/res/sample/configuration.yaml @@ -0,0 +1,163 @@ +Writable: + LogLevel: "INFO" + # The Pipeline section allows the functions pipeline to be specified via configuration + Pipeline: + # If set, must be one of the three values: raw, metric, event. + # If not set it defaults to event + TargetType: "event" + + # ExecutionOrder specifies which functions to run and the order to run them. + # All functions listed must have an entry below in the Pipeline.Functions section + ExecutionOrder: "FilterByProfileName, FilterByDeviceName, FilterByResourceName, TransformXml, SetResponseData" + + # Pipeline.PerTopicPipelines sections allow for multiple pipeline to be defined to get executed when the specified + # Topic match the incoming topic. The Id must be unique, but the Topic does not. + # See https://docs.edgexfoundry.org/2.1/microservices/application/AppServiceConfigurable/#pipeline-per-topic + # for complete details on Pipeline Per Topic. + PerTopicPipelines: + float: + Id: "float-pipeline" + Topics: "events/device/device-virtual/Random-Float-Device/#" + ExecutionOrder: "TransformJson, SetResponseData" + int8-16: + Id: "int8-16-pipeline" + Topics: "events/device/device-virtual/+/+/Int8, events/device/device-virtual/+/+/Int16" + ExecutionOrder: "TransformXml, SetResponseData" + + # The Functions sections define the parameter configuration for each specific function. + # These function names must match a function defined in the configurable package of the SDK. + # See the Built-In Transforms/Functions section of the SDK"s README for complete list. + # Some functions do not require any parameters, but still must be listed. + # Also, functions not specified in ExecutionOrder above can still be included which allows for easier + # dynamic changes from Consul. + Functions: + FilterByProfileName: + Parameters: + ProfileNames: "Random-Integer-Device" + FilterOut: "false" + FilterByDeviceName: + Parameters: + DeviceNames: "Random-Integer-Device" + FilterOut: "false" + FilterBySourceName: + Parameters: + SourceNames: "Int8, Int16 Int32, Int64" + FilterOut: "false" + FilterByResourceName: + Parameters: + ResourceNames: "Int8, Int16, Int32, Int64" + FilterOut: "false" + AddTags: + Parameters: + Tags: "" + JSONLogic: + Parameters: + Rule: "{ \"and\" : {\"<\" : [{ \"var\" : \"temp\" }, 110 ]}, {\"::\" : [{ \"var\" : \"sensor.type\" }, \"temperature\" ]} : }" + TransformXml: + Parameters: + Type: "xml" # can be "xml" or "json" + TransformJson: + Parameters: + Type: "json" # can be "xml" or "json" + Compress: + Parameters: + Algorithm: "gzip" # can be "gzip" or "zlib" + Encrypt: + Parameters: + Algorithm: "aes256" + SecretName: "aes" + SecretValueKey: "key" + Batch: + Parameters: + Mode: "bytimecount" # can be "bycount", "bytime" or "bytimecount" + BatchThreshold: "30" + TimeInterval: "60s" + MergeOnSend: "false" + SetResponseData: + Parameters: + ResponseContentType: "application/xml" + HTTPExport: + Parameters: + Method: "post" # can be "post" or "put" + MimeType: "" #OPTIONAL - defaults to "application/json" if not set + # Url can have place holders in the form "{key-name}" that are replaced with matching Context values. Error occurs if no value match place holder(s). + Url: "" + PersistOnError: "false" + ContinueOnSendError: "false" # For chained multi destination exports, if true continues after send error so next export function executes. + ReturnInputData: "false" # For chained multi destination exports if true, passes the input data to next export function. + HeaderName: "" # Name of the header key to add to the HTTP header + SecretValueKey: "" # Name of the secret for the header value in the SecretStore + SecretName: "" # Path to the secret for the header value in the SecretStore + # Partial name matching allows multiple instances of same function (configured differently) to be in the function pipeline. + # This supports chaining export functions to export to multiple destinations. Name must start with name that matches built in function. + HTTPExport2: + Parameters: + Method: "post" # can be "post" or "put" + MimeType: "" #OPTIONAL - defaults to "application/json" if not set + # Url can have place holders in the form "{key-name}" that are replaced with matching Context values. Error occurs if no value match place holder(s). + Url: "" + PersistOnError: "false" + ContinueOnSendError: "false" # For chained multi destination exports, if true continues after send error so next export function executes. + ReturnInputData: "false" # For chained multi destination exports if true, passing the input data to next export function + HeaderName: "" # Name of the header key to add to the HTTP header + SecretValueKey: "" # Name of the secret for the header value in the SecretStore + SecretName: "" # Path to the secret for the header value in the SecretStore + MQTTExport: + Parameters: + BrokerAddress: "tcps://localhost:8883" + # Topic can have place holders in the form "{key-name}" that are replaced with matching Context values. Error occurs if no value match place holder(s). + Topic: "mytopic" + SecretName: "mqtt" + ClientId: "myclientid" + QOS: "0" + AutoReconnect: "false" + KeepAlive: "" # Empty value means use default setting + ConnectionTimeout: "" # Empty value means use default setting + Retain: "false" + SkipVerify: "false" + AuthMode: "none" + PersistOnError: "false" + +# InsecureSecrets are required for authenticated HTTP exports, MQTT exports and AES when not using security services, i.e. Vault + InsecureSecrets: + http: + SecretName: "http" + SecretData: + headervalue: "" + mqtt: + SecretName: "mqtt" + SecretData: + username: "" + password: "" + cacert: "" + clientcert: "" + clientkey: "" + aes: + SecretName: "aes" + SecretData: + key: "217A24432646294A404E635266556A586E3272357538782F413F442A472D4B6150645367566B59703373367639792442264529482B4D6251655468576D5A7134" + +Service: + Host: "localhost" + Port: 59700 + StartupMsg: "app-sample has Started" + +# uncomment when running from command-line in hybrid mode with -cp -o flags +#Clients: +# core-metadata: # Used for version check on start-up comes from Common Config +# Host: "localhost" +# Registry: +# Host: "localhost" +# Database: +# Host: "localhost" + +MessageBus: + # Host: localhost # uncomment when running from command-line in hybrid mode + Disabled: false # Set to true if not using edgex-messagebus Trigger below and don't want Metrics + Optional: + ClientId: "app-sample" + +Trigger: + # Note that the MessageBus connection above is used by edgex-messagebus trigger which is the default set in common config + # Default value for SubscribeTopics is aslo set in common config + PublishTopic: "sample" # Base topic is prepened to this topic when using edgex-messagebus diff --git a/snap/local/helper-go/configure.go b/snap/local/helper-go/configure.go index e380c96e..db373394 100644 --- a/snap/local/helper-go/configure.go +++ b/snap/local/helper-go/configure.go @@ -27,7 +27,7 @@ import ( ) // validateProfile processes the snap 'profile' configure option, ensuring that the directory -// and associated configuration.toml file in $SNAP_DATA both exist. +// and associated configuration.yaml file in $SNAP_DATA both exist. func validateProfile() error { prof, err := snapctl.Get("profile").Run() if err != nil { @@ -40,12 +40,12 @@ func validateProfile() error { return nil } - path := fmt.Sprintf("%s/config/res/%s/configuration.toml", env.SnapData, prof) + path := fmt.Sprintf("%s/config/res/%s/configuration.yaml", env.SnapData, prof) log.Debugf("validateProfile: checking if %s exists", path) _, err = os.Stat(path) if err != nil { - return fmt.Errorf("profile %s has no configuration.toml", prof) + return fmt.Errorf("profile %s has no configuration.yaml", prof) } return nil