Skip to content

Commit

Permalink
Merge pull request #112 from triggermesh/task/http-poller-docs
Browse files Browse the repository at this point in the history
HTTP Poller docs
  • Loading branch information
Pablo Mercado authored Apr 1, 2021
2 parents 886b58e + addbd5b commit 9f9d2b3
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
47 changes: 47 additions & 0 deletions docs/sources/httppoller.md
Original file line number Diff line number Diff line change
@@ -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 Poller`.

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 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.

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 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.
- `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
1 change: 1 addition & 0 deletions docs/sources/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit 9f9d2b3

Please sign in to comment.