Google Sheets Source
Provided by: "Apache Software Foundation"
Support Level for this Kamelet is: "Preview"
Receive data from Google Sheets.
Configuration Options
The following table summarizes the configuration options available for the google-sheets-source
Kamelet:
Property | Name | Description | Type | Default | Example |
---|---|---|---|---|---|
Access Token |
Required OAuth 2 access token for google sheets application. This typically expires after an hour so refreshToken is recommended for long term usage. |
string |
|||
Application name |
Required Google Sheets application name. |
string |
|||
Client Id |
Required Client ID of the sheets application. |
string |
|||
Client Secret |
Required Client Secret of the sheets application. |
string |
|||
Index |
Required An index for the google sheets endpoint. |
string |
|||
Refresh Token |
Required 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 |
|||
Spreadsheet ID |
Required The Spreadsheet ID to be used as events source. |
string |
|||
Delay |
Milliseconds before the next poll. |
integer |
500 |
||
Consume from now |
the range of rows and columns in a sheet to get data from. |
boolean |
A1:B3 |
||
Repeat Count |
Specifies a maximum limit of number of fires. |
integer |
|||
Split Results |
True if value range result should be split into rows or columns to process each of them individually. |
boolean |
true |
Dependencies
At runtime, the google-sheets-source
Kamelet relies upon the presence of the following dependencies:
-
camel:jackson
-
camel:kamelet
-
camel:google-sheets
Usage
This section describes how you can use the google-sheets-source
.
Knative source
You can use the google-sheets-source
Kamelet as a Knative source by binding it to a Knative object.
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: google-sheets-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: google-sheets-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: Channel
apiVersion: messaging.knative.dev/v1
name: mychannel
Prerequisite
You have Camel K installed on the cluster.
Procedure for using the cluster CLI
-
Save the
google-sheets-source-binding.yaml
file to your local drive, and then edit it as needed for your configuration. -
Run the source by using the following command:
kubectl apply -f google-sheets-source-binding.yaml
Procedure for using the Kamel CLI
Configure and run the source by using the following command:
kamel bind google-sheets-source -p "source.accessToken=The Access Token" -p "source.applicationName=The Application name" -p "source.clientId=The Client Id" -p "source.clientSecret=The Client Secret" -p "source.index=The Index" -p "source.refreshToken=The Refresh Token" -p "source.spreadsheetId=The Spreadsheet ID" channel:mychannel
This command creates the KameletBinding in the current namespace on the cluster.
Kafka source
You can use the google-sheets-source
Kamelet as a Kafka source by binding it to a Kafka topic.
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: google-sheets-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: google-sheets-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: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic
Prerequisites
-
You’ve installed Strimzi.
-
You’ve created a topic named
my-topic
in the current namespace. -
You have Camel K installed on the cluster.
Procedure for using the cluster CLI
-
Save the
google-sheets-source-binding.yaml
file to your local drive, and then edit it as needed for your configuration. -
Run the source by using the following command:
kubectl apply -f google-sheets-source-binding.yaml
Procedure for using the Kamel CLI
Configure and run the source by using the following command:
kamel bind google-sheets-source -p "source.accessToken=The Access Token" -p "source.applicationName=The Application name" -p "source.clientId=The Client Id" -p "source.clientSecret=The Client Secret" -p "source.index=The Index" -p "source.refreshToken=The Refresh Token" -p "source.spreadsheetId=The Spreadsheet ID" kafka.strimzi.io/v1beta1:KafkaTopic:my-topic
This command creates the KameletBinding in the current namespace on the cluster.