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/03/11 15:47:59 UTC

[camel-kamelets] branch master updated (97407ea -> 524e51a)

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

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


    from 97407ea  Google Mail Stream source kamelet: Set mark as read as true by default
     new f6e1364  Added Google Sheets Stream Source Kamelet
     new 524e51a  Added Google Sheets Stream Source Kamelet

The 2 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:
 ...-source.svg => google-sheets-stream-source.svg} |  0
 docs/modules/ROOT/nav.adoc                         |  1 +
 .../ROOT/pages/google-mail-stream-source.adoc      |  2 +-
 .../ROOT/pages/google-sheets-stream-source.adoc    | 74 ++++++++++++++++++++++
 ...melet.yaml => google-sheets-source.kamelet.yaml | 48 +++++++-------
 5 files changed, 100 insertions(+), 25 deletions(-)
 copy docs/modules/ROOT/assets/images/kamelets/{google-calendar-stream-source.svg => google-sheets-stream-source.svg} (100%)
 create mode 100644 docs/modules/ROOT/pages/google-sheets-stream-source.adoc
 copy google-calendar-stream-source.kamelet.yaml => google-sheets-source.kamelet.yaml (73%)


[camel-kamelets] 01/02: Added Google Sheets Stream Source Kamelet

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

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

commit f6e1364a446692c607b46530516d877b87661985
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Mar 11 16:22:51 2021 +0100

    Added Google Sheets Stream Source Kamelet
---
 google-sheets-source.kamelet.yaml | 94 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 94 insertions(+)

diff --git a/google-sheets-source.kamelet.yaml b/google-sheets-source.kamelet.yaml
new file mode 100644
index 0000000..a324c1b
--- /dev/null
+++ b/google-sheets-source.kamelet.yaml
@@ -0,0 +1,94 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: google-sheets-stream-source
+  annotations:
+    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjE4NiAzOCA3NiA3NiI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTI0NCA1NmgtNDB2NDBoNDBWNTZ6Ii8+PHBhdGggZmlsbD0iI0VBNDMzNSIgZD0iTTI0NCAxMTRsMTgtMThoLTE4djE4eiIvPjxwYXRoIGZpbGw9IiNGQkJDMDQiIGQ9Ik0yNjIgNTZoLTE4djQwaDE4VjU2eiIvPjxwYXRoIGZpbGw9IiMzNEE4NTMiIGQ9Ik0yNDQgOTZoLTQwdjE4aDQwVjk2eiIvPjxwYXRoIGZpbGw9IiMxODgwMzgiIGQ9Ik0xODYgOTZ2MTJjMCAzLjMxNSAyLjY4NSA2IDYgNmgxMlY5NmgtMTh6Ii8+PH [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+  labels:
+    camel.apache.org/kamelet.type: "source"
+spec:
+  definition:
+    title: "Google Sheets Stream Source"
+    description: |-
+      Receive data from Google Sheets.
+    required:
+      - index
+      - spreadsheetId
+      - clientId
+      - accessToken
+      - refreshToken
+      - clientSecret
+      - applicationName
+    properties:
+      index:
+        title: Index
+        description: An index for the google sheets endpoint
+        type: string
+      spreadsheetId:
+        title: Spreadsheet ID
+        description: The Spreadsheet ID to be used as events source
+        type: string
+      clientId:
+        title: Client Id
+        description: Client ID of the sheets application
+        type: string
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+      clientSecret:
+        title: Client Secret
+        description: Client Secret of the sheets application
+        type: string
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+      accessToken:
+        title: Access Token
+        description: OAuth 2 access token for google sheets application. This typically expires after an hour so refreshToken is recommended for long term usage.
+        type: string
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+      refreshToken:
+        title: Refresh Token
+        description: OAuth 2 refresh token for google sheets application. Using this, the Google Calendar component can obtain a new accessToken whenever the current one expires - a necessity if the application is long-lived.
+        type: string
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+      applicationName:
+        title: Application name
+        description: Google Sheets application name
+        type: string
+      splitResults:
+        title: Split Results
+        description: True if value range result should be split into rows or columns to process each of them individually. 
+        type: boolean
+        x-descriptors:
+        - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+        default: true
+      range:
+        title: Consume from now
+        description: the range of rows and columns in a sheet to get data from.
+        type: boolean
+        x-descriptors:
+        - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+        example: "A1:B3"
+  types:
+    out:
+      mediaType: application/json
+  dependencies:
+  - "camel:jackson"
+  flow:
+    from:
+      uri: "google-sheets-stream://{{index}}"
+      parameters:
+        clientId: "{{clientId}}"
+        spreadsheetId: "{{spreadsheetId}}"
+        accessToken: "{{accessToken}}"
+        refreshToken: "{{refreshToken}}"
+        clientSecret: "{{clientSecret}}"
+        applicationName: "{{applicationName}}"
+        splitResults: "{{splitResults}}"
+        range: "{{range}}"
+      steps:
+      - marshal:
+          json: {}
+      - to: "kamelet:sink"


[camel-kamelets] 02/02: Added Google Sheets Stream Source Kamelet

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

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

commit 524e51a318773150cec6bc78c0aa7027a305777d
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Mar 11 16:23:33 2021 +0100

    Added Google Sheets Stream Source Kamelet
---
 .../kamelets/google-sheets-stream-source.svg       |  1 +
 docs/modules/ROOT/nav.adoc                         |  1 +
 .../ROOT/pages/google-mail-stream-source.adoc      |  2 +-
 .../ROOT/pages/google-sheets-stream-source.adoc    | 74 ++++++++++++++++++++++
 4 files changed, 77 insertions(+), 1 deletion(-)

diff --git a/docs/modules/ROOT/assets/images/kamelets/google-sheets-stream-source.svg b/docs/modules/ROOT/assets/images/kamelets/google-sheets-stream-source.svg
new file mode 100644
index 0000000..28f6a33
--- /dev/null
+++ b/docs/modules/ROOT/assets/images/kamelets/google-sheets-stream-source.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="186 38 76 76"><path fill="#fff" d="M244 56h-40v40h40V56z"/><path fill="#EA4335" d="M244 114l18-18h-18v18z"/><path fill="#FBBC04" d="M262 56h-18v40h18V56z"/><path fill="#34A853" d="M244 96h-40v18h40V96z"/><path fill="#188038" d="M186 96v12c0 3.315 2.685 6 6 6h12V96h-18z"/><path fill="#1967D2" d="M262 56V44c0-3.315-2.685-6-6-6h-12v18h18z"/><path fill="#4285F4" d="M244 38h-52c-3.315 0 -6 2.685-6 6v52h18V56h40V38z"/><path fill="#4285F4" d="M21 [...]
\ No newline at end of file
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 3f8b085..bec5223 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -7,6 +7,7 @@
 * xref:ROOT:ftps-source.adoc[image:kamelets/ftps-source.svg[] FTPS Source]
 * xref:ROOT:google-calendar-stream-source.adoc[image:kamelets/google-calendar-stream-source.svg[] Google Calendar Stream Source]
 * xref:ROOT:google-mail-stream-source.adoc[image:kamelets/google-mail-stream-source.svg[] Google Mail Stream Source]
+* xref:ROOT:google-sheets-stream-source.adoc[image:kamelets/google-sheets-stream-source.svg[] Google Sheets Stream Source]
 * xref:ROOT:http-source.adoc[image:kamelets/http-source.svg[] HTTP Source]
 * xref:ROOT:jira-source.adoc[image:kamelets/jira-source.svg[] Jira Source]
 * xref:ROOT:kafka-source.adoc[image:kamelets/kafka-source.svg[] Kafka Source]
diff --git a/docs/modules/ROOT/pages/google-mail-stream-source.adoc b/docs/modules/ROOT/pages/google-mail-stream-source.adoc
index 5d9a372..f214fd3 100644
--- a/docs/modules/ROOT/pages/google-mail-stream-source.adoc
+++ b/docs/modules/ROOT/pages/google-mail-stream-source.adoc
@@ -18,7 +18,7 @@ The following table summarizes the configuration options available for the `goog
 | *index {empty}* *| Index| An index for the google mail endpoint| string| | 
 | *refreshToken {empty}* *| Refresh Token| OAuth 2 refresh token for google mail application. Using this, the Google Calendar component can obtain a new accessToken whenever the current one expires - a necessity if the application is long-lived.| string| | 
 | labels| Gmail labels| Comma separated list of labels to take into account| string| | `"inbox"`
-| markAsRead| Mark as read| Mark the message as read once it has been consumed| boolean| `false`| 
+| markAsRead| Mark as read| Mark the message as read once it has been consumed| boolean| `true`| 
 | query| Gmail query| The query to execute on gmail box| string| `"is:unread"`| `"is:unread -category:(promotions OR social)"`
 |===
 
diff --git a/docs/modules/ROOT/pages/google-sheets-stream-source.adoc b/docs/modules/ROOT/pages/google-sheets-stream-source.adoc
new file mode 100644
index 0000000..337d0c9
--- /dev/null
+++ b/docs/modules/ROOT/pages/google-sheets-stream-source.adoc
@@ -0,0 +1,74 @@
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
+= image:kamelets/google-sheets-stream-source.svg[] Google Sheets Stream Source
+
+*Provided by: "Apache Software Foundation"*
+
+Receive data from Google Sheets.
+
+== Configuration Options
+
+The following table summarizes the configuration options available for the `google-sheets-stream-source` Kamelet:
+[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
+|===
+| Property| Name| Description| Type| Default| Example
+| *accessToken {empty}* *| Access Token| OAuth 2 access token for google sheets application. This typically expires after an hour so refreshToken is recommended for long term usage.| string| | 
+| *applicationName {empty}* *| Application name| Google Sheets application name| string| | 
+| *clientId {empty}* *| Client Id| Client ID of the sheets application| string| | 
+| *clientSecret {empty}* *| Client Secret| Client Secret of the sheets application| string| | 
+| *index {empty}* *| Index| An index for the google sheets endpoint| string| | 
+| *refreshToken {empty}* *| Refresh Token| OAuth 2 refresh token for google sheets application. Using this, the Google Calendar component can obtain a new accessToken whenever the current one expires - a necessity if the application is long-lived.| string| | 
+| *spreadsheetId {empty}* *| Spreadsheet ID| The Spreadsheet ID to be used as events source| string| | 
+| range| Consume from now| the range of rows and columns in a sheet to get data from.| boolean| | `"A1:B3"`
+| splitResults| Split Results| True if value range result should be split into rows or columns to process each of them individually.| boolean| `true`| 
+|===
+
+NOTE: Fields marked with ({empty}*) are mandatory.
+
+== Usage
+
+This section summarizes how the `google-sheets-stream-source` can be used in various contexts.
+
+=== Knative Source
+
+The `google-sheets-stream-source` Kamelet can be used as Knative source by binding it to a Knative object.
+
+.google-sheets-stream-source-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: google-sheets-stream-source-binding
+spec:
+  source:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: google-sheets-stream-source
+    properties:
+      accessToken: "The Access Token"
+      applicationName: "The Application name"
+      clientId: "The Client Id"
+      clientSecret: "The Client Secret"
+      index: "The Index"
+      refreshToken: "The Refresh Token"
+      spreadsheetId: "The Spreadsheet ID"
+  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 `google-sheets-stream-source-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 google-sheets-stream-source-binding.yaml
+----
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT