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/04/23 13:27:57 UTC

[camel-kamelets] branch cql-sink created (now efd5717)

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

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


      at efd5717  Added Cassandra Sink kamelet

This branch includes the following new commits:

     new 2f6c3db  Added Cassandra Sink kamelet
     new 0c456aa  Added Cassandra Sink kamelet
     new efd5717  Added Cassandra Sink kamelet

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.


[camel-kamelets] 03/03: Added Cassandra Sink kamelet

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

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

commit efd5717dd06eb6652c2d4c889aab5b2b1ac6d037
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 23 15:27:37 2021 +0200

    Added Cassandra Sink kamelet
---
 .../ROOT/assets/images/kamelets/cassandra-sink.svg | 47 ++++++++++++++
 docs/modules/ROOT/pages/cassandra-sink.adoc        | 72 ++++++++++++++++++++++
 2 files changed, 119 insertions(+)

diff --git a/docs/modules/ROOT/assets/images/kamelets/cassandra-sink.svg b/docs/modules/ROOT/assets/images/kamelets/cassandra-sink.svg
new file mode 100644
index 0000000..8cc29b7
--- /dev/null
+++ b/docs/modules/ROOT/assets/images/kamelets/cassandra-sink.svg
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
+<title>cassandra</title>
+<path d="M23.3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2-0.8
+	c-0.1,0-0.2-0.1-0.3-0.1l-1.4-0.1l0.8-0.2C12.8,15,12.5,14.8,12.2,14.5L12.2,14.5z M13.3,14.8c0.2,0.1,0.4,0.2,0.6,0.3l0.2,0
+	c0,0,0,0,0-0.1L13.3,14.8z M17.4,15.7l1.2,1.2L17,16.2l0.9,1.4l-1.4-1.1l0,0l0.5,1.7l-0.8-1.5l-0.1,1.8l-0.5-1.8l-0.6,1.7l0.2-1.8
+	l0,0L14,18.2l0.4-1.5c-0.5,0.4-0.8,1-1.1,1.6c0.1,0.1,0.3,0.3,0.4,0.4c2.2,0.6,4.6-0.3,5.8-2.3c-0.5-0.3-1.1-0.6-1.7-0.7L17.4,15.7z
+	 M14.2,16l-1.4,0.5c0,0,0,0,0,0.1c0,0.2-0.1,0.4-0.2,0.6c0.1,0.3,0.3,0.6,0.5,0.8c0.1-0.3,0.3-0.6,0.4-0.8L13,17.4L14.2,16z
+	 M19,19.7c-0.2,0.1-0.5,0.1-0.8,0.2C18.5,19.8,18.8,19.7,19,19.7z M17.6,20c-0.2,0-0.3,0.1-0.5,0.1c-0.3,0-0.5,0.1-0.8,0.1
+	C16.8,20.1,17.2,20.1,17.6,20L17.6,20z M15.8,20.2c-0.1,0-0.3,0-0.4,0C15.5,20.2,15.6,20.2,15.8,20.2z"/>
+</svg>
diff --git a/docs/modules/ROOT/pages/cassandra-sink.adoc b/docs/modules/ROOT/pages/cassandra-sink.adoc
new file mode 100644
index 0000000..78a3fc5
--- /dev/null
+++ b/docs/modules/ROOT/pages/cassandra-sink.adoc
@@ -0,0 +1,72 @@
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
+= image:kamelets/cassandra-sink.svg[] Cassandra Sink
+
+*Provided by: "Apache Software Foundation"*
+
+Send data to a Cassandra Cluster.
+
+This Kamelet expects the body as JSON Array. The content of the JSON Array will be used as input for the CQL Prepared Statement set in the query parameter.
+
+== Configuration Options
+
+The following table summarizes the configuration options available for the `cassandra-sink` Kamelet:
+[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
+|===
+| Property| Name| Description| Type| Default| Example
+| *host {empty}* *| Host| Hostname(s) cassandra server(s). Multiple hosts can be separated by comma.| string| | `"localhost"`
+| *keyspace {empty}* *| Keyspace| Keyspace to use| string| | `"customers"`
+| *password {empty}* *| Password| The password to use for accessing a secured Cassandra Cluster| string| | 
+| *port {empty}* *| Port| Port number of cassandra server(s)| string| | `9042`
+| *username {empty}* *| Username| The username to use for accessing a secured Cassandra Cluster| string| | 
+| consistencyLevel| Consistency Level| Consistency level to use. The value can be one of ANY, ONE, TWO, THREE, QUORUM, ALL, LOCAL_QUORUM, EACH_QUORUM, SERIAL, LOCAL_SERIAL, LOCAL_ONE| string| `"ANY"`| 
+| preparedStatement| The Prepared statement| The Prepared statement to execute against the Cassandra cluster table| string| | 
+|===
+
+NOTE: Fields marked with ({empty}*) are mandatory.
+
+== Usage
+
+This section summarizes how the `cassandra-sink` can be used in various contexts.
+
+=== Knative Source
+
+The `cassandra-sink` Kamelet can be used as Knative source by binding it to a Knative object.
+
+.cassandra-sink-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: cassandra-sink-binding
+spec:
+  source:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: cassandra-sink
+    properties:
+      host: "localhost"
+      keyspace: "customers"
+      password: "The Password"
+      port: 9042
+      username: "The Username"
+  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 `cassandra-sink-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 cassandra-sink-binding.yaml
+----
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT

[camel-kamelets] 02/03: Added Cassandra Sink kamelet

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

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

commit 0c456aa9b88a2c1fcdf26b60920d0048c23c5868
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 23 15:27:24 2021 +0200

    Added Cassandra Sink 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 b78d530..2ae5684 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -18,6 +18,7 @@
 * xref:ROOT:azure-storage-blob-source.adoc[image:kamelets/azure-storage-blob-source.svg[] Azure Storage Blob Source]
 * xref:ROOT:azure-storage-queue-sink.adoc[image:kamelets/azure-storage-queue-sink.svg[] Azure Storage Queue Sink]
 * xref:ROOT:bitcoin-source.adoc[image:kamelets/bitcoin-source.svg[] Bitcoin Source]
+* xref:ROOT:cassandra-sink.adoc[image:kamelets/cassandra-sink.svg[] Cassandra Sink]
 * xref:ROOT:cassandra-source.adoc[image:kamelets/cassandra-source.svg[] Cassandra Source]
 * xref:ROOT:cron-source.adoc[image:kamelets/cron-source.svg[] Cron Source]
 * xref:ROOT:dropbox-sink.adoc[image:kamelets/dropbox-sink.svg[] Dropbox Sink]

[camel-kamelets] 01/03: Added Cassandra Sink kamelet

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

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

commit 2f6c3db802af5e37bd3b69d31e1acf51e08f17a9
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 23 15:26:59 2021 +0200

    Added Cassandra Sink kamelet
---
 cassandra-sink.kamelet.yaml | 75 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)

diff --git a/cassandra-sink.kamelet.yaml b/cassandra-sink.kamelet.yaml
new file mode 100644
index 0000000..e5d534f
--- /dev/null
+++ b/cassandra-sink.kamelet.yaml
@@ -0,0 +1,75 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: cassandra-sink
+  annotations:
+    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIyLjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMiAzMiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMzIgMzI7Ii [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+  labels:
+    camel.apache.org/kamelet.type: "source"
+spec:
+  definition:
+    title: "Cassandra Sink"
+    description: |-
+      Send data to a Cassandra Cluster.
+
+      This Kamelet expects the body as JSON Array. The content of the JSON Array will be used as input for the CQL Prepared Statement set in the query parameter.
+    required:
+      - host
+      - port
+      - keyspace
+      - username
+      - password
+      - query
+    properties:
+      host:
+        title: Host
+        description: Hostname(s) cassandra server(s). Multiple hosts can be separated by comma.
+        type: string
+        example: localhost
+      port:
+        title: Port
+        description: Port number of cassandra server(s)
+        type: string
+        example: 9042
+      keyspace:
+        title: Keyspace 
+        description: Keyspace to use
+        type: string
+        example: customers
+      username:
+        title: Username
+        description: The username to use for accessing a secured Cassandra Cluster
+        type: string
+      password:
+        title: Password
+        description: The password to use for accessing a secured Cassandra Cluster
+        type: string
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+      consistencyLevel:
+        title: Consistency Level
+        description: Consistency level to use. The value can be one of ANY, ONE, TWO, THREE, QUORUM, ALL, LOCAL_QUORUM, EACH_QUORUM, SERIAL, LOCAL_SERIAL, LOCAL_ONE
+        type: string
+        default: ANY
+      preparedStatement:
+        title: The Prepared statement
+        description: The Prepared statement to execute against the Cassandra cluster table
+        type: string
+  dependencies:
+  - "camel:jackson"
+  flow:
+    from:
+      uri: "kamelet:source"
+      steps:
+      - unmarshal:
+          json: 
+            library: Jackson
+            useList: true
+      - to: 
+          uri: "cql://{{host}}:{{port}}/{{keyspace}}"
+          parameters:
+            username: "{{username}}"
+            password: "{{password}}"
+            preparedStatement: "{{preparedStatement}}"
+            consistencyLevel: "{{consistencyLevel}}"