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

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 1eb36b2ccd4dea4007661e845f1013663f3523b7
Author: Andrea Cosentino <[email protected]>
AuthorDate: Tue May 25 15:13:30 2021 +0200

    Added FTP Sink Kamelet
---
 ftp-sink.kamelet.yaml | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)

diff --git a/ftp-sink.kamelet.yaml b/ftp-sink.kamelet.yaml
new file mode 100644
index 0000000..5ae8b23
--- /dev/null
+++ b/ftp-sink.kamelet.yaml
@@ -0,0 +1,91 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: ftp-sink
+  annotations:
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAyMjEuMSAzMDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwID
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "FTP"
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+spec:
+  definition:
+    title: "FTP Sink"
+    description: |-
+      Send data to an FTP Server.
+
+      The Kamelet expects the following headers to be set:
+
+      - `file` / `ce-file`: as the file name to upload
+
+      If the header won't be set the exchange ID will be used as file name.
+    required:
+      - host
+      - port
+      - username
+      - password
+      - directoryName
+    type: object
+    properties:
+      host:
+        title: Host
+        description: Hostname of the FTP server
+        type: string
+      port:
+        title: Port
+        description: Port of the FTP server
+        type: string
+        default: 21
+      username:
+        title: Username
+        description: The username to access the FTP server
+        type: string
+      password:
+        title: Password
+        description: The password to access the FTP server
+        type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+      directoryName:
+        title: Directory Name
+        description: The starting directory
+        type: string
+      passiveMode:
+        title: Passive Mode
+        description: Sets passive mode connection
+        type: boolean
+        default: false
+        x-descriptors:
+        - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+      fileExist:
+        title: File Existence
+        description: How to behave in case of file already existent. There are 
4 enums and the value can be one of Override, Append, Fail or Ignore
+        type: string
+        default: Override
+  dependencies:
+    - "camel:ftp"
+    - "camel:core"
+    - "camel:kamelet"
+  flow:
+    from:
+      uri: "kamelet:source"
+      steps:
+      - choice:
+          when:
+          - simple: "${header[file]}"
+            steps:
+            - set-header:
+                name: CamelFileName
+                simple: "${header[file]}"
+          - simple: "${header[ce-file]}"
+            steps:
+            - set-header:
+                name: CamelFileName
+                simple: "${header[ce-file]}"
+      - to:
+          uri: "ftp:{{username}}@{{host}}:{{port}}/{{directoryName}}"
+          parameters:
+            password: "{{password}}"
+            passiveMode: "{{passiveMode}}"
+            fileExist: "{{fileExist}}"

Reply via email to