Skip to content

Commit

Permalink
refactor: Consolidate function pipeline configuration (#208)
Browse files Browse the repository at this point in the history
profiles updated for changes in function pipeline configuration for consolidation

closes #204

BEAKING CHANGE: function pipeline configuration changed

Signed-off-by: lenny <[email protected]>
  • Loading branch information
lenny-goodell authored Mar 4, 2021
1 parent a4c663a commit d52bde6
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 212 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/edgexfoundry/app-service-configurable

go 1.15

require github.com/edgexfoundry/app-functions-sdk-go/v2 v2.0.0-dev.24
require github.com/edgexfoundry/app-functions-sdk-go/v2 v2.0.0-dev.25
69 changes: 28 additions & 41 deletions res/functional-tests/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ LogLevel = "INFO"

[Writable.Pipeline]
UseTargetTypeOfByteArray = false
ExecutionOrder = "FilterByDeviceName, TransformToXML, SetOutputData"
ExecutionOrder = "FilterByDeviceName, Transform, SetOutputData"
[Writable.Pipeline.Functions.FilterByProfileName]
[Writable.Pipeline.Functions.FilterByProfileName.Parameters]
ProfileNames = ""
Expand All @@ -18,24 +18,16 @@ LogLevel = "INFO"
FilterOut = "false"
[Writable.Pipeline.Functions.AddTags]
[Writable.Pipeline.Functions.AddTags.Parameters]
tags=""
[Writable.Pipeline.Functions.TransformToXML]
[Writable.Pipeline.Functions.TransformToXML.Parameters]
NoOp = "" # Must have at least one parameter for function to be populated in Consul
[Writable.Pipeline.Functions.TransformToJSON]
[Writable.Pipeline.Functions.TransformToJSON.Parameters]
NoOp = "" # Must have at least one parameter for function to be populated in Consul
[Writable.Pipeline.Functions.CompressWithGZIP]
[Writable.Pipeline.Functions.CompressWithGZIP.Parameters]
NoOp = "" # Must have at least one parameter for function to be populated in Consul
[Writable.Pipeline.Functions.CompressWithZLIB]
[Writable.Pipeline.Functions.CompressWithZLIB.Parameters]
NoOp = "" # Must have at least one parameter for function to be populated in Consul
[Writable.Pipeline.Functions.MarkAsPushed]
[Writable.Pipeline.Functions.MarkAsPushed.Parameters]
NoOp = "" # Must have at least one parameter for function to be populated in Consul
[Writable.Pipeline.Functions.EncryptWithAES]
[Writable.Pipeline.Functions.EncryptWithAES.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 = "aes"
Key = "aquqweoruqwpeoruqwpoeruqwpoierupqoweiurpoqwiuerpqowieurqpowieurpoqiweuroipwqure"
InitVector = "123456789012345678901234567890"
SecretPath = ""
Expand All @@ -47,28 +39,23 @@ LogLevel = "INFO"
[Writable.Pipeline.Functions.PushToCore.Parameters]
DeviceName = ""
ReadingName = ""
[Writable.Pipeline.Functions.HTTPPost]
[Writable.Pipeline.Functions.HTTPPost.Parameters]
url = "http://"
mimeType = "" #OPTIONAL - default application/json
[Writable.Pipeline.Functions.HTTPPostJSON]
[Writable.Pipeline.Functions.HTTPPostJSON.Parameters]
url = "http://"
[Writable.Pipeline.Functions.HTTPPostXML]
[Writable.Pipeline.Functions.HTTPPostXML.Parameters]
url = "http://"
[Writable.Pipeline.Functions.MQTTSecretSend]
[Writable.Pipeline.Functions.MQTTSecretSend.Parameters]
brokeraddress = "tcps://localhost:8883"
topic = "mytopic"
secretpath = "mqtt"
clientid = "myclientid"
qos="0"
autoreconnect="false"
retain="false"
skipverify = "false"
authmode = "none"
persistOnError = "false"
[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"
SecretPath = "mqtt"
ClientId = "myclientid"
QOS="0"
AutoReconnect="false"
Retain="false"
SkipVerify = "false"
AuthMode = "none"
PersistOnError = "false"

[Service]
BootTimeout = "30s"
Expand Down
101 changes: 44 additions & 57 deletions res/http-export/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,63 +7,50 @@
MaxRetryCount = 10

[Writable.Pipeline]
UseTargetTypeOfByteArray = false
ExecutionOrder = "FilterByDeviceName, TransformToJSON, HTTPPostJSON"
[Writable.Pipeline.Functions.TransformToXML]
[Writable.Pipeline.Functions.TransformToXML.Parameters]
NoOp = "" # Must have at least one parameter for function to be populated in Consul
[Writable.Pipeline.Functions.TransformToJSON]
[Writable.Pipeline.Functions.TransformToJSON.Parameters]
NoOp = "" # Must have at least one parameter for function to be populated in Consul
[Writable.Pipeline.Functions.CompressWithGZIP]
[Writable.Pipeline.Functions.CompressWithGZIP.Parameters]
NoOp = "" # Must have at least one parameter for function to be populated in Consul
[Writable.Pipeline.Functions.CompressWithZLIB]
[Writable.Pipeline.Functions.CompressWithZLIB.Parameters]
NoOp = "" # Must have at least one parameter for function to be populated in Consul
[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.FilterByResourceName]
[Writable.Pipeline.Functions.FilterByResourceName.Parameters]
ResourceNames = ""
FilterOut = "false"
[Writable.Pipeline.Functions.HTTPPostJSON]
[Writable.Pipeline.Functions.HTTPPostJSON.Parameters]
url = "https://f095cfcd-a3f6-4885-85ea-7157c6afd17e.mock.pstmn.io" # Postman mock service
persistOnError = "false"
headername = "" # Name of the header key to add to the HTTP header
secretname = "" # Name of the secret for the header value in the SecretStore
secretpath = "" # Path to the secret for the header value in the SecretStore
[Writable.Pipeline.Functions.HTTPPutJSON]
[Writable.Pipeline.Functions.HTTPPutJSON.Parameters]
url = "https://f095cfcd-a3f6-4885-85ea-7157c6afd17e.mock.pstmn.io" # Postman mock service
persistOnError = "false"
headername = "" # Name of the header key to add to the HTTP header
secretname = "" # Name of the secret for the header value in the SecretStore
secretpath = "" # Path to the secret for the header value in the SecretStore
[Writable.Pipeline.Functions.HTTPPostXML]
[Writable.Pipeline.Functions.HTTPPostXML.Parameters]
url = "https://f095cfcd-a3f6-4885-85ea-7157c6afd17e.mock.pstmn.io" # Postman mock service
persistOnError = "false"
headername = "" # Name of the header key to add to the HTTP header
secretname = "" # Name of the secret for the header value in the SecretStore
secretpath = "" # Path to the secret for the header value in the SecretStore
[Writable.Pipeline.Functions.HTTPPutXML]
[Writable.Pipeline.Functions.HTTPPutXML.Parameters]
url = "https://f095cfcd-a3f6-4885-85ea-7157c6afd17e.mock.pstmn.io" # Postman mock service
persistOnError = "false"
headername = "" # Name of the header key to add to the HTTP header
secretname = "" # Name of the secret for the header value in the SecretStore
secretpath = "" # Path to the secret for the header value in the SecretStore
[Writable.Pipeline.Functions.AddTags]
[Writable.Pipeline.Functions.AddTags.Parameters]
tags=""
UseTargetTypeOfByteArray = false
ExecutionOrder = "FilterByDeviceName, Transform, HTTPExport"
[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.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 = "aes" # currently can be only be 'aes'
Key = "aquqweoruqwpeoruqwpoeruqwpoierupqoweiurpoqwiuerpqowieurqpowieurpoqiweuroipwqure"
InitVector = "123456789012345678901234567890"
SecretPath = ""
SecretName = ""
[Writable.Pipeline.Functions.Batch]
[Writable.Pipeline.Functions.Batch.Parameters]
Mode = "bytimecount" # can be 'bycount', 'bytime' or 'bytimecount'
BatchThreshold = "30"
TimeInterval = "60s"
[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 = "https://f095cfcd-a3f6-4885-85ea-7157c6afd17e.mock.pstmn.io" # Postman mock service
PersistOnError = "false"
HeaderName = "" # Name of the header key to add to the HTTP header
SecretName = "" # Name of the secret for the header value in the SecretStore
SecretPath = "" # Path to the secret for the header value in the SecretStore

# InsecureSecrets are required for Store and Forward DB access and for authenticated HTTP exports when not using
# security services, i.e. Vault
Expand Down
58 changes: 32 additions & 26 deletions res/mqtt-export/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,7 @@ LogLevel = "INFO"
MaxRetryCount = 10

[Writable.Pipeline]
ExecutionOrder = "TransformToJSON, MQTTSecretSend"
[Writable.Pipeline.Functions.TransformToXML]
[Writable.Pipeline.Functions.TransformToXML.Parameters]
NoOp = "" # Must have at least one parameter for function to be populated in Consul
[Writable.Pipeline.Functions.TransformToJSON]
[Writable.Pipeline.Functions.TransformToJSON.Parameters]
NoOp = "" # Must have at least one parameter for function to be populated in Consul
[Writable.Pipeline.Functions.CompressWithGZIP]
[Writable.Pipeline.Functions.CompressWithGZIP.Parameters]
NoOp = "" # Must have at least one parameter for function to be populated in Consul
[Writable.Pipeline.Functions.CompressWithZLIB]
[Writable.Pipeline.Functions.CompressWithZLIB.Parameters]
NoOp = "" # Must have at least one parameter for function to be populated in Consul
ExecutionOrder = "Transform, MQTTExport"
[Writable.Pipeline.Functions.FilterByProfileName]
[Writable.Pipeline.Functions.FilterByProfileName.Parameters]
ProfileNames = ""
Expand All @@ -32,21 +20,39 @@ LogLevel = "INFO"
[Writable.Pipeline.Functions.FilterByResourceName.Parameters]
ResourceNames = ""
FilterOut = "false"
[Writable.Pipeline.Functions.MQTTSecretSend]
[Writable.Pipeline.Functions.MQTTSecretSend.Parameters]
brokeraddress = "tcp://broker.hivemq.com:1883" # Hive Public Test Broker
topic = "edgex-export"
secretpath = "mqtt"
clientid = "MQTT-Export"
qos="0"
autoreconnect="true"
retain="false"
skipverify = "false"
authmode = "none"
persistOnError = "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 = "aes" # currently can be only be 'aes'
Key = "aquqweoruqwpeoruqwpoeruqwpoierupqoweiurpoqwiuerpqowieurqpowieurpoqiweuroipwqure"
InitVector = "123456789012345678901234567890"
SecretPath = ""
SecretName = ""
[Writable.Pipeline.Functions.Batch]
[Writable.Pipeline.Functions.Batch.Parameters]
Mode = "bytimecount" # can be 'bycount', 'bytime' or 'bytimecount'
BatchThreshold = "30"
TimeInterval = "60s"
[Writable.Pipeline.Functions.AddTags]
[Writable.Pipeline.Functions.AddTags.Parameters]
tags=""
Tags=""
[Writable.Pipeline.Functions.MQTTExport]
[Writable.Pipeline.Functions.MQTTExport.Parameters]
BrokerAddress = "tcp://broker.hivemq.com:1883" # Hive Public Test Broker
Topic = "edgex-export"
SecretPath = "mqtt"
ClientId = "MQTT-Export"
QOS="0"
AutoReconnect="true"
Retain="false"
SkipVerify = "false"
AuthMode = "none"
PersistOnError = "false"

# InsecureSecrets are required for Store and Forward DB access and for authenticated MQTT exports with
# new MQTTSecretSend function when not using security services, i.e. Vault
Expand Down
Loading

0 comments on commit d52bde6

Please sign in to comment.