You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2021/04/29 09:19:13 UTC

[camel-kamelets] branch main updated (6a3d31c -> b5d31fd)

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

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


    from 6a3d31c  Camel-Kamelets-Catalog: Aligned tests to labels constants
     new 52e5d44  Adding INSERT/INDEX ElasticSearch Kamelet
     new fb3d366  Adding JSON as input media type
     new b5d31fd  Fixing validations

The 3 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:
 ...rch-source.svg => elasticsearch-index-sink.svg} |  0
 ...h-source.adoc => elasticsearch-index-sink.adoc} | 45 ++++++++++------------
 ...t.yaml => elasticsearch-index-sink.kamelet.yaml | 35 +++++------------
 3 files changed, 30 insertions(+), 50 deletions(-)
 copy docs/modules/ROOT/assets/images/kamelets/{elasticsearch-search-source.svg => elasticsearch-index-sink.svg} (100%)
 copy docs/modules/ROOT/pages/{elasticsearch-search-source.adoc => elasticsearch-index-sink.adoc} (54%)
 copy camel-kamelets-catalog/src/main/resources/kamelets/elasticsearch-search-source.kamelet.yaml => elasticsearch-index-sink.kamelet.yaml (92%)
 mode change 100644 => 100755

[camel-kamelets] 02/03: Adding JSON as input media type

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

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

commit fb3d366f7272ddbfbdc05a464f268961a1cfe8aa
Author: Maria Arias de Reyna <ar...@redhat.com>
AuthorDate: Thu Apr 29 11:03:31 2021 +0200

    Adding JSON as input media type
---
 elasticsearch-index-sink.kamelet.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/elasticsearch-index-sink.kamelet.yaml b/elasticsearch-index-sink.kamelet.yaml
index 2307971..006f1e0 100755
--- a/elasticsearch-index-sink.kamelet.yaml
+++ b/elasticsearch-index-sink.kamelet.yaml
@@ -59,6 +59,8 @@ spec:
   types:
     out:
       mediaType: application/json
+    in:
+      mediaType: application/json
   flow:
     from:
       uri: kamelet:source

[camel-kamelets] 01/03: Adding INSERT/INDEX ElasticSearch Kamelet

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

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

commit 52e5d44d90faab7a60d4ce44771af7c98c65f1b7
Author: Maria Arias de Reyna <ar...@redhat.com>
AuthorDate: Mon Apr 26 14:34:37 2021 +0200

    Adding INSERT/INDEX ElasticSearch Kamelet
---
 .../images/kamelets/elasticsearch-index-sink.svg   | 25 +++++++
 .../ROOT/pages/elasticsearch-index-sink.adoc       | 67 +++++++++++++++++++
 elasticsearch-index-sink.kamelet.yaml              | 76 ++++++++++++++++++++++
 3 files changed, 168 insertions(+)

diff --git a/docs/modules/ROOT/assets/images/kamelets/elasticsearch-index-sink.svg b/docs/modules/ROOT/assets/images/kamelets/elasticsearch-index-sink.svg
new file mode 100644
index 0000000..af0264a
--- /dev/null
+++ b/docs/modules/ROOT/assets/images/kamelets/elasticsearch-index-sink.svg
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg enable-background="new 0 0 550 250" viewBox="77,83,410,90" xmlns="http://www.w3.org/2000/svg">
+ <path d="m178 102.5h313v41h-313z" fill="none"/>
+ <g enable-background="new">
+  <path d="m193.3 139.4c-4 0-7.2-1.2-9.5-3.5s-3.4-5.6-3.4-9.7c0-4.2 1.1-7.6 3.2-10s5-3.6 8.7-3.6c3.4 0 6.1 1 8.1 3.1s3 4.9 3 8.6v3h-17.3c.1 2.5.8 4.4 2 5.8s3.1 2 5.4 2c1.5 0 3-.1 4.3-.4s2.7-.8 4.3-1.4v4.5c-1.3.6-2.7 1.1-4.1 1.4s-3 .2-4.7.2zm-1.1-22.6c-1.8 0-3.2.6-4.2 1.7s-1.7 2.7-1.9 4.9h11.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="m476.3 139h-5.5v-16c0-2-.4-3.5-1.2-4.5s-2.1-1.5-3.8-1.5c-2.3 0-4 .7-5.1 2.1s-1.6 3.7-1.6 6.9v13h-5.5v-36.5h5.5v9.3c0 1.5-.1 3.1-.3 4.8h.4c.8-1.2 1.8-2.2 3.1-2.9s2.9-1 4.7-1c6.3 0 9.4 3.2 9.4 9.5v16.8z"/>
+ </g>
+ <path d="m141.8 115.5h-20.9c.1.5.3 1 .4 1.4.7 2.4 1.1 4.9 1.3 7.5.1 1 .1 2.1.1 3.1s0 2.1-.1 3.1c-.2 2.6-.6 5.1-1.3 7.5-.1.5-.3 1-.4 1.4h20.9c6.6 0 11.9-5.4 11.9-12s-5.3-12-11.9-12z" fill="#00a9e5"/>
+ <path d="m122.6 130.6c.1-1 .1-2.1.1-3.1s0-2.1-.1-3.1c-.2-2.6-.6-5.1-1.3-7.5-.1-.5-.3-1-.4-1.4h-32.3c-1.2 3.8-1.8 7.8-1.8 12s.6 8.2 1.8 12h32.3c.1-.5.3-1 .4-1.4.7-2.4 1.1-4.9 1.3-7.5z" fill="#353535"/>
+ <path d="m145.4 143.5h-26c-.8 1.8-1.7 3.5-2.7 5.1-1.5 2.5-3.3 4.7-5.3 6.8-.7.7-1.4 1.3-2.1 2-1.4 1.3-3 2.4-4.6 3.5 6.3 4.2 13.9 6.6 22 6.6 13.9 0 26.1-7.1 33.3-17.8-3.7-3.8-8.9-6.2-14.6-6.2z" fill="#00bfb3"/>
+ <path d="m116.7 148.6c1-1.6 1.9-3.3 2.7-5.1h-29.3c3.1 7.1 8.2 13.2 14.7 17.4 1.6-1.1 3.1-2.2 4.6-3.5.7-.6 1.4-1.3 2.1-2 1.9-2 3.7-4.3 5.2-6.8z" fill="#019b8f"/>
+ <path d="m111.4 99.6c-.7-.7-1.4-1.3-2.1-2-1.4-1.3-3-2.4-4.6-3.5-6.4 4.2-11.5 10.3-14.7 17.4h29.3c-.8-1.8-1.7-3.5-2.7-5.1-1.4-2.5-3.2-4.8-5.2-6.8z" fill="#f9b110"/>
+ <path d="m126.7 87.5c-8.1 0-15.7 2.4-22 6.6 1.6 1.1 3.1 2.2 4.6 3.5.7.6 1.4 1.3 2.1 2 2 2.1 3.8 4.3 5.3 6.8 1 1.6 1.9 3.3 2.7 5.1h26c5.7 0 10.9-2.4 14.6-6.2-7.2-10.7-19.4-17.8-33.3-17.8z" fill="#fed10a"/>
+</svg>
\ No newline at end of file
diff --git a/docs/modules/ROOT/pages/elasticsearch-index-sink.adoc b/docs/modules/ROOT/pages/elasticsearch-index-sink.adoc
new file mode 100644
index 0000000..b6ed91b
--- /dev/null
+++ b/docs/modules/ROOT/pages/elasticsearch-index-sink.adoc
@@ -0,0 +1,67 @@
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
+= image:kamelets/elasticsearch-index-sink.svg[] ElasticSearch Index Sink
+
+*Provided by: "Apache Software Foundation"*
+
+Insert data into ElasticSearch. Input data must have JSON format.
+
+== Configuration Options
+
+The following table summarizes the configuration options available for the `elasticsearch-index-sink` Kamelet:
+[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
+|===
+| Property| Name| Description| Type| Default| Example
+| *clusterName {empty}* *| ElasticSearch cluster name| Name of the cluster.| string| | 
+| *hostAddresses {empty}* *| Host addresses| Comma separated list with ip:port formatted remote transport addresses to use.| string| | 
+| *indexName {empty}* *| Index in ElasticSearch| The name of the index to act against.| string| | 
+| enableSSL| Enable SSL| Do we want to connect using SSL?| boolean| `true`| 
+| password| Password| Password to connect to ElasticSearch.| string| | 
+| user| Username| Username to connect to ElasticSearch.| string| | 
+|===
+
+NOTE: Fields marked with ({empty}*) are mandatory.
+
+== Usage
+
+This section summarizes how the `elasticsearch-index-sink` can be used in various contexts.
+
+=== Knative Sink
+
+The `elasticsearch-index-sink` Kamelet can be used as Knative sink by binding it to a Knative object.
+
+.elasticsearch-index-sink-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: elasticsearch-index-sink-binding
+spec:
+  source:
+    ref:
+      kind: InMemoryChannel
+      apiVersion: messaging.knative.dev/v1
+      name: mychannel
+  sink:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: elasticsearch-index-sink
+    properties:
+      clusterName: "The ElasticSearch cluster name"
+      hostAddresses: "The Host addresses"
+      indexName: "The Index in ElasticSearch"
+
+----
+
+Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to.
+
+Save the `elasticsearch-index-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 elasticsearch-index-sink-binding.yaml
+----
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
diff --git a/elasticsearch-index-sink.kamelet.yaml b/elasticsearch-index-sink.kamelet.yaml
new file mode 100755
index 0000000..2307971
--- /dev/null
+++ b/elasticsearch-index-sink.kamelet.yaml
@@ -0,0 +1,76 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: elasticsearch-index-sink
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+  annotations:
+    camel.apache.org/kamelet.group: "ElasticSearch"
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1NTAgMjUwIiB2aWV3Qm94PSI3Nyw4Myw0MTAsOTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiA8cGF0aCBkPSJtMTc4IDEwMi41aDMxM3Y0MWgtMzEzeiIgZmlsbD0ibm9uZSIvPgogPGcgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyI+CiAgPHBhdGggZD0ibTE5My4zIDEzOS40Yy00IDAtNy4yLTEuMi05LjUtMy41cy0zLjQtNS42LTMuNC05LjdjMC00LjIgMS4xLTcuNiAzLjItMTBzNS0zLjYgOC43LTMuNmMzLjQgMCA2Lj [...]
+spec:
+  sources:
+    - content: |-
+        public class ESWorkaround extends org.apache.camel.builder.RouteBuilder {
+          @Override
+          public void configure() throws Exception {
+            getContext().setAutowiredEnabled(false);
+          }
+        }
+      name: ESWorkaround.java
+  definition:
+    title: "ElasticSearch Index Sink"
+    description: |-
+      Insert data into ElasticSearch. Input data must have JSON format.
+    required:
+      - query
+      - clusterName
+      - indexName
+      - hostAddresses
+    properties:
+      user:
+        title: Username
+        description: Username to connect to ElasticSearch.
+        type: string
+      password:
+        title: Password
+        description: Password to connect to ElasticSearch.
+        type: string
+      enableSSL:
+        title: Enable SSL
+        description: Do we want to connect using SSL?
+        type: boolean
+        default: true
+      hostAddresses:
+        title: Host addresses
+        description: Comma separated list with ip:port formatted remote transport addresses to use.
+        type: string
+      indexName:
+        title: Index in ElasticSearch
+        description: The name of the index to act against.
+        type: string
+      clusterName:
+        title: ElasticSearch cluster name
+        description: Name of the cluster.
+        type: string
+  dependencies:
+    - "camel:elasticsearch-rest"
+    - "camel:gson"
+  types:
+    out:
+      mediaType: application/json
+  flow:
+    from:
+      uri: kamelet:source
+      steps:
+        - to:
+            uri: "kamelet-reify:elasticsearch-rest:{{clusterName}}"
+            parameters:
+              operation: "INDEX"
+              indexName: "{{indexName}}"
+              hostAddresses: "{{hostAddresses}}"
+              enableSSL: "{{enableSSL}}"
+              user: "{{user}}"
+              password: "{{password}}"
+        - marshal:
+            json: {}

[camel-kamelets] 03/03: Fixing validations

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

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

commit b5d31fd04981891e1a819bdbe39310e122923623
Author: Maria Arias de Reyna <ar...@redhat.com>
AuthorDate: Thu Apr 29 11:06:54 2021 +0200

    Fixing validations
---
 elasticsearch-index-sink.kamelet.yaml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/elasticsearch-index-sink.kamelet.yaml b/elasticsearch-index-sink.kamelet.yaml
index 006f1e0..e59c220 100755
--- a/elasticsearch-index-sink.kamelet.yaml
+++ b/elasticsearch-index-sink.kamelet.yaml
@@ -23,7 +23,6 @@ spec:
     description: |-
       Insert data into ElasticSearch. Input data must have JSON format.
     required:
-      - query
       - clusterName
       - indexName
       - hostAddresses
@@ -42,7 +41,7 @@ spec:
         type: boolean
         default: true
       hostAddresses:
-        title: Host addresses
+        title: Host Addresses
         description: Comma separated list with ip:port formatted remote transport addresses to use.
         type: string
       indexName:
@@ -50,7 +49,7 @@ spec:
         description: The name of the index to act against.
         type: string
       clusterName:
-        title: ElasticSearch cluster name
+        title: ElasticSearch Cluster Name
         description: Name of the cluster.
         type: string
   dependencies: