This is an automated email from the ASF dual-hosted git repository.

nferraro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


The following commit(s) were added to refs/heads/master by this push:
     new 85ee518  Add HTTP sink kamelet and fix CI
85ee518 is described below

commit 85ee518d37f38e110177195bbd20b39c664e3b59
Author: nicolaferraro <[email protected]>
AuthorDate: Tue Apr 13 13:16:36 2021 +0200

    Add HTTP sink kamelet and fix CI
---
 .github/workflows/test.yaml                        |  8 +--
 .../ROOT/assets/images/kamelets/http-sink.svg      |  8 +++
 docs/modules/ROOT/nav.adoc                         |  1 +
 docs/modules/ROOT/pages/dropbox-source.adoc        |  2 +-
 docs/modules/ROOT/pages/http-sink.adoc             | 61 ++++++++++++++++++++++
 earthquake-source.kamelet.yaml                     |  8 +--
 http-sink.kamelet.yaml                             | 38 ++++++++++++++
 7 files changed, 118 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index fcf210d..3346f4d 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -36,8 +36,8 @@ on:
       - 'NOTICE'
 
 env:
-  CAMEL_K_VERSION: 1.3.1
-  YAKS_VERSION: 0.3.0
+  CAMEL_K_VERSION: 1.3.2
+  YAKS_VERSION: 0.4.0-202104120032
 
 jobs:
   test:
@@ -49,7 +49,7 @@ jobs:
       uses: actions/checkout@v2
     - name: Get Camel K CLI
       run: |
-        curl -L --silent 
https://github.com/apache/camel-k/releases/download/v${CAMEL_K_VERSION}/camel-k-client-${CAMEL_K_VERSION}-linux-64bit.tar.gz
 -o kamel.tar.gz
+        curl --fail -L --silent 
https://github.com/apache/camel-k/releases/download/v${CAMEL_K_VERSION}/camel-k-client-${CAMEL_K_VERSION}-linux-64bit.tar.gz
 -o kamel.tar.gz
         mkdir -p _kamel
         tar -zxf kamel.tar.gz --directory ./_kamel
         sudo mv ./_kamel/kamel /usr/local/bin/
@@ -57,7 +57,7 @@ jobs:
         rm -r _kamel
     - name: Get YAKS CLI
       run: |
-        curl -L 
https://github.com/citrusframework/yaks/releases/download/v${YAKS_VERSION}/yaks-${YAKS_VERSION}-linux-64bit.tar.gz
 -o yaks.tar.gz
+        curl --fail -L --silent 
https://github.com/citrusframework/yaks/releases/download/${YAKS_VERSION}/yaks-${YAKS_VERSION}-linux-64bit.tar.gz
 -o yaks.tar.gz
         mkdir -p _yaks
         tar -zxf yaks.tar.gz --directory ./_yaks
         sudo mv ./_yaks/yaks /usr/local/bin/
diff --git a/docs/modules/ROOT/assets/images/kamelets/http-sink.svg 
b/docs/modules/ROOT/assets/images/kamelets/http-sink.svg
new file mode 100644
index 0000000..651a94f
--- /dev/null
+++ b/docs/modules/ROOT/assets/images/kamelets/http-sink.svg
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"; width="420"
+height="420" stroke="#000" fill="none">
+<path stroke-width="26"
+d="M209,15a195,195 0 1,0 2,0z"/>
+<path stroke-width="18"
+d="m210,15v390m195-195H15M59,90a260,260 0 0,0 302,0 m0,240 a260,260 0 
0,0-302,0M195,20a250,250 0 0,0 0,382 m30,0 a250,250 0 0,0 0-382"/>
+</svg>
\ No newline at end of file
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index ccac4d9..07ad84a 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -24,6 +24,7 @@
 * 
xref:ROOT:google-calendar-source.adoc[image:kamelets/google-calendar-source.svg[]
 Google Calendar Source]
 * xref:ROOT:google-mail-source.adoc[image:kamelets/google-mail-source.svg[] 
Google Mail Source]
 * 
xref:ROOT:google-sheets-source.adoc[image:kamelets/google-sheets-source.svg[] 
Google Sheets Source]
+* xref:ROOT:http-sink.adoc[image:kamelets/http-sink.svg[] HTTP Sink]
 * xref:ROOT:http-source.adoc[image:kamelets/http-source.svg[] HTTP Source]
 * xref:ROOT:jira-source.adoc[image:kamelets/jira-source.svg[] Jira Source]
 * xref:ROOT:kafka-source.adoc[image:kamelets/kafka-source.svg[] Kafka Source]
diff --git a/docs/modules/ROOT/pages/dropbox-source.adoc 
b/docs/modules/ROOT/pages/dropbox-source.adoc
index d9ba992..10601a6 100644
--- a/docs/modules/ROOT/pages/dropbox-source.adoc
+++ b/docs/modules/ROOT/pages/dropbox-source.adoc
@@ -13,7 +13,7 @@ The following table summarizes the configuration options 
available for the `drop
 | Property| Name| Description| Type| Default| Example
 | *accessToken {empty}* *| Dropbox Access Token| The access Token to use to 
access Dropbox| string| | 
 | *clientIdentifier {empty}* *| The client identifier| Dropbox App client 
Identifier| string| | 
-| *period {empty}* *| Period between polls| The interval between fetches to 
the earthquake API in milliseconds| integer| `10000`| 
+| *period {empty}* *| Period between polls| The interval between fetches to 
the Dropbox remote path in milliseconds| integer| `10000`| 
 | *query {empty}* *| Querys| A space-separated list of sub-strings to search 
for. A file matches only if it contains all the sub-strings. If this option is 
not set, all files will be matched.| string| | 
 | *remotePath {empty}* *| Remote path| Original file or folder to work with| 
string| | 
 |===
diff --git a/docs/modules/ROOT/pages/http-sink.adoc 
b/docs/modules/ROOT/pages/http-sink.adoc
new file mode 100644
index 0000000..2628ccd
--- /dev/null
+++ b/docs/modules/ROOT/pages/http-sink.adoc
@@ -0,0 +1,61 @@
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
+= image:kamelets/http-sink.svg[] HTTP Sink
+
+*Provided by: "Apache Software Foundation"*
+
+Forwards an event to a HTTP endpoint
+
+== Configuration Options
+
+The following table summarizes the configuration options available for the 
`http-sink` Kamelet:
+[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
+|===
+| Property| Name| Description| Type| Default| Example
+| *url {empty}* *| URL| The URL to send data to| string| | 
`"https://my-service/path"`
+| method| Method| The HTTP method to use| string| `"POST"`| 
+|===
+
+NOTE: Fields marked with ({empty}*) are mandatory.
+
+== Usage
+
+This section summarizes how the `http-sink` can be used in various contexts.
+
+=== Knative Sink
+
+The `http-sink` Kamelet can be used as Knative sink by binding it to a Knative 
object.
+
+.http-sink-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: http-sink-binding
+spec:
+  source:
+    ref:
+      kind: InMemoryChannel
+      apiVersion: messaging.knative.dev/v1
+      name: mychannel
+  sink:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: http-sink
+    properties:
+      url: "https://my-service/path";
+
+----
+
+Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K 
installed] into the Kubernetes cluster you're connected to.
+
+Save the `http-sink-binding.yaml` file into your hard drive, then configure it 
according to your needs.
+
+You can run the sink using the following command:
+
+[source,shell]
+----
+kubectl apply -f http-sink-binding.yaml
+----
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
diff --git a/earthquake-source.kamelet.yaml b/earthquake-source.kamelet.yaml
index 1247795..1954140 100755
--- a/earthquake-source.kamelet.yaml
+++ b/earthquake-source.kamelet.yaml
@@ -40,7 +40,7 @@ spec:
       - set-header:
           name: CamelCaffeineAction
           constant: GET
-      - to-d: "caffeine-cache:cache-${routeId}?key=lastUpdate"
+      - tod: "caffeine-cache:cache-${routeId}?key=lastUpdate"
       - choice:
           when:
           - simple: "${header.CamelCaffeineActionHasResult}"
@@ -56,7 +56,9 @@ spec:
       - set-header:
           name: CamelHttpMethod
           constant: GET
-      - to-d: 
"https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&updatedafter=${exchangeProperty.lastUpdate}&orderby=time-asc";
+      - tod: 
"https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&updatedafter=${exchangeProperty.lastUpdate}&orderby=time-asc";
+      - remove-header:
+          header-name: CamelHttpMethod
       - unmarshal:
           json: {}
       - set-property:
@@ -72,7 +74,7 @@ spec:
       - set-header:
           name: CamelCaffeineAction
           constant: PUT
-      - to-d: "caffeine-cache:cache-${routeId}?key=lastUpdate"
+      - tod: "caffeine-cache:cache-${routeId}?key=lastUpdate"
       - claim-check:
           operation: Pop
       - split:
diff --git a/http-sink.kamelet.yaml b/http-sink.kamelet.yaml
new file mode 100644
index 0000000..4da8c7a
--- /dev/null
+++ b/http-sink.kamelet.yaml
@@ -0,0 +1,38 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: http-sink
+  annotations:
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MjAiCmhlaWdodD0iNDIwIiBzdHJva2U9IiMwMDAiIGZpbGw9Im5vbmUiPgo8cGF0aCBzdHJva2Utd2lkdGg9IjI2IgpkPSJNMjA5LDE1YTE5NSwxOTUgMCAxLDAgMiwweiIvPgo8cGF0aCBzdHJva2Utd2lkdGg9IjE4IgpkPSJtMjEwLDE1djM5MG0xOTUtMTk1SDE1TTU5LDkwYTI2MCwyNjAgMCAwLDAgMzAyLDAgbTAsMjQwIGEyNjAsMjYwIDAgMCwwLTMwMiwwTTE5NSwyMGEyNTAsMjUwIDAgMCwwIDAsMzgyIG0zMC
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+  labels:
+    camel.apache.org/kamelet.type: sink
+    camel.apache.org/requires.runtime: "camel-quarkus"
+spec:
+  definition:
+    title: HTTP Sink
+    description: Forwards an event to a HTTP endpoint
+    required:
+    - url
+    properties:
+      url:
+        title: URL
+        description: The URL to send data to
+        type: string
+        example: "https://my-service/path";
+        pattern: "^(http|https)://.*"
+      method:
+        title: Method
+        description: The HTTP method to use
+        type: string
+        default: POST
+  dependencies:
+  - camel-quarkus:http
+  flow:
+    from:
+      uri: kamelet:source
+      steps:
+      - set-header:
+          name: CamelHttpMethod
+          constant: "{{method}}"
+      - to: "{{url}}"

Reply via email to