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/12/21 12:20:20 UTC

[camel-kamelets] branch json-patch-action created (now 2c2621f)

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

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


      at 2c2621f  Added Json Patch Action Kamelet - Templates

This branch includes the following new commits:

     new 236d260  Added Json Patch Action Kamelet
     new 3a1bccc  Added Json Patch Action Kamelet
     new 4fdabd7  Added Json Patch Action Kamelet
     new 48643ee  Added Json Patch Action Kamelet - Docs
     new 2c2621f  Added Json Patch Action Kamelet - Templates

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


[camel-kamelets] 04/05: Added Json Patch Action Kamelet - Docs

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

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

commit 48643ee3b52432987fabf188958f202fd78ff6e6
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Dec 21 13:19:18 2021 +0100

    Added Json Patch Action Kamelet - Docs
---
 .../assets/images/kamelets/json-patch-action.svg   |  59 ++++++++
 docs/modules/ROOT/pages/json-patch-action.adoc     | 162 +++++++++++++++++++++
 2 files changed, 221 insertions(+)

diff --git a/docs/modules/ROOT/assets/images/kamelets/json-patch-action.svg b/docs/modules/ROOT/assets/images/kamelets/json-patch-action.svg
new file mode 100644
index 0000000..fa06352
--- /dev/null
+++ b/docs/modules/ROOT/assets/images/kamelets/json-patch-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/json-patch-action.adoc b/docs/modules/ROOT/pages/json-patch-action.adoc
new file mode 100644
index 0000000..5a14c67
--- /dev/null
+++ b/docs/modules/ROOT/pages/json-patch-action.adoc
@@ -0,0 +1,162 @@
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
+
+= image:kamelets/json-patch-action.svg[] Json Patch Action
+
+*Provided by: "Apache Software Foundation"*
+
+*Support Level for this Kamelet is: "Preview"*
+
+Apply a Json Patch Transformation.
+
+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 `json-patch-action` Kamelet:
+[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
+|===
+| Property| Name| Description| Type| Default| Example
+| *template {empty}* *| Template| The json patch transformation| binary| | 
+|===
+
+NOTE: Fields marked with an asterisk ({empty}*) are mandatory.
+
+
+== Dependencies
+
+At runtime, the `json-patch-action` Kamelet relies upon the presence of the following dependencies:
+
+- camel:json-patch
+- camel:kamelet 
+
+== Usage
+
+This section describes how you can use the `json-patch-action`.
+
+=== Knative Action
+
+You can use the `json-patch-action` Kamelet as an intermediate step in a Knative binding.
+
+.json-patch-action-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: json-patch-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: json-patch-action
+    properties:
+      template: "The Template"
+  sink:
+    ref:
+      kind: Channel
+      apiVersion: messaging.knative.dev/v1
+      name: mychannel
+
+----
+
+==== *Prerequisite*
+
+You have xref:{camel-k-version}@camel-k::installation/installation.adoc[Camel K installed] on the cluster.
+
+==== *Procedure for using the cluster CLI*
+
+. Save the `json-patch-action-binding.yaml` file to your local drive, and then edit it as needed for your configuration.
+
+. Run the action by using the following command:
++
+[source,shell]
+----
+kubectl apply -f json-patch-action-binding.yaml
+----
+
+==== *Procedure for using the Kamel CLI*
+
+Configure and run the action by using the following command:
+
+[source,shell]
+----
+kamel bind timer-source?message=Hello --step json-patch-action -p "step-0.template=The Template" channel:mychannel
+----
+
+This command creates the KameletBinding in the current namespace on the cluster.
+
+=== Kafka Action
+
+You can use the `json-patch-action` Kamelet as an intermediate step in a Kafka binding.
+
+.json-patch-action-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: json-patch-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: json-patch-action
+    properties:
+      template: "The Template"
+  sink:
+    ref:
+      kind: KafkaTopic
+      apiVersion: kafka.strimzi.io/v1beta1
+      name: my-topic
+
+----
+
+==== *Prerequisites*
+
+* You've installed https://strimzi.io/[Strimzi].
+* You've created a topic named `my-topic` in the current namespace.
+* You have xref:{camel-k-version}@camel-k::installation/installation.adoc[Camel K installed] on the cluster.
+
+==== *Procedure for using the cluster CLI*
+
+. Save the `json-patch-action-binding.yaml` file to your local drive, and then edit it as needed for your configuration.
+
+. Run the action by using the following command:
++
+[source,shell]
+----
+kubectl apply -f json-patch-action-binding.yaml
+----
+
+==== *Procedure for using the Kamel CLI*
+
+Configure and run the action by using the following command:
+
+[source,shell]
+----
+kamel bind timer-source?message=Hello --step json-patch-action -p "step-0.template=The Template" kafka.strimzi.io/v1beta1:KafkaTopic:my-topic
+----
+
+This command creates the KameletBinding in the current namespace on the cluster.
+
+== Kamelet source file
+
+https://github.com/apache/camel-kamelets/blob/main/kamelets/json-patch-action.kamelet.yaml
+
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT

[camel-kamelets] 03/05: Added Json Patch 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 json-patch-action
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 4fdabd784b1079784aa84d12d7f46b4765fee940
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Dec 21 13:19:07 2021 +0100

    Added Json Patch Action Kamelet
---
 docs/modules/ROOT/nav.adoc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 52a4809..d9766e5 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -81,6 +81,7 @@
 * xref:ROOT:jms-apache-artemis-source.adoc[image:kamelets/jms-apache-artemis-source.svg[] JMS - Apache Artemis Kamelet Source]
 * xref:ROOT:jolt-transformation-action.adoc[image:kamelets/jolt-transformation-action.svg[] Jolt Transformation Action]
 * xref:ROOT:json-deserialize-action.adoc[image:kamelets/json-deserialize-action.svg[] Json Deserialize Action]
+* xref:ROOT:json-patch-action.adoc[image:kamelets/json-patch-action.svg[] Json Patch Action]
 * xref:ROOT:json-schema-validator-action.adoc[image:kamelets/json-schema-validator-action.svg[] Json Schema Validator Action]
 * xref:ROOT:json-serialize-action.adoc[image:kamelets/json-serialize-action.svg[] Json Serialize Action]
 * xref:ROOT:jsonata-action.adoc[image:kamelets/jsonata-action.svg[] Jsonata Action]

[camel-kamelets] 01/05: Added Json Patch 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 json-patch-action
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 236d260dddb015f147751ff583028683d4694973
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Dec 21 13:17:49 2021 +0100

    Added Json Patch Action Kamelet
---
 kamelets/json-patch-action.kamelet.yaml | 54 +++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/kamelets/json-patch-action.kamelet.yaml b/kamelets/json-patch-action.kamelet.yaml
new file mode 100644
index 0000000..bc11a3d
--- /dev/null
+++ b/kamelets/json-patch-action.kamelet.yaml
@@ -0,0 +1,54 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: json-patch-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: "Json Patch Action"
+    description: |-
+      Apply a Json Patch Transformation.
+
+      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 json patch transformation
+        type: binary
+  dependencies:
+  - "camel:json-patch"
+  - "camel:kamelet"
+  flow:
+    from:
+      uri: "kamelet:source"
+      steps:
+      - to:
+          uri: "json-patch:"
+          parameters:
+            resourceUri: "base64:{{template}}"

[camel-kamelets] 05/05: Added Json Patch Action Kamelet - Templates

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

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

commit 2c2621fb61dd2039f02554ca3dbd649bfd6f9afa
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Dec 21 13:19:34 2021 +0100

    Added Json Patch Action Kamelet - Templates
---
 .../camel-k/json-patch-action-binding.yaml         | 24 ++++++++++++++++++++++
 .../bindings/core/json-patch-action-binding.yaml   | 13 ++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/templates/bindings/camel-k/json-patch-action-binding.yaml b/templates/bindings/camel-k/json-patch-action-binding.yaml
new file mode 100644
index 0000000..623fd70
--- /dev/null
+++ b/templates/bindings/camel-k/json-patch-action-binding.yaml
@@ -0,0 +1,24 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: json-patch-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: json-patch-action
+    properties:
+      template: "The Template"
+  sink:
+    ref:
+      kind: KafkaTopic
+      apiVersion: kafka.strimzi.io/v1beta1
+      name: my-topic
diff --git a/templates/bindings/core/json-patch-action-binding.yaml b/templates/bindings/core/json-patch-action-binding.yaml
new file mode 100644
index 0000000..c35101a
--- /dev/null
+++ b/templates/bindings/core/json-patch-action-binding.yaml
@@ -0,0 +1,13 @@
+- route:
+    from:
+      uri: "kamelet:timer-source"
+      parameters:
+        period: 1000
+        message: "{ \"foo\": \"John\"}"
+    steps:
+      - to:
+          uri: "kamelet:json-patch-action"
+          parameters:
+            template: "The Template"
+      - to:
+          uri: "log:info"

[camel-kamelets] 02/05: Added Json Patch 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 json-patch-action
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 3a1bccc99f7c3f10c31efa0ef3afd98b4d549449
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Dec 21 13:18:27 2021 +0100

    Added Json Patch Action Kamelet
---
 .../kamelets/json-patch-action.kamelet.yaml        | 54 ++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/library/camel-kamelets/src/main/resources/kamelets/json-patch-action.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/json-patch-action.kamelet.yaml
new file mode 100644
index 0000000..bc11a3d
--- /dev/null
+++ b/library/camel-kamelets/src/main/resources/kamelets/json-patch-action.kamelet.yaml
@@ -0,0 +1,54 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: json-patch-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: "Json Patch Action"
+    description: |-
+      Apply a Json Patch Transformation.
+
+      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 json patch transformation
+        type: binary
+  dependencies:
+  - "camel:json-patch"
+  - "camel:kamelet"
+  flow:
+    from:
+      uri: "kamelet:source"
+      steps:
+      - to:
+          uri: "json-patch:"
+          parameters:
+            resourceUri: "base64:{{template}}"