This is an automated email from the ASF dual-hosted git repository. nferraro pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
commit 2ae40fb696e53932c2b9eb6620d8084a81be0e8e Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Mon Mar 8 08:57:27 2021 +0100 Added SFTP Source Kamelet and create FTP group --- .../ROOT/assets/images/kamelets/sftp-source.svg | 1 + docs/modules/ROOT/nav.adoc | 1 + docs/modules/ROOT/pages/ftp-source.adoc | 6 +- docs/modules/ROOT/pages/sftp-source.adoc | 69 ++++++++++++++++++++++ ftp-source.kamelet.yaml | 1 + ...source.kamelet.yaml => sftp-source.kamelet.yaml | 19 +++--- 6 files changed, 85 insertions(+), 12 deletions(-) diff --git a/docs/modules/ROOT/assets/images/kamelets/sftp-source.svg b/docs/modules/ROOT/assets/images/kamelets/sftp-source.svg new file mode 100644 index 0000000..4c77024 --- /dev/null +++ b/docs/modules/ROOT/assets/images/kamelets/sftp-source.svg @@ -0,0 +1 @@ +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" x="0" y="0" viewBox="0 0 221.1 300" xml:space="preserve"><style></style><circle cx="111.6" cy="192" r="88.6" fill="#2b3990"/><path d="M110.6 100.2c-50.8 0-92.2 41.4-92.2 92.2 0 50.9 41.4 92.2 92.2 92.2 50.8 0 92.2-41.4 92.2-92.2 0-50.8-41.4-92.2-92.2-92.2zm72.6 44c-7 6.8-13.3 14.4-18.6 22.7-.5-.1-.9-.2-1.4-.2-1 0-1.9.3-2.8.7-4.6-6.5-8.4-13.1-11.3-19.6 1.7-1.1 2.8-3 2.8-5.2 0-.6-.1-1.1-.3-1.7 6.3-4.4 11.7-9.3 16-14.3 6 5.1 [...] \ No newline at end of file diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index e512fe2..7847c80 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -12,6 +12,7 @@ * xref:ROOT:mqtt-source.adoc[image:kamelets/mqtt-source.svg[] MQTT Source] * xref:ROOT:nats-source.adoc[image:kamelets/nats-source.svg[] NATS Source] * xref:ROOT:salesforce-source.adoc[image:kamelets/salesforce-source.svg[] Salesforce Source] +* xref:ROOT:sftp-source.adoc[image:kamelets/sftp-source.svg[] SFTP Source] * xref:ROOT:slack-source.adoc[image:kamelets/slack-source.svg[] Slack Source] * xref:ROOT:telegram-source.adoc[image:kamelets/telegram-source.svg[] Telegram Source] * xref:ROOT:timer-source.adoc[image:kamelets/timer-source.svg[] Timer Source] diff --git a/docs/modules/ROOT/pages/ftp-source.adoc b/docs/modules/ROOT/pages/ftp-source.adoc index 4b4e59f..0792f9b 100644 --- a/docs/modules/ROOT/pages/ftp-source.adoc +++ b/docs/modules/ROOT/pages/ftp-source.adoc @@ -11,11 +11,13 @@ The following table summarizes the configuration options available for the `ftp- [width="100%",cols="2,^2,3,^2,^2,^3",options="header"] |=== | Property| Name| Description| Type| Default| Example -| *directoryName {empty}* *| directoryName| The starting directory| string| | +| *directoryName {empty}* *| Directory Name| The starting directory| string| | | *host {empty}* *| Host| Hostname of the FTP server| string| | | *password {empty}* *| Password| The password to access the FTP server| string| | | *port {empty}* *| Port| Port of the FTP server| string| `21`| | *username {empty}* *| Username| The username to access the FTP server| string| | +| passiveMode| Passive Mode| Sets passive mode connection| boolean| `false`| +| recursive| Recursive| If a directory, will look for files in all the sub-directories as well.| boolean| `false`| |=== NOTE: Fields marked with ({empty}*) are mandatory. @@ -42,7 +44,7 @@ spec: apiVersion: camel.apache.org/v1alpha1 name: ftp-source properties: - directoryName: "The directoryName" + directoryName: "The Directory Name" host: "The Host" password: "The Password" username: "The Username" diff --git a/docs/modules/ROOT/pages/sftp-source.adoc b/docs/modules/ROOT/pages/sftp-source.adoc new file mode 100644 index 0000000..69d25fc --- /dev/null +++ b/docs/modules/ROOT/pages/sftp-source.adoc @@ -0,0 +1,69 @@ +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT += image:kamelets/sftp-source.svg[] SFTP Source + +*Provided by: "Apache Software Foundation"* + +Receive data from an SFTP Server. + +== Configuration Options + +The following table summarizes the configuration options available for the `sftp-source` Kamelet: +[width="100%",cols="2,^2,3,^2,^2,^3",options="header"] +|=== +| Property| Name| Description| Type| Default| Example +| *directoryName {empty}* *| Directory Name| The starting directory| string| | +| *host {empty}* *| Host| Hostname of the SFTP server| string| | +| *password {empty}* *| Password| The password to access the SFTP server| string| | +| *port {empty}* *| Port| Port of the FTP server| string| `22`| +| *username {empty}* *| Username| The username to access the SFTP server| string| | +| passiveMode| Passive Mode| Sets passive mode connection| boolean| `false`| +| recursive| Recursive| If a directory, will look for files in all the sub-directories as well.| boolean| `false`| +|=== + +NOTE: Fields marked with ({empty}*) are mandatory. + +== Usage + +This section summarizes how the `sftp-source` can be used in various contexts. + +=== Knative Source + +The `sftp-source` Kamelet can be used as Knative source by binding it to a Knative object. + +.sftp-source-binding.yaml +[source,yaml] +---- +apiVersion: camel.apache.org/v1alpha1 +kind: KameletBinding +metadata: + name: sftp-source-binding +spec: + source: + ref: + kind: Kamelet + apiVersion: camel.apache.org/v1alpha1 + name: sftp-source + properties: + directoryName: "The Directory Name" + host: "The Host" + password: "The Password" + username: "The Username" + sink: + ref: + kind: InMemoryChannel + apiVersion: messaging.knative.dev/v1 + name: mychannel + +---- + +Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to. + +Save the `sftp-source-binding.yaml` file into your hard drive, then configure it according to your needs. + +You can run the source using the following command: + +[source,shell] +---- +kubectl apply -f sftp-source-binding.yaml +---- +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT diff --git a/ftp-source.kamelet.yaml b/ftp-source.kamelet.yaml index f3e2378..18c827c 100644 --- a/ftp-source.kamelet.yaml +++ b/ftp-source.kamelet.yaml @@ -7,6 +7,7 @@ metadata: camel.apache.org/provider: "Apache Software Foundation" labels: camel.apache.org/kamelet.type: "source" + camel.apache.org/kamelet.group: "FTP" spec: definition: title: "FTP Source" diff --git a/ftp-source.kamelet.yaml b/sftp-source.kamelet.yaml similarity index 95% copy from ftp-source.kamelet.yaml copy to sftp-source.kamelet.yaml index f3e2378..aa99b03 100644 --- a/ftp-source.kamelet.yaml +++ b/sftp-source.kamelet.yaml @@ -1,17 +1,18 @@ apiVersion: camel.apache.org/v1alpha1 kind: Kamelet metadata: - name: ftp-source + name: sftp-source annotations: camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAyMjEuMSAzMDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwID [...] camel.apache.org/provider: "Apache Software Foundation" labels: camel.apache.org/kamelet.type: "source" + camel.apache.org/kamelet.group: "FTP" spec: definition: - title: "FTP Source" + title: "SFTP Source" description: |- - Receive data from an FTP Server. + Receive data from an SFTP Server. required: - host - port @@ -21,20 +22,20 @@ spec: properties: host: title: Host - description: Hostname of the FTP server + description: Hostname of the SFTP server type: string port: title: Port description: Port of the FTP server type: string - default: 21 + default: 22 username: title: Username - description: The username to access the FTP server + description: The username to access the SFTP server type: string password: title: Password - description: The password to access the FTP server + description: The password to access the SFTP server type: string x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password @@ -55,11 +56,9 @@ spec: types: out: mediaType: application/json - dependencies: - - "camel:jackson" flow: from: - uri: "ftp:{{username}}@{{host}}:{{port}}/{{directoryName}}" + uri: "sftp:{{username}}@{{host}}:{{port}}/{{directoryName}}" parameters: password: "{{password}}" passiveMode: "{{passiveMode}}"