Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 9f9d2b3

Browse files
author
Pablo Mercado
authored
Merge pull request #112 from triggermesh/task/http-poller-docs
HTTP Poller docs
2 parents 886b58e + addbd5b commit 9f9d2b3

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

docs/sources/httppoller.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Event Source for HTTP Polling
2+
3+
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.
4+
5+
## Prerequisites
6+
7+
- An external system that exposes an HTTP endpoint.
8+
- When using HTTP basic authentication, a secret containing the password.
9+
10+
## Deploying an Instance of the HTTP Poller Source
11+
12+
Open the Bridge creation screen and add a source of type `HTTP Poller`.
13+
14+
In the Source creation form add the following information:
15+
16+
- **Name**: all TriggerMesh components need a unique name per namespace.
17+
- **Broker**: request converted into [CloudEvents][ce] will be sent to this location.
18+
- **EventType**: string that identifies the purpose for all CloudEvent messages produced from this source.
19+
- **EventSource**: (optional) string that identifies the origin for all CloudEvent messages produced from this source.
20+
- **Enpoint**: URL location for the remote service to be polled.
21+
- **Method**: HTTP method.
22+
- **Frequency**: periodicity for requests formatted as [Go duration][go-duration].
23+
- **CA Certificate**: (optional) CA certificate configured for TLS connection as plain text.
24+
- **Skip Verify**: (optional) when set to true skips remote server TLS certificate verification.
25+
- **Basic Auth Username**: (optional) HTTP basic authentication username.
26+
- **Basic Auth Password** (optional) points to a secret that contains the HTTP basic authentication password.
27+
- **Headers** (optional) is a set of key/value pairs that will be set within the HTTP request.
28+
29+
`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.
30+
31+
When using `CA Certificate` it should be copied into the text area in plain text.
32+
33+
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.
34+
35+
## Events Types
36+
37+
The HTTP Poller Source creates a CloudEvent for each request received. CloudEvents header values are filled according to these rules:
38+
39+
- `event-type` is set to the source's provided value.
40+
- `event-source` is set to the source's provided value.
41+
- `id` is set to a generated UID.
42+
- `date` is timestamped when generating the CloudEvent at Triggermesh.
43+
44+
Request response body is used to fill the CloudEvent data.
45+
46+
[ce]: https://cloudevents.io
47+
[go-duration]: https://golang.org/pkg/time/#ParseDuration

docs/sources/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The following is a list of Triggermesh event Sources, some available as open sou
1414
* [AWS SNS](./awssns.md): Subscribe to messages from a AWS SNS topic.
1515
* [AWS SQS](./awssqs.md): Capture messages from an AWS SQS queue.
1616
* [Webhook](./webhook.md): Generic Webhook integration.
17+
* [HTTP Poller](./httppoller.md): Generic HTTP Poller.
1718
* [OCIMetrics](./ocimetrics.md): Oracle Cloud Infrastructure Metrics
1819
* [Salesforce](./salesforce.md): Consume messages from Salesforce Streaming API.
1920
* [Slack](./slack.md): Consume messages from Slack API.

docs/sources/webhook.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The exposed URL can be retrieved by navigating to `Services` and clicking on the
2626

2727
## Events Types
2828

29-
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.
29+
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.
3030

3131
Cloud Event header example:
3232

0 commit comments

Comments
 (0)