You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2023/03/20 10:18:19 UTC

[camel-kamelets] 02/04: Add azure data lake gen2 - Sink Kamelet

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch azure-datalake-storage-sink-3.x
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 0b62b4cc5d81ceb175ddc4e23ddb97ebc338ca0f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Mar 20 11:14:19 2023 +0100

    Add azure data lake gen2 - Sink Kamelet
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../azure-storage-datalake-sink.kamelet.yaml       | 113 +++++++++++++++++++++
 1 file changed, 113 insertions(+)

diff --git a/library/camel-kamelets/src/main/resources/kamelets/azure-storage-datalake-sink.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/azure-storage-datalake-sink.kamelet.yaml
new file mode 100644
index 00000000..a1de0ed7
--- /dev/null
+++ b/library/camel-kamelets/src/main/resources/kamelets/azure-storage-datalake-sink.kamelet.yaml
@@ -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,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyNi4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4wIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAxMTU4LjIgODYwLjQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMC [...]
+    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"