Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Calendar Stream Source Kamelet #49

Merged
merged 2 commits into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* xref:ROOT:bitcoin-source.adoc[image:kamelets/bitcoin-source.svg[] Bitcoin Source]
* xref:ROOT:ftp-source.adoc[image:kamelets/ftp-source.svg[] FTP Source]
* 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: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]
Expand Down
74 changes: 74 additions & 0 deletions docs/modules/ROOT/pages/google-calendar-stream-source.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
= image:kamelets/google-calendar-stream-source.svg[] Google Calendar Stream Source

*Provided by: "Apache Software Foundation"*

Receive data from Google Calendar.

== Configuration Options

The following table summarizes the configuration options available for the `google-calendar-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 calendar application. This typically expires after an hour so refreshToken is recommended for long term usage.| string| |
| *applicationName {empty}* *| Application name| Google Calendar application name| string| |
| *calendarId {empty}* *| Calendar ID| The calendar ID to be used as events source| string| |
| *clientId {empty}* *| Client Id| Client ID of the calendar application| string| |
| *clientSecret {empty}* *| Client Secret| Client Secret of the calendar application| string| |
| *index {empty}* *| Index| An index for the google calendar endpoint| string| |
| *refreshToken {empty}* *| Refresh Token| OAuth 2 refresh token for google calendar 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| |
| consumeFromNow| Consume from now| Consume events in the selected calendar from now on| boolean| `true`|
| syncFlow| Sync Flow| Sync events for incremental synchronization| boolean| `false`|
|===

NOTE: Fields marked with ({empty}*) are mandatory.

== Usage

This section summarizes how the `google-calendar-stream-source` can be used in various contexts.

=== Knative Source

The `google-calendar-stream-source` Kamelet can be used as Knative source by binding it to a Knative object.

.google-calendar-stream-source-binding.yaml
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: google-calendar-stream-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: google-calendar-stream-source
properties:
accessToken: "The Access Token"
applicationName: "The Application name"
calendarId: "The Calendar ID"
clientId: "The Client Id"
clientSecret: "The Client Secret"
index: "The Index"
refreshToken: "The Refresh Token"
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-calendar-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-calendar-stream-source-binding.yaml
----
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
94 changes: 94 additions & 0 deletions google-calendar-stream-source.kamelet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: google-calendar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0uOS43Ni0uNiAxLjE0LTEuNDIgMS4xNC0yLjQ2NSAwIC0uOTMtLjM0LTEuNjctMS4wMi0yLjIyNS0uNjgtLjU1NS0xLjU0LS44MzUtMi41ODUtLjgzNS0xLjAyIDAgLTEuODMuMjctMi40My44MTVhNC43ODQgNC43ODQgMCAwIDAgLTEuMzEgMi4wMDVsLTMuNDM1LTEuNDNjLjQ1NS0xLjI5IDEuMjktMi40MyAyLjUxNS0zLjQxNSAxLjIyNS0uOTg1IDIuNzktMS40OCA0LjY5LTEuNDggMS40MDUgMCAyLjY3LjI3IDMuNzkuODE1IDEuMTIuNTQ1IDIgMS4zIDIuNjM1IDIuMjYuNjM1Ljk2NS45NSAyLjA0NS45NSAzLjI0NSAwIDEuMjI1LS4yOTUgMi4yNi0uODg1IDMuMTEtLjU5Ljg1LTEuMzE1IDEuNS0yLjE3NSAxLjk1NXYuMjA1YTYuNjA1IDYuNjA1IDAgMCAxIDIuNzkgMi4xNzVjLjcyNS45NzUgMS4wOSAyLjE0IDEuMDkgMy41IDAgMS4zNi0uMzQ1IDIuNTc1LTEuMDM1IDMuNjRzLTEuNjQ1IDEuOTA1LTIuODU1IDIuNTE1Yy0xLjIxNS42MS0yLjU4LjkyLTQuMDk1LjkyLTEuNzU1LjAwNS0zLjM3NS0uNS00Ljg3LTEuNTF6TTIzMy41MiA2OS44MWwtMy44MSAyLjc1NS0xLjkwNS0yLjg5IDYuODM1LTQuOTNoMi42MlY4OGgtMy43NFY2OS44MXoiLz48L3N2Zz4="
camel.apache.org/provider: "Apache Software Foundation"
labels:
camel.apache.org/kamelet.type: "source"
spec:
definition:
title: "Google Calendar Stream Source"
description: |-
Receive data from Google Calendar.
required:
- index
- calendarId
- clientId
- accessToken
- refreshToken
- clientSecret
- applicationName
properties:
index:
title: Index
description: An index for the google calendar endpoint
type: string
calendarId:
title: Calendar ID
description: The calendar ID to be used as events source
type: string
clientId:
title: Client Id
description: Client ID of the calendar application
type: string
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
clientSecret:
title: Client Secret
description: Client Secret of the calendar application
type: string
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
accessToken:
title: Access Token
description: OAuth 2 access token for google calendar 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 calendar 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 Calendar application name
type: string
syncFlow:
title: Sync Flow
description: Sync events for incremental synchronization
type: boolean
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
default: false
consumeFromNow:
title: Consume from now
description: Consume events in the selected calendar from now on
type: boolean
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
default: true
types:
out:
mediaType: application/json
dependencies:
- "camel:jackson"
flow:
from:
uri: "google-calendar-stream://{{index}}"
parameters:
clientId: "{{clientId}}"
calendarId: "{{calendarId}}"
accessToken: "{{accessToken}}"
refreshToken: "{{refreshToken}}"
clientSecret: "{{clientSecret}}"
applicationName: "{{applicationName}}"
syncFlow: "{{syncFlow}}"
consumeFromNow: "{{consumeFromNow}}"
steps:
- marshal:
json: {}
- to: "kamelet:sink"