google calendar source Google Calendar Source

Provided by: "Apache Software Foundation"

Support Level for this Kamelet is: "Stable"

Receive event 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

Required The OAuth 2 access token for the Google Calendar application. This token typically expires after an hour. For long term usage, set the refreshToken property.

string

applicationName

Application name

Required The Google Calendar application name.

string

calendarId

Calendar ID

Required The calendar ID to use as the source of event data.

string

clientId

Client Id

Required The Client ID of the Google Calendar application.

string

clientSecret

Client Secret

Required The Client secret of the Google Calendar application.

string

index

Index

Required An index for the Google Calendar endpoint.

string

refreshToken

Refresh Token

Required The OAuth 2 refresh token for the Google Calendar application. The Google Calendar component can obtain a new accessToken whenever the current one expires. Set this value for long term usage.

string

consumeFromNow

Consume from now

Specfies to consume events in the calendar from now on.

boolean

true

delay

Delay

The number of milliseconds before the next poll.

integer

500

syncFlow

Sync Flow

Specifies to sync events for incremental synchronization.

boolean

false

Dependencies

At runtime, the google-calendar-source Kamelet relies upon the presence of the following dependencies:

  • camel:jackson

  • camel:google-calendar

  • camel:kamelet

Camel JBang usage

Prerequisites

  • You’ve installed JBang.

  • You have executed the following command:

jbang app install camel@apache/camel

Supposing you have a file named route.yaml with this content:

- route:
    from:
      uri: "kamelet:timer-source"
      parameters:
        period: 10000
        message: 'test'
      steps:
        - to:
            uri: "kamelet:log-sink"

You can now run it directly through the following command

camel run route.yaml

Camel K Environment Usage

This section describes how you can use the google-calendar-source.

Knative source

You can use the google-calendar-source Kamelet as a Knative source by binding it to a Knative object.

google-calendar-source-pipe.yaml
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
  name: google-calendar-source-pipe
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      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

Prerequisite

You have Camel K installed on the cluster.

Procedure for using the cluster CLI

  1. Save the google-calendar-source-pipe.yaml file to your local drive, and then edit it as needed for your configuration.

  2. Run the source by using the following command:

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

Procedure for using the Kamel CLI

Configure and run the source by using the following 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 command creates the Kamelet Pipe in the current namespace on the cluster.

Kafka source

You can use the google-calendar-source Kamelet as a Kafka source by binding it to a Kafka topic.

google-calendar-source-pipe.yaml
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
  name: google-calendar-source-pipe
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      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

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

  1. Save the google-calendar-source-pipe.yaml file to your local drive, and then edit it as needed for your configuration.

  2. Run the source by using the following command:

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

Procedure for using the Kamel CLI

Configure and run the source by using the following 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 command creates the Kamelet Pipe in the current namespace on the cluster.