Skip to content

Commit

Permalink
add a webhook kamelet
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaferraro committed Feb 19, 2021
1 parent d50f598 commit 6a9d162
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
* xref:ROOT:slack-source.adoc[image:kamelets/slack-source.svg[] Slack Source]
* xref:ROOT:telegram-source.adoc[image:kamelets/telegram-source.svg[] Telegram Source]
* xref:ROOT:timer-source.adoc[image:kamelets/timer-source.svg[] Timer Source]
* xref:ROOT:webhook-source.adoc[image:kamelets/webhook-source.svg[] Webhook Source]
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
64 changes: 64 additions & 0 deletions docs/modules/ROOT/pages/webhook-source.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
= image:kamelets/webhook-source.svg[] Webhook Source

*Provided by: "Apache Software Foundation"*

Creates an HTTP endpoint that can be used as a bridge to forward data to the Kamelet sink.

The "subpath" parameter of the Webhook source allows to customize the subpath where the integration will respond to HTTP requests.
It's common to use a non-guessable ID for that parameter.

When the "subpath" parameter is set to "webhook" (default), the integration will accept requests at the "https://integration-external-url/webhook" endpoint.

== Configuration Options

The following table summarizes the configuration options available for the `webhook-source` Kamelet:
[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
|===
| Property| Name| Description| Type| Default| Example
| subpath| Subpath| The subpath where the webhook is registered
| string| `"webhook"`|
|===

NOTE: Fields marked with ({empty}*) are mandatory.

== Usage

This section summarizes how the `webhook-source` can be used in various contexts.

=== Knative Source

The `webhook-source` Kamelet can be used as Knative source by binding it to a Knative object.

.webhook-source-binding.yaml
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: webhook-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: webhook-source
sink:
ref:
kind: InMemoryChannel
apiVersion: messaging.knative.dev/v1
name: mychannel
----

Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to.

Save the `webhook-source-binding.yaml` file into your hard drive, then configure it according to your needs.

You can run the source using the following command:

[source,shell]
----
kubectl apply -f webhook-source-binding.yaml
----
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
31 changes: 31 additions & 0 deletions webhook-source.kamelet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: webhook-source
annotations:
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ijk0NCAtNzcxIDI1MDAgMjMzNCI+PHBhdGggZD0iTTIxMTEuNCAyMTAuNWMtMTAzLjYgMTc0LjItMjAyLjkgMzQyLjktMzA0LjIgNTEwLjMtMjYgNDMtMzguOSA3OC0xOC4xIDEzMi42IDU3LjQgMTUwLjktMjMuNiAyOTcuOC0xNzUuOCAzMzcuNi0xNDMuNSAzNy42LTI4My40LTU2LjctMzExLjgtMjEwLjQtMjUuMi0xMzYgODAuMy0yNjkuMyAyMzAuMy0yOTAuNiAxMi42LTEuOCAyNS40LTIgNDYuNS0zLjZsMjI4LjEtMzgyLjVjLTE0My41LTE0Mi43LTIyOC45LTMwOS40LTIxMC01MTYgMTMuNC0xNDYuMSA3MC44LTI3Mi4zIDE3NS44LTM3NS44IDIwMS0xOTguMSA1MDcuOC0yMzAuMiA3NDQuNS03OC4xIDIyNy40IDE0Ni4xIDMzMS41IDQzMC42IDI0Mi44IDY3NC4xLTY2LjktMTguMS0xMzQuMy0zNi40LTIwOC40LTU2LjUgMjcuOS0xMzU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NS4zLTU2Ny44IDQ2MC43LTYyNy45IDE5IDY5LjEgMzguMiAxMzguOCA1Ny4yIDIwNy43LTI1Mi43IDEyOC45LTM0MC4yIDI5MS40LTI2OS40IDQ5NC41IDYyLjMgMTc4LjggMjM5LjEgMjc2LjcgNDMxLjEgMjM4LjggMTk2LjEtMzguNyAyOTUtMjAxLjcgMjgyLjktNDYzLjIgMTg1LjkgMCAzNzItMS45IDU1Ny45LjkgNzIuNiAxLjEgMTI4LjYtNi40IDE4My4zLTcwLjQgOTAtMTA1LjMgMjU1LjgtOTUuOCAzNTIuNyAzLjcgOTkuMSAxMDEuNyA5NC40IDI2NS4yLTEwLjUgMzYyLjYtMTAxLjIgOTMuOS0yNjEgODguOS0zNTUuNy0xMi4zLTE5LjUtMjAuOC0zNC44LTQ1LjUtNTQtNzEuMnoiIGZpbGw9IiM0YTRhNGEiLz48L3N2Zz4="
camel.apache.org/provider: "Apache Software Foundation"
labels:
camel.apache.org/kamelet.type: "source"
spec:
definition:
title: "Webhook Source"
description: |-
Creates an HTTP endpoint that can be used as a bridge to forward data to the Kamelet sink.
The "subpath" parameter of the Webhook source allows to customize the subpath where the integration will respond to HTTP requests.
It's common to use a non-guessable ID for that parameter.
When the "subpath" parameter is set to "webhook" (default), the integration will accept requests at the "https://integration-external-url/webhook" endpoint.
properties:
subpath:
title: Subpath
description: |
The subpath where the webhook is registered
type: string
default: "webhook"
flow:
from:
uri: "platform-http:///{{subpath}}"
steps:
- to: "kamelet:sink"

0 comments on commit 6a9d162

Please sign in to comment.