From a3648c66898ce141012bf31122bd0bcfb532589e Mon Sep 17 00:00:00 2001 From: Pablo Mercado Date: Wed, 31 Mar 2021 22:52:59 +0200 Subject: [PATCH 1/5] add HTTP Poller docs --- docs/sources/httppoller.md | 47 ++++++++++++++++++++++++++++++++++++++ docs/sources/index.md | 1 + 2 files changed, 48 insertions(+) create mode 100644 docs/sources/httppoller.md diff --git a/docs/sources/httppoller.md b/docs/sources/httppoller.md new file mode 100644 index 000000000..c4c69f981 --- /dev/null +++ b/docs/sources/httppoller.md @@ -0,0 +1,47 @@ +# Event Source for HTTP Polling + +This event source launches periodic HTTP requests against an external system endpoint, turning received requests into [CloudEvents][ce] to be consumed by other TriggerMesh components. + +## Prerequisites + +- An external system that exposes an HTTP endpoint. +- When using HTTP basic authentication, a secret containing the password. + +## Deploying an Instance of the HTTP Poller Source + +Open the Bridge creation screen and add a source of type `HTTP Source`. + +In the Source creation form add the following information: + +- **Name**: all Triggermesh components need a unique name per namespace. +- **Broker**: request converted into [CloudEvents][ce] will be sent to this location. +- **EventType**: string that identifies the purpose for all CloudEvent messages produced from this source. +- **EventSource**: (optional) string that identifies the origin for all CloudEvent messages produced from this source. +- **Enpoint**: URL location for the remote service to be polled. +- **Method**: HTTP method. +- **Frequency**: periodicity for requests formatted as [Go duration][go-duration]. +- **CA Certificate**: (optional) CA certificate configured for TLS connection as plain text. +- **Skip Verify**: (optional) when set to true skips remote server TLS certificate verification. +- **Basic Auth Username**: (optional) HTTP basic authentication username. +- **Basic Auth Password** (optional) points to a secret that contains the HTTP basic authentication password. +- **Headers** (optional) is a set of key/value pairs that will be set within the HTTP request. + +`Frequency` is formated after [Go's duration parsing][go-duration]. Most tipically this value will contain a number followed by one of "ns", "us" or "µs", "ms", "s", "m", "h". Valid examples are `15000ms` or `15s` for 15 seconds, `60m` or `1h` for one hour. + +When using `CA Certificate` it should be copied into the text area in plain text. + +After clicking the `Save` button, you will be taken back to the Bridge editor. Proceed to adding the remaining components to the Bridge, then submit it. + +## Events Types + +The HTTP source creates a CloudEvent for each request received. CloudEvents header values are filled according to these rules: + +- `event-type` is set to the source's provided value. +- `event-source` is set to the source's provided value. +- `id` is set to a generated UID. +- `date` is timestamped when generating the CloudEvent at Triggermesh. + +Request response body is used to fill the CloudEvent data. + +[ce]: https://cloudevents.io +[go-duration]: https://golang.org/pkg/time/#ParseDuration \ No newline at end of file diff --git a/docs/sources/index.md b/docs/sources/index.md index bebb8e61b..f6f9aed47 100644 --- a/docs/sources/index.md +++ b/docs/sources/index.md @@ -14,6 +14,7 @@ The following is a list of Triggermesh event Sources, some available as open sou * [AWS SNS](./awssns.md): Subscribe to messages from a AWS SNS topic. * [AWS SQS](./awssqs.md): Capture messages from an AWS SQS queue. * [Webhook](./webhook.md): Generic Webhook integration. +* [HTTP Poller](./httppoller.md): Generic HTTP Poller. * [OCIMetrics](./ocimetrics.md): Oracle Cloud Infrastructure Metrics * [Salesforce](./salesforce.md): Consume messages from Salesforce Streaming API. * [Slack](./slack.md): Consume messages from Slack API. From eb390089bc41c64b3f1ea8e98ecde6cd19b4ac30 Mon Sep 17 00:00:00 2001 From: Pablo Mercado Date: Wed, 31 Mar 2021 23:17:55 +0200 Subject: [PATCH 2/5] fix remaining HTTP Source references --- docs/sources/httppoller.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sources/httppoller.md b/docs/sources/httppoller.md index c4c69f981..2cd95f419 100644 --- a/docs/sources/httppoller.md +++ b/docs/sources/httppoller.md @@ -9,7 +9,7 @@ This event source launches periodic HTTP requests against an external system end ## Deploying an Instance of the HTTP Poller Source -Open the Bridge creation screen and add a source of type `HTTP Source`. +Open the Bridge creation screen and add a source of type `HTTP Poller`. In the Source creation form add the following information: @@ -34,7 +34,7 @@ After clicking the `Save` button, you will be taken back to the Bridge editor. P ## Events Types -The HTTP source creates a CloudEvent for each request received. CloudEvents header values are filled according to these rules: +The HTTP Poller Source creates a CloudEvent for each request received. CloudEvents header values are filled according to these rules: - `event-type` is set to the source's provided value. - `event-source` is set to the source's provided value. From 10d851f63d73b20c48302692fb6e5953d9ae3655 Mon Sep 17 00:00:00 2001 From: Pablo Mercado Date: Wed, 31 Mar 2021 23:18:45 +0200 Subject: [PATCH 3/5] can I also fix webhook copy/paste errors here? --- docs/sources/webhook.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/webhook.md b/docs/sources/webhook.md index befbce001..ff7fd06e9 100644 --- a/docs/sources/webhook.md +++ b/docs/sources/webhook.md @@ -26,7 +26,7 @@ The exposed URL can be retrieved by navigating to `Services` and clicking on the ## Events Types -The HTTP source creates a cloud event for each request received. CloudEvents header event type and event source are set to the configured values. Event data is set to the received body at the request. +The Webhook source creates a cloud event for each request received. CloudEvents header event type and event source are set to the configured values. Event data is set to the received body at the request. Cloud Event header example: From 4cde9008b630b83eee1aaabbfd4ec9b2db67eb18 Mon Sep 17 00:00:00 2001 From: Pablo Mercado Date: Thu, 1 Apr 2021 08:43:39 +0200 Subject: [PATCH 4/5] Update docs/sources/httppoller.md Co-authored-by: Sameer Naik --- docs/sources/httppoller.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sources/httppoller.md b/docs/sources/httppoller.md index 2cd95f419..4b861ecf0 100644 --- a/docs/sources/httppoller.md +++ b/docs/sources/httppoller.md @@ -13,7 +13,7 @@ Open the Bridge creation screen and add a source of type `HTTP Poller`. In the Source creation form add the following information: -- **Name**: all Triggermesh components need a unique name per namespace. +- **Name**: all TriggerMesh components need a unique name per namespace. - **Broker**: request converted into [CloudEvents][ce] will be sent to this location. - **EventType**: string that identifies the purpose for all CloudEvent messages produced from this source. - **EventSource**: (optional) string that identifies the origin for all CloudEvent messages produced from this source. @@ -44,4 +44,4 @@ The HTTP Poller Source creates a CloudEvent for each request received. CloudEven Request response body is used to fill the CloudEvent data. [ce]: https://cloudevents.io -[go-duration]: https://golang.org/pkg/time/#ParseDuration \ No newline at end of file +[go-duration]: https://golang.org/pkg/time/#ParseDuration From addbd5bdf5170d105e5c461ee07f8593e0f57f30 Mon Sep 17 00:00:00 2001 From: Pablo Mercado Date: Thu, 1 Apr 2021 08:43:49 +0200 Subject: [PATCH 5/5] Update docs/sources/httppoller.md Co-authored-by: Sameer Naik --- docs/sources/httppoller.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/httppoller.md b/docs/sources/httppoller.md index 4b861ecf0..bb09f8534 100644 --- a/docs/sources/httppoller.md +++ b/docs/sources/httppoller.md @@ -26,7 +26,7 @@ In the Source creation form add the following information: - **Basic Auth Password** (optional) points to a secret that contains the HTTP basic authentication password. - **Headers** (optional) is a set of key/value pairs that will be set within the HTTP request. -`Frequency` is formated after [Go's duration parsing][go-duration]. Most tipically this value will contain a number followed by one of "ns", "us" or "µs", "ms", "s", "m", "h". Valid examples are `15000ms` or `15s` for 15 seconds, `60m` or `1h` for one hour. +`Frequency` is formatted after [Go's duration parsing][go-duration]. Most typically this value will contain a number followed by one of "ns", "us" or "µs", "ms", "s", "m", "h". Valid examples are `15000ms` or `15s` for 15 seconds, `60m` or `1h` for one hour. When using `CA Certificate` it should be copied into the text area in plain text.