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/10 13:51:13 UTC

[camel-kamelets] 04/05: Added AWS Redshift SQL Sink Kamelet - Docs

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

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

commit 332f1eec772d2b3b7ffa6856137ab6a6d359f82b
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Dec 10 14:49:32 2021 +0100

    Added AWS Redshift SQL Sink Kamelet - Docs
---
 .../assets/images/kamelets/aws-redshift-sink.svg   |   1 +
 docs/modules/ROOT/pages/aws-redshift-sink.adoc     | 170 +++++++++++++++++++++
 2 files changed, 171 insertions(+)

diff --git a/docs/modules/ROOT/assets/images/kamelets/aws-redshift-sink.svg b/docs/modules/ROOT/assets/images/kamelets/aws-redshift-sink.svg
new file mode 100644
index 0000000..44542ec
--- /dev/null
+++ b/docs/modules/ROOT/assets/images/kamelets/aws-redshift-sink.svg
@@ -0,0 +1 @@
+<svg enable-background="new 0 0 1615 1783.7" viewBox="0 0 1615 1783.7" xmlns="http://www.w3.org/2000/svg"><path d="m807.5 1363.8 678.3 161.5v-1270.5l-678.3 161.5z" fill="#205b97"/><path d="m1485.8 254.8 129.2 64.6v1141.3l-129.2 64.6zm-678.3 1109-678.3 161.5v-1270.5l678.3 161.5z" fill="#5193ce"/><path d="m129.2 254.8-129.2 64.6v1141.3l129.2 64.6z" fill="#205b97"/><path d="m979.8 1783.7 258.4-129.2v-1525.3l-258.4-129.2-79 847z" fill="#5193ce"/><path d="m635.2 1783.7-258.4-129.2v-1525.3l258 [...]
\ No newline at end of file
diff --git a/docs/modules/ROOT/pages/aws-redshift-sink.adoc b/docs/modules/ROOT/pages/aws-redshift-sink.adoc
new file mode 100644
index 0000000..aebecf0
--- /dev/null
+++ b/docs/modules/ROOT/pages/aws-redshift-sink.adoc
@@ -0,0 +1,170 @@
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
+
+= image:kamelets/aws-redshift-sink.svg[] AWS Redshift Sink
+
+*Provided by: "Apache Software Foundation"*
+
+*Support Level for this Kamelet is: "Preview"*
+
+Send data to an AWS Redshift Database.
+
+This Kamelet expects a JSON as body. The mapping between the JSON fields and parameters is done by key, so if you have the following query:
+
+'INSERT INTO accounts (username,city) VALUES (:#username,:#city)'
+
+The Kamelet needs to receive as input something like:
+
+'{ "username":"oscerd", "city":"Rome"}'
+
+== Configuration Options
+
+The following table summarizes the configuration options available for the `aws-redshift-sink` Kamelet:
+[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
+|===
+| Property| Name| Description| Type| Default| Example
+| *databaseName {empty}* *| Database Name| The Database Name we are pointing| string| | 
+| *password {empty}* *| Password| The password to use for accessing a secured AWS Redshift Database| string| | 
+| *query {empty}* *| Query| The Query to execute against the AWS Redshift Database| string| | `"INSERT INTO accounts (username,city) VALUES (:#username,:#city)"`
+| *serverName {empty}* *| Server Name| Server Name for the data source| string| | `"localhost"`
+| *username {empty}* *| Username| The username to use for accessing a secured AWS Redshift Database| string| | 
+| serverPort| Server Port| Server Port for the data source| string| `5439`| 
+|===
+
+NOTE: Fields marked with an asterisk ({empty}*) are mandatory.
+
+
+== Dependencies
+
+At runtime, the `aws-redshift-sink` Kamelet relies upon the presence of the following dependencies:
+
+- camel:jackson
+- camel:kamelet
+- camel:sql
+- mvn:com.amazon.redshift:redshift-jdbc42:2.1.0.3
+- mvn:org.apache.commons:commons-dbcp2:2.8.0 
+
+== Usage
+
+This section describes how you can use the `aws-redshift-sink`.
+
+=== Knative Sink
+
+You can use the `aws-redshift-sink` Kamelet as a Knative sink by binding it to a Knative object.
+
+.aws-redshift-sink-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: aws-redshift-sink-binding
+spec:
+  source:
+    ref:
+      kind: Channel
+      apiVersion: messaging.knative.dev/v1
+      name: mychannel
+  sink:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: aws-redshift-sink
+    properties:
+      databaseName: "The Database Name"
+      password: "The Password"
+      query: "INSERT INTO accounts (username,city) VALUES (:#username,:#city)"
+      serverName: "localhost"
+      username: "The Username"
+  
+----
+
+==== *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 `aws-redshift-sink-binding.yaml` file to your local drive, and then edit it as needed for your configuration.
+
+. Run the sink by using the following command:
++
+[source,shell]
+----
+kubectl apply -f aws-redshift-sink-binding.yaml
+----
+
+==== *Procedure for using the Kamel CLI*
+
+Configure and run the sink by using the following command:
+
+[source,shell]
+----
+kamel bind channel:mychannel aws-redshift-sink -p "sink.databaseName=The Database Name" -p "sink.password=The Password" -p "sink.query=INSERT INTO accounts (username,city) VALUES (:#username,:#city)" -p "sink.serverName=localhost" -p "sink.username=The Username"
+----
+
+This command creates the KameletBinding in the current namespace on the cluster.
+
+=== Kafka Sink
+
+You can use the `aws-redshift-sink` Kamelet as a Kafka sink by binding it to a Kafka topic.
+
+.aws-redshift-sink-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: aws-redshift-sink-binding
+spec:
+  source:
+    ref:
+      kind: KafkaTopic
+      apiVersion: kafka.strimzi.io/v1beta1
+      name: my-topic
+  sink:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: aws-redshift-sink
+    properties:
+      databaseName: "The Database Name"
+      password: "The Password"
+      query: "INSERT INTO accounts (username,city) VALUES (:#username,:#city)"
+      serverName: "localhost"
+      username: "The Username"
+  
+----
+
+==== *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 `aws-redshift-sink-binding.yaml` file to your local drive, and then edit it as needed for your configuration.
+
+. Run the sink by using the following command:
++
+[source,shell]
+----
+kubectl apply -f aws-redshift-sink-binding.yaml
+----
+
+==== *Procedure for using the Kamel CLI*
+
+Configure and run the sink by using the following command:
+
+[source,shell]
+----
+kamel bind kafka.strimzi.io/v1beta1:KafkaTopic:my-topic aws-redshift-sink -p "sink.databaseName=The Database Name" -p "sink.password=The Password" -p "sink.query=INSERT INTO accounts (username,city) VALUES (:#username,:#city)" -p "sink.serverName=localhost" -p "sink.username=The Username"
+----
+
+This command creates the KameletBinding in the current namespace on the cluster.
+
+== Kamelet source file
+
+https://github.com/apache/camel-kamelets/blob/main/kamelets/aws-redshift-sink.kamelet.yaml
+
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT