Skip to content

Commit

Permalink
refactor!:Change configuration profile formats to YAML (#535)
Browse files Browse the repository at this point in the history
* refactor!:Change configuration profile formats to YAML

BREAKING CHANGE: Configuration profiles now uses YAML format
  • Loading branch information
marcpfuller authored Mar 28, 2023
1 parent 6ea7de7 commit 726c7ba
Show file tree
Hide file tree
Showing 17 changed files with 618 additions and 586 deletions.
6 changes: 0 additions & 6 deletions Attribution.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ EXPOSE 48095
# or use
# command: "-profile=<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"]
Expand Down
51 changes: 0 additions & 51 deletions res/external-mqtt-trigger/configuration.toml

This file was deleted.

61 changes: 61 additions & 0 deletions res/external-mqtt-trigger/configuration.yaml
Original file line number Diff line number Diff line change
@@ -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"
85 changes: 0 additions & 85 deletions res/functional-tests/configuration.toml

This file was deleted.

91 changes: 91 additions & 0 deletions res/functional-tests/configuration.yaml
Original file line number Diff line number Diff line change
@@ -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"
Loading

0 comments on commit 726c7ba

Please sign in to comment.