google calendar source Google Calendar Source

Provided by: "Apache Software Foundation"

Support Level for this Kamelet is: "Preview"

Receive data from Google Calendar.

Configuration Options

The following table summarizes the configuration options available for the google-calendar-source Kamelet:

Property Name Description Type Default Example

accessToken *

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 *

Application name

Google Calendar application name

string

calendarId *

Calendar ID

The calendar ID to be used as events source

string

clientId *

Client Id

Client ID of the calendar application

string

clientSecret *

Client Secret

Client Secret of the calendar application

string

index *

Index

An index for the google calendar endpoint

string

refreshToken *

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

delay

Delay

Milliseconds before the next poll

integer

500

syncFlow

Sync Flow

Sync events for incremental synchronization

boolean

false

Fields marked with (*) are mandatory.

Usage

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

Knative Source

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

google-calendar-source-binding.yaml
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
  name: google-calendar-source-binding
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1alpha1
      name: google-calendar-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: Channel
      apiVersion: messaging.knative.dev/v1
      name: mychannel

Make sure you have Camel K installed into the Kubernetes cluster you’re connected to.

Save the google-calendar-source-binding.yaml file into your hard drive, then configure it according to your needs.

You can run the source using the following command:

kubectl apply -f google-calendar-source-binding.yaml

Dependencies

The Kamelet needs the following dependencies:

  • camel:jackson

  • camel:google-calendar

  • camel:kamelet

Binding to Knative using the Kamel CLI:

The procedure described above can be simplified into a single execution of the kamel bind command:

kamel bind google-calendar-source -p "source.accessToken=The Access Token" -p "source.applicationName=The Application name" -p "source.calendarId=The Calendar ID" -p "source.clientId=The Client Id" -p "source.clientSecret=The Client Secret" -p "source.index=The Index" -p "source.refreshToken=The Refresh Token" channel:mychannel

This will create the KameletBinding under the hood and apply it to the current namespace in the cluster.

Kafka Source

The google-calendar-source Kamelet can be used as Kafka source by binding it to a Kafka topic.

google-calendar-source-binding.yaml
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
  name: google-calendar-source-binding
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1alpha1
      name: google-calendar-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: KafkaTopic
      apiVersion: kafka.strimzi.io/v1beta1
      name: my-topic

Ensure that you’ve installed Strimzi and created a topic named my-topic in the current namespace. Make also sure you have Camel K installed into the Kubernetes cluster you’re connected to.

Save the google-calendar-source-binding.yaml file into your hard drive, then configure it according to your needs.

You can run the source using the following command:

kubectl apply -f google-calendar-source-binding.yaml

Binding to Kafka using the Kamel CLI:

The procedure described above can be simplified into a single execution of the kamel bind command:

kamel bind google-calendar-source -p "source.accessToken=The Access Token" -p "source.applicationName=The Application name" -p "source.calendarId=The Calendar ID" -p "source.clientId=The Client Id" -p "source.clientSecret=The Client Secret" -p "source.index=The Index" -p "source.refreshToken=The Refresh Token" kafka.strimzi.io/v1beta1:KafkaTopic:my-topic

This will create the KameletBinding under the hood and apply it to the current namespace in the cluster.