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/06/11 16:37:39 UTC

[camel-kamelets] branch main updated (681e2d9 -> 442df47)

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 681e2d9  Added MySQL Sink Kamelet
     new 5eedc8d  Added PostgreSQL Sink Kamelet
     new 810185a  Added PostgreSQL Sink Kamelet
     new e7b526a  Added PostgreSQL Sink Kamelet
     new 442df47  Added PostgreSQL Sink 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:
 .../assets/images/kamelets/postgresql-sink.svg     |  1 +
 docs/modules/ROOT/nav.adoc                         |  1 +
 .../{mysql-sink.adoc => postgresql-sink.adoc}      | 39 ++++------
 .../kamelets/postgresql-sink.kamelet.yaml          | 83 ++++++++++++++++++++++
 postgresql-sink.kamelet.yaml                       | 83 ++++++++++++++++++++++
 5 files changed, 183 insertions(+), 24 deletions(-)
 create mode 100644 docs/modules/ROOT/assets/images/kamelets/postgresql-sink.svg
 copy docs/modules/ROOT/pages/{mysql-sink.adoc => postgresql-sink.adoc} (55%)
 create mode 100644 library/camel-kamelets-catalog/src/main/resources/kamelets/postgresql-sink.kamelet.yaml
 create mode 100644 postgresql-sink.kamelet.yaml

[camel-kamelets] 04/04: Added PostgreSQL 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 main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 442df47a03ca3b4f5aea08f2ef38f8d67bac05ef
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jun 11 18:28:17 2021 +0200

    Added PostgreSQL Sink Kamelet
---
 .../assets/images/kamelets/postgresql-sink.svg     |  1 +
 docs/modules/ROOT/pages/postgresql-sink.adoc       | 70 ++++++++++++++++++++++
 2 files changed, 71 insertions(+)

diff --git a/docs/modules/ROOT/assets/images/kamelets/postgresql-sink.svg b/docs/modules/ROOT/assets/images/kamelets/postgresql-sink.svg
new file mode 100644
index 0000000..b102a0e
--- /dev/null
+++ b/docs/modules/ROOT/assets/images/kamelets/postgresql-sink.svg
@@ -0,0 +1 @@
+<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>PostgreSQL icon</title><path d="M17.128 0a10.134 10.134 0 0 0-2.755.403l-.063.02A10.922 10.922 0 0 0 12.6.258C11.422.238 10.41.524 9.594 1 8.79.721 7.122.24 5.364.336 4.14.403 2.804.775 1.814 1.82.827 2.865.305 4.482.415 6.682c.03.607.203 1.597.49 2.879s.69 2.783 1.193 4.152c.503 1.37 1.054 2.6 1.915 3.436.43.419 1.022.771 1.72.742.49-.02.933-.235 1.315-.552.186.245.385.352.566.451.228.125.45.21.68.266.413.103  [...]
\ No newline at end of file
diff --git a/docs/modules/ROOT/pages/postgresql-sink.adoc b/docs/modules/ROOT/pages/postgresql-sink.adoc
new file mode 100644
index 0000000..510d46f
--- /dev/null
+++ b/docs/modules/ROOT/pages/postgresql-sink.adoc
@@ -0,0 +1,70 @@
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
+= image:kamelets/postgresql-sink.svg[] PostgreSQL Sink
+
+*Provided by: "Apache Software Foundation"*
+
+*Support Level for this Kamelet is: "Preview"*
+
+Send data to a PostgreSQL Database.
+
+== Configuration Options
+
+The following table summarizes the configuration options available for the `postgresql-sink` Kamelet:
+[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
+|===
+| Property| Name| Description| Type| Default| Example
+| *password {empty}* *| Password| The password to use for accessing a secured PostgreSQL Database| string| | 
+| *query {empty}* *| Query| The Query to execute against the PostgreSQL Database| string| | 
+| *serverName {empty}* *| Server Name| Server Name for the data source| string| | `"localhost"`
+| *username {empty}* *| Username| The username to use for accessing a secured PostgreSQL Database| string| | 
+| databaseName| Database Name| The Database Name we are pointing| string| `"postgres"`| 
+| port| Port| Server Port for the data source| string| `5432`| 
+|===
+
+NOTE: Fields marked with ({empty}*) are mandatory.
+
+== Usage
+
+This section summarizes how the `postgresql-sink` can be used in various contexts.
+
+=== Knative Sink
+
+The `postgresql-sink` Kamelet can be used as Knative sink by binding it to a Knative object.
+
+.postgresql-sink-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: postgresql-sink-binding
+spec:
+  source:
+    ref:
+      kind: InMemoryChannel
+      apiVersion: messaging.knative.dev/v1
+      name: mychannel
+  sink:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: postgresql-sink
+    properties:
+      password: "The Password"
+      query: "The Query"
+      serverName: "localhost"
+      username: "The Username"
+
+----
+
+Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to.
+
+Save the `postgresql-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 postgresql-sink-binding.yaml
+----
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT

[camel-kamelets] 02/04: Added PostgreSQL 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 main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 810185aa2a2d85220bf2bd70755e0b55e11d22a7
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jun 11 18:26:34 2021 +0200

    Added PostgreSQL Sink Kamelet
---
 .../kamelets/postgresql-sink.kamelet.yaml          | 83 ++++++++++++++++++++++
 1 file changed, 83 insertions(+)

diff --git a/library/camel-kamelets-catalog/src/main/resources/kamelets/postgresql-sink.kamelet.yaml b/library/camel-kamelets-catalog/src/main/resources/kamelets/postgresql-sink.kamelet.yaml
new file mode 100644
index 0000000..14f30c1
--- /dev/null
+++ b/library/camel-kamelets-catalog/src/main/resources/kamelets/postgresql-sink.kamelet.yaml
@@ -0,0 +1,83 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: postgresql-sink
+  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,PHN2ZyByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+UG9zdGdyZVNRTCBpY29uPC90aXRsZT48cGF0aCBkPSJNMTcuMTI4IDBhMTAuMTM0IDEwLjEzNCAwIDAgMC0yLjc1NS40MDNsLS4wNjMuMDJBMTAuOTIyIDEwLjkyMiAwIDAgMCAxMi42LjI1OEMxMS40MjIuMjM4IDEwLjQxLjUyNCA5LjU5NCAxIDguNzkuNzIxIDcuMTIyLjI0IDUuMzY0LjMzNiA0LjE0LjQwMyAyLjgwNC43NzUgMS44MTQgMS44Mi44MjcgMi44NjUuMzA1IDQuNDgyLjQxNSA2LjY4MmMuMDMuNjA3LjIwMyAxLjU5Ny [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "SQL"
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+spec:
+  definition:
+    title: "PostgreSQL Sink"
+    description: |-
+      Send data to a PostgreSQL Database.
+    required:
+      - serverName
+      - username
+      - password
+      - query
+    type: object
+    properties:
+      serverName:
+        title: Server Name
+        description: Server Name for the data source
+        type: string
+        example: localhost
+      port:
+        title: Port
+        description: Server Port for the data source
+        type: string
+        default: 5432
+      username:
+        title: Username
+        description: The username to use for accessing a secured PostgreSQL Database
+        type: string
+      password:
+        title: Password
+        description: The password to use for accessing a secured PostgreSQL Database
+        type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+      query:
+        title: Query
+        description: The Query to execute against the PostgreSQL Database
+        type: string
+      databaseName:
+        title: Database Name
+        description: The Database Name we are pointing
+        type: string
+        default: postgres
+  dependencies:
+  - "camel:jackson"
+  - "camel:kamelet"
+  - "camel:sql"
+  - "mvn:org.postgresql:postgresql:42.2.14"
+  - "mvn:org.apache.commons:commons-dbcp2:2.8.0"
+  flow:
+    beans:
+      - name: dsBean
+        type: "#class:org.apache.commons.dbcp2.BasicDataSource"
+        property:
+          - key: username
+            value: '{{username}}'
+          - key: password
+            value: '{{password}}'
+          - key: url
+            value: 'jdbc:postgresql://{{serverName}}:{{port}}/{{databaseName}}'
+          - key: driverClassName
+            value: 'org.postgresql.Driver'
+    from:
+      uri: "kamelet:source"
+      steps:
+      - unmarshal:
+          json: 
+            library: Jackson
+      - to: 
+          uri: "sql:{{query}}"
+          parameters:
+            dataSource: "#bean:{{dsBean}}"

[camel-kamelets] 03/04: Added PostgreSQL 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 main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit e7b526affc8cdc10f55da69508911fa3223835ae
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jun 11 18:28:04 2021 +0200

    Added PostgreSQL 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 f6544d4..68740ac 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -79,6 +79,7 @@
 * xref:ROOT:openai-classification-action.adoc[image:kamelets/openai-classification-action.svg[] OpenAI Classification Action]
 * xref:ROOT:openai-completion-action.adoc[image:kamelets/openai-completion-action.svg[] OpenAI Completion Action]
 * xref:ROOT:pdf-action.adoc[image:kamelets/pdf-action.svg[] PDF Action]
+* xref:ROOT:postgresql-sink.adoc[image:kamelets/postgresql-sink.svg[] PostgreSQL Sink]
 * xref:ROOT:predicate-filter-action.adoc[image:kamelets/predicate-filter-action.svg[] Predicate Filter Action]
 * xref:ROOT:protobuf-deserialize-action.adoc[image:kamelets/protobuf-deserialize-action.svg[] Protobuf Deserialize Action]
 * xref:ROOT:protobuf-serialize-action.adoc[image:kamelets/protobuf-serialize-action.svg[] Protobuf Serialize Action]

[camel-kamelets] 01/04: Added PostgreSQL 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 main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 5eedc8d78ac15c00a3f424ad621bfad9c032c719
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jun 11 18:25:05 2021 +0200

    Added PostgreSQL Sink Kamelet
---
 postgresql-sink.kamelet.yaml | 83 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)

diff --git a/postgresql-sink.kamelet.yaml b/postgresql-sink.kamelet.yaml
new file mode 100644
index 0000000..14f30c1
--- /dev/null
+++ b/postgresql-sink.kamelet.yaml
@@ -0,0 +1,83 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: postgresql-sink
+  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,PHN2ZyByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+UG9zdGdyZVNRTCBpY29uPC90aXRsZT48cGF0aCBkPSJNMTcuMTI4IDBhMTAuMTM0IDEwLjEzNCAwIDAgMC0yLjc1NS40MDNsLS4wNjMuMDJBMTAuOTIyIDEwLjkyMiAwIDAgMCAxMi42LjI1OEMxMS40MjIuMjM4IDEwLjQxLjUyNCA5LjU5NCAxIDguNzkuNzIxIDcuMTIyLjI0IDUuMzY0LjMzNiA0LjE0LjQwMyAyLjgwNC43NzUgMS44MTQgMS44Mi44MjcgMi44NjUuMzA1IDQuNDgyLjQxNSA2LjY4MmMuMDMuNjA3LjIwMyAxLjU5Ny [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "SQL"
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+spec:
+  definition:
+    title: "PostgreSQL Sink"
+    description: |-
+      Send data to a PostgreSQL Database.
+    required:
+      - serverName
+      - username
+      - password
+      - query
+    type: object
+    properties:
+      serverName:
+        title: Server Name
+        description: Server Name for the data source
+        type: string
+        example: localhost
+      port:
+        title: Port
+        description: Server Port for the data source
+        type: string
+        default: 5432
+      username:
+        title: Username
+        description: The username to use for accessing a secured PostgreSQL Database
+        type: string
+      password:
+        title: Password
+        description: The password to use for accessing a secured PostgreSQL Database
+        type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+      query:
+        title: Query
+        description: The Query to execute against the PostgreSQL Database
+        type: string
+      databaseName:
+        title: Database Name
+        description: The Database Name we are pointing
+        type: string
+        default: postgres
+  dependencies:
+  - "camel:jackson"
+  - "camel:kamelet"
+  - "camel:sql"
+  - "mvn:org.postgresql:postgresql:42.2.14"
+  - "mvn:org.apache.commons:commons-dbcp2:2.8.0"
+  flow:
+    beans:
+      - name: dsBean
+        type: "#class:org.apache.commons.dbcp2.BasicDataSource"
+        property:
+          - key: username
+            value: '{{username}}'
+          - key: password
+            value: '{{password}}'
+          - key: url
+            value: 'jdbc:postgresql://{{serverName}}:{{port}}/{{databaseName}}'
+          - key: driverClassName
+            value: 'org.postgresql.Driver'
+    from:
+      uri: "kamelet:source"
+      steps:
+      - unmarshal:
+          json: 
+            library: Jackson
+      - to: 
+          uri: "sql:{{query}}"
+          parameters:
+            dataSource: "#bean:{{dsBean}}"