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 2021/05/26 11:05:18 UTC
[camel-kamelets] 01/04: Added SFTP Sink Kamelet
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch sftp-sink
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
commit b9a56fdb4299edbbcdbc45076fca751f8dbe8725
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed May 26 13:02:26 2021 +0200
Added SFTP Sink Kamelet
---
sftp-sink.kamelet.yaml | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 92 insertions(+)
diff --git a/sftp-sink.kamelet.yaml b/sftp-sink.kamelet.yaml
new file mode 100644
index 0000000..57da6b4
--- /dev/null
+++ b/sftp-sink.kamelet.yaml
@@ -0,0 +1,92 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+ name: sftp-sink
+ annotations:
+ camel.apache.org/catalog.version: "main-SNAPSHOT"
+ 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: "SFTP Sink"
+ description: |-
+ Send data to an SFTP 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: 22
+ 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: "sftp:{{username}}@{{host}}:{{port}}/{{directoryName}}"
+ parameters:
+ password: "{{password}}"
+ passiveMode: "{{passiveMode}}"
+ fileExist: "{{fileExist}}"