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

Add Google Big Query Sink Kamelet #849

Merged
merged 1 commit into from
Mar 25, 2022
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
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
* xref:github-pullrequest-comment-source.adoc[]
* xref:github-pullrequest-source.adoc[]
* xref:github-tag-source.adoc[]
* xref:google-bigquery-sink.adoc[]
* xref:google-calendar-source.adoc[]
* xref:google-functions-sink.adoc[]
* xref:google-mail-source.adoc[]
Expand Down
87 changes: 87 additions & 0 deletions kamelets/google-bigquery-sink.kamelet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: google-bigquery-sink
annotations:
camel.apache.org/kamelet.support.level: "Preview"
camel.apache.org/catalog.version: "main-SNAPSHOT"
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI1MDAiIHdpZHRoPSIyNTAwIiB4bWxucz0iaHR0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gxIDEwLjM4NSAyMy4xOTUgMjMuMTk1IDIzLjE5NVM4Ny4xOTQgNzYuODEgODcuMTk0IDY0YzAtMTIuODExLTEwLjM4NS0yMy4xOTYtMjMuMTk0LTIzLjE5Nm0wIDQwLjc5NWMtOS43MiAwLTE3LjYtNy44OC0xNy42LTE3LjZTNTQuMjggNDYuNCA2NCA0Ni40IDgxLjYgNTQuMjggODEuNiA2NCA3My43MiA4MS42IDY0IDgxLjYiLz48cGF0aCBkPSJNNTIuOTkgNjMuMTA0djcuMjFhMTIuNzk0IDEyLjc5NCAwIDAgMCA0LjM4IDQuNDc1VjYzLjEwNHpNNjEuNjc1IDU3LjAyNnYxOS40MTFjLjc0NS4xMzcgMS41MDcuMjIgMi4yOS4yMi43MTQgMCAxLjQxLS4wNzUgMi4wOTMtLjE4OVY1Ny4wMjZ6TTcwLjc2NiA2Ni4xdjguNTYyYTEyLjc4NiAxMi43ODYgMCAwIDAgNC4zODItNC43di0zLjg2MXpNODAuNjkxIDc4LjI4N2wtMi40MDMgMi40MDVhMS4wODggMS4wODggMCAwIDAgMCAxLjUzN2w5LjExNSA5LjExMmExLjA4OCAxLjA4OCAwIDAgMCAxLjUzNyAwbDIuNDAzLTIuNDAyYTEuMDkyIDEuMDkyIDAgMCAwIDAtMS41MzZsLTkuMTE2LTkuMTE2YTEuMDkgMS4wOSAwIDAgMC0xLjUzNiAwIi8+PC9nPjwvc3ZnPg=="
camel.apache.org/provider: "Apache Software Foundation"
camel.apache.org/kamelet.group: "Google Big Query"
labels:
camel.apache.org/kamelet.type: "sink"
spec:
definition:
title: "Google Big Query Sink"
description: |-
Send data to a Google Big Query table.

It is expected the body is in Json format representing an object or an array of objects.

The credentialsFileLocation property needs to be a path to a service account key file.
required:
- projectId
- dataset
- table
- credentialsFileLocation
type: object
properties:
projectId:
title: Google Cloud Project Id
description: Google Cloud Project id
type: string
dataset:
title: Big Query Dataset Id
description: The Big Query Dataset Id
type: string
table:
title: Big Query Table Id
description: The Big Query Table Id
type: string
credentialsFileLocation:
title: Google Cloud Platform Credential File
description: The credential to access Google Cloud Platform api services
type: string
x-descriptors:
- urn:camel:group:credentials
types:
in:
mediaType: application/json
dependencies:
- "camel:core"
- "camel:kamelet"
- "camel:google-bigquery"
- "camel:jackson"
template:
beans:
- name: connectionFactoryBean
type: "#class:org.apache.camel.component.google.bigquery.GoogleBigQueryConnectionFactory"
property:
- key: credentialsFileLocation
value: '{{credentialsFileLocation}}'
from:
uri: "kamelet:source"
steps:
- unmarshal:
json:
library: Jackson
- to:
uri: "google-bigquery:{{projectId}}:{{dataset}}:{{table}}"
parameters:
connectionFactory: "#bean:{{connectionFactoryBean}}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: google-bigquery-sink
annotations:
camel.apache.org/kamelet.support.level: "Preview"
camel.apache.org/catalog.version: "main-SNAPSHOT"
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI1MDAiIHdpZHRoPSIyNTAwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0xLjYzMzIzNTQzMzMyODI1NiA3LjAzMjYwOTMzMDMxNTY1NjUgMTMxLjI2NTc0NjgyNDE2ODc2IDExNC42MzQzOTA2Njk2ODQzNSI+PGxpbmVhckdyYWRpZW50IGl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ZTNTQuMjggNDYuNCA2NCA0Ni40IDgxLjYgNTQuMjggODEuNiA2NCA3My43MiA4MS42IDY0IDgxLjYiLz48cGF0aCBkPSJNNTIuOTkgNjMuMTA0djcuMjFhMTIuNzk0IDEyLjc5NCAwIDAgMCA0LjM4IDQuNDc1VjYzLjEwNHpNNjEuNjc1IDU3LjAyNnYxOS40MTFjLjc0NS4xMzcgMS41MDcuMjIgMi4yOS4yMi43MTQgMCAxLjQxLS4wNzUgMi4wOTMtLjE4OVY1Ny4wMjZ6TTcwLjc2NiA2Ni4xdjguNTYyYTEyLjc4NiAxMi43ODYgMCAwIDAgNC4zODItNC43di0zLjg2MXpNODAuNjkxIDc4LjI4N2wtMi40MDMgMi40MDVhMS4wODggMS4wODggMCAwIDAgMCAxLjUzN2w5LjExNSA5LjExMmExLjA4OCAxLjA4OCAwIDAgMCAxLjUzNyAwbDIuNDAzLTIuNDAyYTEuMDkyIDEuMDkyIDAgMCAwIDAtMS41MzZsLTkuMTE2LTkuMTE2YTEuMDkgMS4wOSAwIDAgMC0xLjUzNiAwIi8+PC9nPjwvc3ZnPg=="
camel.apache.org/provider: "Apache Software Foundation"
camel.apache.org/kamelet.group: "Google Big Query"
labels:
camel.apache.org/kamelet.type: "sink"
spec:
definition:
title: "Google Big Query Sink"
description: |-
Send data to a Google Big Query table.

It is expected the body is in Json format representing an object or an array of objects.

The credentialsFileLocation property needs to be a path to a service account key file.
required:
- projectId
- dataset
- table
- credentialsFileLocation
type: object
properties:
projectId:
title: Google Cloud Project Id
description: Google Cloud Project id
type: string
dataset:
title: Big Query Dataset Id
description: The Big Query Dataset Id
type: string
table:
title: Big Query Table Id
description: The Big Query Table Id
type: string
credentialsFileLocation:
title: Google Cloud Platform Credential File
description: The credential to access Google Cloud Platform api services
type: string
x-descriptors:
- urn:camel:group:credentials
types:
in:
mediaType: application/json
dependencies:
- "camel:core"
- "camel:kamelet"
- "camel:google-bigquery"
- "camel:jackson"
template:
beans:
- name: connectionFactoryBean
type: "#class:org.apache.camel.component.google.bigquery.GoogleBigQueryConnectionFactory"
property:
- key: credentialsFileLocation
value: '{{credentialsFileLocation}}'
from:
uri: "kamelet:source"
steps:
- unmarshal:
json:
library: Jackson
- to:
uri: "google-bigquery:{{projectId}}:{{dataset}}:{{table}}"
parameters:
connectionFactory: "#bean:{{connectionFactoryBean}}"