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 azure data lake gen2 - Sink Kamelet #1390

Merged
merged 4 commits into from
Mar 20, 2023
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 @@ -36,6 +36,7 @@
* xref:azure-storage-blob-changefeed-source.adoc[]
* xref:azure-storage-blob-sink.adoc[]
* xref:azure-storage-blob-source.adoc[]
* xref:azure-storage-datalake-sink.adoc[]
* xref:azure-storage-datalake-source.adoc[]
* xref:azure-storage-queue-sink.adoc[]
* xref:azure-storage-queue-source.adoc[]
Expand Down
113 changes: 113 additions & 0 deletions kamelets/azure-storage-datalake-sink.kamelet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# ---------------------------------------------------------------------------
# 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: azure-storage-datalake-sink
annotations:
camel.apache.org/kamelet.support.level: "Stable"
camel.apache.org/catalog.version: "4.0.0-SNAPSHOT"
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0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DMuOSwwLDUuNi0zTDY4OCw0MjMuN3YtNC4zYy0wLjItMy45LTMuNC02LjktNy4zLTYuOWgtODYuMWwzNC45LTExNy41QzYzMS4yLDI5My4yLDYzMS4zLDI5MC4zLDYyOS45LDI4OC4yTDYyOS45LDI4OC4yeiIvPg0KPC9zdmc+DQo="
camel.apache.org/provider: "Apache Software Foundation"
camel.apache.org/kamelet.group: "Azure Storage Blob Data Lake"
camel.apache.org/kamelet.namespace: "Azure"
labels:
camel.apache.org/kamelet.type: "sink"
spec:
definition:
title: "Azure Storage Blob Data Lake Sink"
description: |-
Send data to Azure Storage Blob Data Lake.
required:
- accountName
- clientId
- clientSecret
- tenantId
- fileSystemName
type: object
properties:
accountName:
title: Account Name
description: The Azure Storage Blob Data lake account name.
type: string
x-descriptors:
- urn:camel:group:credentials
clientId:
title: Client Id
description: The Azure Storage Blob Data lake client Id.
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
- urn:camel:group:credentials
clientSecret:
title: Client Secret
description: The Azure Storage Blob Data lake client secret.
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
- urn:camel:group:credentials
tenantId:
title: Tenant Id
description: The Azure Storage Blob Data lake tenant id.
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
- urn:camel:group:credentials
fileSystemName:
title: File System Name
description: The Azure Storage Blob Data lake File system name.
type: string
x-descriptors:
- urn:camel:group:credentials
dependencies:
- "camel:azure-storage-datalake"
- "camel:kamelet"
- "camel:core"
- "camel:timer"
- "github:apache.camel-kamelets:camel-kamelets-utils:4.0.0-SNAPSHOT"
template:
from:
uri: "kamelet:source"
steps:
- choice:
when:
- simple: "${header[file]}"
steps:
- set-header:
name: CamelAzureStorageDataLakeFileName
simple: "${header[file]}"
- simple: "${header[ce-file]}"
steps:
- set-header:
name: CamelAzureStorageDataLakeFileName
simple: "${header[ce-file]}"
otherwise:
steps:
- set-header:
name: CamelAzureStorageDataLakeFileName
simple: "${exchangeId}"
- to:
uri: "azure-storage-datalake:{{accountName}}/{{fileSystemName}}"
parameters:
clientId: "{{clientId}}"
clientSecret: "{{clientSecret}}"
tenantId: "{{tenantId}}"
operation: "upload"
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# ---------------------------------------------------------------------------
# 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: azure-storage-datalake-sink
annotations:
camel.apache.org/kamelet.support.level: "Stable"
camel.apache.org/catalog.version: "4.0.0-SNAPSHOT"
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyNi4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4wIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAxMTU4LjIgODYwLjQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDExNTguMiA4NjAuNDsiIHhtbDpzcG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jJMNTA5LDI1OC4xYy0zLjMsMy03LjYsNC43LTEyLDQuN0gyMzAuNWMtOS41LDAtMTcuMiw3LjctMTcuMiwxNy4ybDAsMA0KCXY0MzAuM2MwLjIsOS4zLDcuOSwxNi44LDE3LjIsMTYuOGg2OTcuMWM5LjMsMCwxNy03LjQsMTcuMi0xNi44VjIxNWMwLjEtMi4zLTAuMy00LjctMS4xLTYuOUM5NDEuMywyMDEuNCw5MzQuOSwxOTcsOTI3LjcsMTk3eiIvPg0KPHBhdGggY2xhc3M9InN0MSIgZD0iTTYyOS45LDI4OC4yYy0xLjEtMC4zLTIuMy0wLjMtMy41LDBjMCwwLTMuOSwwLTUuNiwzbC0xMzYsMTk3LjVjLTEuMiwyLjEtMS4yLDQuOCwwLDYuOWMxLjMsMi40LDMuNyw0LDYuNSw0LjMNCgloODAuNWwtMzUuNiwxMTkuNmMtMC40LDAuNy0wLjYsMS41LTAuNiwyLjJjMCwwLjgsMC4xLDEuNiwwLjQsMi4zYzAuMywwLjcsMC43LDEuNCwxLjMsMS45YzAuNiwwLjYsMS4zLDEsMiwxLjNjMSwwLjQsMiwwLjQsMywwDQoJYzIuNiwwLDMuOSwwLDUuNi0zTDY4OCw0MjMuN3YtNC4zYy0wLjItMy45LTMuNC02LjktNy4zLTYuOWgtODYuMWwzNC45LTExNy41QzYzMS4yLDI5My4yLDYzMS4zLDI5MC4zLDYyOS45LDI4OC4yTDYyOS45LDI4OC4yeiIvPg0KPC9zdmc+DQo="
camel.apache.org/provider: "Apache Software Foundation"
camel.apache.org/kamelet.group: "Azure Storage Blob Data Lake"
camel.apache.org/kamelet.namespace: "Azure"
labels:
camel.apache.org/kamelet.type: "sink"
spec:
definition:
title: "Azure Storage Blob Data Lake Sink"
description: |-
Send data to Azure Storage Blob Data Lake.
required:
- accountName
- clientId
- clientSecret
- tenantId
- fileSystemName
type: object
properties:
accountName:
title: Account Name
description: The Azure Storage Blob Data lake account name.
type: string
x-descriptors:
- urn:camel:group:credentials
clientId:
title: Client Id
description: The Azure Storage Blob Data lake client Id.
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
- urn:camel:group:credentials
clientSecret:
title: Client Secret
description: The Azure Storage Blob Data lake client secret.
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
- urn:camel:group:credentials
tenantId:
title: Tenant Id
description: The Azure Storage Blob Data lake tenant id.
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
- urn:camel:group:credentials
fileSystemName:
title: File System Name
description: The Azure Storage Blob Data lake File system name.
type: string
x-descriptors:
- urn:camel:group:credentials
dependencies:
- "camel:azure-storage-datalake"
- "camel:kamelet"
- "camel:core"
- "camel:timer"
- "github:apache.camel-kamelets:camel-kamelets-utils:4.0.0-SNAPSHOT"
template:
from:
uri: "kamelet:source"
steps:
- choice:
when:
- simple: "${header[file]}"
steps:
- set-header:
name: CamelAzureStorageDataLakeFileName
simple: "${header[file]}"
- simple: "${header[ce-file]}"
steps:
- set-header:
name: CamelAzureStorageDataLakeFileName
simple: "${header[ce-file]}"
otherwise:
steps:
- set-header:
name: CamelAzureStorageDataLakeFileName
simple: "${exchangeId}"
- to:
uri: "azure-storage-datalake:{{accountName}}/{{fileSystemName}}"
parameters:
clientId: "{{clientId}}"
clientSecret: "{{clientSecret}}"
tenantId: "{{tenantId}}"
operation: "upload"