You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/07/01 12:47:11 UTC

[camel-kamelets] branch main updated (0ae207b -> ab0de7e)

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

acosentino pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git.


    from 0ae207b  Regen for commit 35e81bf409aca0fe9a27b4f540310bbdd691b694
     new cd8c318  Added Mustache Template Action Kamelet
     new 94599dd  Added Mustache Template Action Kamelet
     new 6450e77  Added Mustache Template Action Kamelet
     new ab0de7e  Added Mustache Template Action Kamelet

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ...key-action.svg => mustache-template-action.svg} |  0
 docs/modules/ROOT/nav.adoc                         |  1 +
 docs/modules/ROOT/pages/mongodb-sink.adoc          |  6 +++
 ...r-action.adoc => mustache-template-action.adoc} | 44 +++++++++++-----------
 ....yaml => mustache-template-action.kamelet.yaml} | 38 ++++++++++---------
 ...t.yaml => mustache-template-action.kamelet.yaml | 38 ++++++++++---------
 6 files changed, 70 insertions(+), 57 deletions(-)
 copy docs/modules/ROOT/assets/images/kamelets/{value-to-key-action.svg => mustache-template-action.svg} (100%)
 copy docs/modules/ROOT/pages/{has-header-filter-action.adoc => mustache-template-action.adoc} (67%)
 copy library/camel-kamelets-catalog/src/main/resources/kamelets/{has-header-filter-action.kamelet.yaml => mustache-template-action.kamelet.yaml} (88%)
 copy library/camel-kamelets-catalog/src/main/resources/kamelets/has-header-filter-action.kamelet.yaml => mustache-template-action.kamelet.yaml (88%)

[camel-kamelets] 03/04: Added Mustache Template Action Kamelet

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 6450e77ca88efcc4ff3cb80ebd7a31518a1105d8
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Jul 1 14:38:15 2021 +0200

    Added Mustache Template Action Kamelet
---
 docs/modules/ROOT/nav.adoc                | 1 +
 docs/modules/ROOT/pages/mongodb-sink.adoc | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 31ab73d..f7f7176 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -83,6 +83,7 @@
 * xref:ROOT:mongodb-sink.adoc[image:kamelets/mongodb-sink.svg[] MongoDB Sink]
 * xref:ROOT:mongodb-source.adoc[image:kamelets/mongodb-source.svg[] MongoDB Source]
 * xref:ROOT:mqtt-source.adoc[image:kamelets/mqtt-source.svg[] MQTT Source]
+* xref:ROOT:mustache-template-action.adoc[image:kamelets/mustache-template-action.svg[] Mustache Template Action]
 * xref:ROOT:mysql-sink.adoc[image:kamelets/mysql-sink.svg[] MySQL Sink]
 * xref:ROOT:mysql-source.adoc[image:kamelets/mysql-source.svg[] MySQL Source]
 * xref:ROOT:nats-sink.adoc[image:kamelets/nats-sink.svg[] NATS Sink]
diff --git a/docs/modules/ROOT/pages/mongodb-sink.adoc b/docs/modules/ROOT/pages/mongodb-sink.adoc
index d3f517a..6c65112 100644
--- a/docs/modules/ROOT/pages/mongodb-sink.adoc
+++ b/docs/modules/ROOT/pages/mongodb-sink.adoc
@@ -9,6 +9,10 @@ Send documents to MongoDB.
 
 This Kamelet expects a JSON as body.
 
+Properties you can as headers:
+
+`db-upsert` / `ce-db-upsert` If the database should create the element if it does not exist. Boolean value.
+
 == Configuration Options
 
 The following table summarizes the configuration options available for the `mongodb-sink` Kamelet:
@@ -20,6 +24,8 @@ The following table summarizes the configuration options available for the `mong
 | *hosts {empty}* *| MongoDB Hosts| Comma separated list of MongoDB Host Addresses in host:port format.| string| | 
 | *password {empty}* *| MongoDB Password| User password for accessing MongoDB.| string| | 
 | *username {empty}* *| MongoDB Username| Username for accessing MongoDB.| string| | 
+| createCollection| Collection| Create collection during initialisation if it doesn't exist.| boolean| `false`| 
+| writeConcern| Write Concern| Configure the level of acknowledgment requested from MongoDB for write operations, possible values are ACKNOWLEDGED, W1, W2, W3, UNACKNOWLEDGED, JOURNALED, MAJORITY.| string| | 
 |===
 
 NOTE: Fields marked with ({empty}*) are mandatory.

[camel-kamelets] 01/04: Added Mustache Template Action Kamelet

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit cd8c318577562f87b98c2d4b6a864d946017565e
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Jul 1 14:36:23 2021 +0200

    Added Mustache Template Action Kamelet
---
 mustache-template-action.kamelet.yaml | 38 +++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/mustache-template-action.kamelet.yaml b/mustache-template-action.kamelet.yaml
new file mode 100644
index 0000000..568c33c
--- /dev/null
+++ b/mustache-template-action.kamelet.yaml
@@ -0,0 +1,38 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: mustache-template-action
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "main-SNAPSHOT"
+    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "Actions"
+  labels:
+    camel.apache.org/kamelet.type: "action"
+spec:
+  definition:
+    title: "Mustache Template Action"
+    description: |-
+      Apply a Mustache Template.
+
+      The template property needs to be encoded in base64, so when you pass it as parameter, don't forget to encode it.
+    required:
+      - template
+    type: object
+    properties:
+      template:
+        title: Template
+        description: The inline template
+        type: binary
+  dependencies:
+  - "camel:mustache"
+  - "camel:kamelet"
+  flow:
+    from:
+      uri: "kamelet:source"
+      steps:
+      - to:
+          uri: "mustache:"
+          parameters:
+            resourceUri: "base64:{{template}}"

[camel-kamelets] 02/04: Added Mustache Template Action Kamelet

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 94599dd9f8fb4414ada6dcba53aecc7e54c831ae
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Jul 1 14:37:34 2021 +0200

    Added Mustache Template Action Kamelet
---
 .../kamelets/mustache-template-action.kamelet.yaml | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/library/camel-kamelets-catalog/src/main/resources/kamelets/mustache-template-action.kamelet.yaml b/library/camel-kamelets-catalog/src/main/resources/kamelets/mustache-template-action.kamelet.yaml
new file mode 100644
index 0000000..568c33c
--- /dev/null
+++ b/library/camel-kamelets-catalog/src/main/resources/kamelets/mustache-template-action.kamelet.yaml
@@ -0,0 +1,38 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: mustache-template-action
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "main-SNAPSHOT"
+    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "Actions"
+  labels:
+    camel.apache.org/kamelet.type: "action"
+spec:
+  definition:
+    title: "Mustache Template Action"
+    description: |-
+      Apply a Mustache Template.
+
+      The template property needs to be encoded in base64, so when you pass it as parameter, don't forget to encode it.
+    required:
+      - template
+    type: object
+    properties:
+      template:
+        title: Template
+        description: The inline template
+        type: binary
+  dependencies:
+  - "camel:mustache"
+  - "camel:kamelet"
+  flow:
+    from:
+      uri: "kamelet:source"
+      steps:
+      - to:
+          uri: "mustache:"
+          parameters:
+            resourceUri: "base64:{{template}}"

[camel-kamelets] 04/04: Added Mustache Template Action Kamelet

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ab0de7e4849865b87b5a97f68519af17320b37a9
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Jul 1 14:38:28 2021 +0200

    Added Mustache Template Action Kamelet
---
 .../images/kamelets/mustache-template-action.svg   |  59 +++++++++
 .../ROOT/pages/mustache-template-action.adoc       | 140 +++++++++++++++++++++
 2 files changed, 199 insertions(+)

diff --git a/docs/modules/ROOT/assets/images/kamelets/mustache-template-action.svg b/docs/modules/ROOT/assets/images/kamelets/mustache-template-action.svg
new file mode 100644
index 0000000..fa06352
--- /dev/null
+++ b/docs/modules/ROOT/assets/images/kamelets/mustache-template-action.svg
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   viewBox="0 -256 1792 1792"
+   id="svg3025"
+   version="1.1"
+   inkscape:version="0.48.3.1 r9886"
+   width="100%"
+   height="100%"
+   sodipodi:docname="cog_font_awesome.svg">
+  <metadata
+     id="metadata3035">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs3033" />
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="640"
+     inkscape:window-height="480"
+     id="namedview3031"
+     showgrid="false"
+     inkscape:zoom="0.13169643"
+     inkscape:cx="896"
+     inkscape:cy="896"
+     inkscape:window-x="0"
+     inkscape:window-y="25"
+     inkscape:window-maximized="0"
+     inkscape:current-layer="svg3025" />
+  <g
+     transform="matrix(1,0,0,-1,121.49153,1285.4237)"
+     id="g3027">
+    <path
+       d="m 1024,640 q 0,106 -75,181 -75,75 -181,75 -106,0 -181,-75 -75,-75 -75,-181 0,-106 75,-181 75,-75 181,-75 106,0 181,75 75,75 75,181 z m 512,109 V 527 q 0,-12 -8,-23 -8,-11 -20,-13 l -185,-28 q -19,-54 -39,-91 35,-50 107,-138 10,-12 10,-25 0,-13 -9,-23 -27,-37 -99,-108 -72,-71 -94,-71 -12,0 -26,9 l -138,108 q -44,-23 -91,-38 -16,-136 -29,-186 -7,-28 -36,-28 H 657 q -14,0 -24.5,8.5 Q 622,-111 621,-98 L 593,86 q -49,16 -90,37 L 362,16 Q 352,7 337,7 323,7 312,18 186,132 147,186 q -7 [...]
+       id="path3029"
+       inkscape:connector-curvature="0"
+       style="fill:currentColor" />
+  </g>
+</svg>
diff --git a/docs/modules/ROOT/pages/mustache-template-action.adoc b/docs/modules/ROOT/pages/mustache-template-action.adoc
new file mode 100644
index 0000000..8805d96
--- /dev/null
+++ b/docs/modules/ROOT/pages/mustache-template-action.adoc
@@ -0,0 +1,140 @@
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
+= image:kamelets/mustache-template-action.svg[] Mustache Template Action
+
+*Provided by: "Apache Software Foundation"*
+
+*Support Level for this Kamelet is: "Preview"*
+
+Apply a Mustache Template.
+
+The template property needs to be encoded in base64, so when you pass it as parameter, don't forget to encode it.
+
+== Configuration Options
+
+The following table summarizes the configuration options available for the `mustache-template-action` Kamelet:
+[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
+|===
+| Property| Name| Description| Type| Default| Example
+| *template {empty}* *| Template| The inline template| binary| | 
+|===
+
+NOTE: Fields marked with ({empty}*) are mandatory.
+
+== Usage
+
+This section summarizes how the `mustache-template-action` can be used in various contexts.
+
+=== Knative Action
+
+The `mustache-template-action` Kamelet can be used as intermediate step in a Knative binding.
+
+.mustache-template-action-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: mustache-template-action-binding
+spec:
+  source:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: timer-source
+    properties:
+      message: "Hello"
+  steps:
+  - ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: mustache-template-action
+    properties:
+      template: "The Template"
+  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 `mustache-template-action-binding.yaml` file into your hard drive, then configure it according to your needs.
+
+You can run the action using the following command:
+
+[source,shell]
+----
+kubectl apply -f mustache-template-action-binding.yaml
+----
+
+==== *Binding to Knative using the Kamel CLI:*
+
+The procedure described above can be simplified into a single execution of the `kamel bind` command:
+
+[source,shell]
+----
+kamel bind timer-source?message=Hello --step mustache-template-action -p "step-0.template=The Template" channel/mychannel
+----
+
+This will create the KameletBinding under the hood and apply it to the current namespace in the cluster.
+
+=== Kafka Action
+
+The `mustache-template-action` Kamelet can be used as intermediate step in a Kafka binding.
+
+.mustache-template-action-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: mustache-template-action-binding
+spec:
+  source:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: timer-source
+    properties:
+      message: "Hello"
+  steps:
+  - ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: mustache-template-action
+    properties:
+      template: "The Template"
+  sink:
+    ref:
+      kind: KafkaTopic
+      apiVersion: kafka.strimzi.io/v1beta1
+      name: my-topic
+
+----
+
+Ensure that you've installed https://strimzi.io/[Strimzi] and created a topic named `my-topic` in the current namespace.
+Make also sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to.
+
+Save the `mustache-template-action-binding.yaml` file into your hard drive, then configure it according to your needs.
+
+You can run the action using the following command:
+
+[source,shell]
+----
+kubectl apply -f mustache-template-action-binding.yaml
+----
+
+==== *Binding to Kafka using the Kamel CLI:*
+
+The procedure described above can be simplified into a single execution of the `kamel bind` command:
+
+[source,shell]
+----
+kamel bind timer-source?message=Hello --step mustache-template-action -p "step-0.template=The Template" kafka.strimzi.io/v1beta1:KafkaTopic:my-topic
+----
+
+This will create the KameletBinding under the hood and apply it to the current namespace in the cluster.
+
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT