From cf5f15c169ea754121194b59bcdec7d25b01b769 Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Tue, 23 Mar 2021 14:14:42 +0100 Subject: [PATCH 1/4] Added Dropbox Kamelet source --- dropbox-source.kamelet.yaml | 66 +++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 dropbox-source.kamelet.yaml diff --git a/dropbox-source.kamelet.yaml b/dropbox-source.kamelet.yaml new file mode 100644 index 000000000..bfda21c93 --- /dev/null +++ b/dropbox-source.kamelet.yaml @@ -0,0 +1,66 @@ +apiVersion: camel.apache.org/v1alpha1 +kind: Kamelet +metadata: + name: dropbox-source + annotations: + camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHg9IjAiIHk9IjAiIHZpZXdCb3g9IjAgMCAyNDguMiAzMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxzdHlsZT4uc3QyOHtmaWxsOiM4YzMxMjN9LnN0Mjl7ZmlsbDojZTA1MjQzfTwvc3R5bGU+PHBhdGggY2xhc3M9InN0MjgiIGQ9Ik0yMCA1Mi4xTDAgNjJ2MTc1LjVsMjAgOS45LjEtLjFWNTIuMmwtLjEtLjEiLz48cGF0aCBjbGFzcz0ic3QyOSIgZD0iTTEyNyAyMjJMMjAgMjQ3LjVWNTIuMUwxMjcgNzd2MTQ1Ii8+PHBhdGggY2xhc3M9InN0MjgiIGQ9Ik03OC43IDE4Mi4xbDQ1LjQgNS44LjMtLjcuMy03NC40LS41LS42LTQ1LjQgNS43LS4xIDY0LjIiLz48cGF0aCBjbGFzcz0ic3QyOCIgZD0iTTEyNC4xIDIyMi4zbDEwNC4xIDI1LjIuMi0uM1Y1Mi4xbC0uMi0uMi0xMDQuMSAyNS40djE0NSIvPjxwYXRoIGNsYXNzPSJzdDI5IiBkPSJNMTY5LjUgMTgyLjFsLTQ1LjQgNS44di03NS43bDQ1LjQgNS43djY0LjIiLz48cGF0aCBkPSJNMTY5LjUgODYuOWwtNDUuNCA4LjMtNDUuNC04LjNMMTI0IDc1bDQ1LjUgMTEuOSIgZmlsbD0iIzVlMWYxOCIvPjxwYXRoIGQ9Ik0xNjkuNSAyMTMuMWwtNDUuNC04LjMtNDUuNCA4LjMgNDUuMyAxMi43IDQ1LjUtMTIuNyIgZmlsbD0iI2YyYjBhOSIvPjxwYXRoIGNsYXNzPSJzdDI4IiBkPSJNNzguNyA4Ni45bDQ1LjQtMTEuMi40LS4xVi4zbC0uNC0uMy00NS40IDIyLjd2NjQuMiIvPjxwYXRoIGNsYXNzPSJzdDI5IiBkPSJNMTY5LjUgODYuOWwtNDUuNC0xMS4yVjBsNDUuNCAyMi43djY0LjIiLz48cGF0aCBjbGFzcz0ic3QyOCIgZD0iTTEyNC4xIDMwMGwtNDUuNC0yMi43di02NC4ybDQ1LjQgMTEuMi43LjgtLjIgNzMuNi0uNSAxLjMiLz48cGF0aCBjbGFzcz0ic3QyOSIgZD0iTTEyNC4xIDMwMGw0NS40LTIyLjd2LTY0LjJsLTQ1LjQgMTEuMlYzMDBNMjI4LjIgNTIuMWwyMCAxMHYxNzUuNWwtMjAgMTBWNTIuMSIvPjwvc3ZnPg==" + camel.apache.org/provider: "Apache Software Foundation" + labels: + camel.apache.org/kamelet.type: "source" +spec: + definition: + title: "Dropbox Source" + description: |- + Consume Files from Dropbox. + required: + - period + - accessToken + - clientIdentifier + - remotePath + properties: + period: + title: Period between polls + description: The interval between fetches to the earthquake API in milliseconds + type: integer + default: 10000 + accessToken: + title: Dropbox Access Token + description: The access Token to use to access Dropbox + type: string + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:password + clientIdentifier: + title: The client identifier + description: Dropbox App client Identifier + type: string + remotePath: + title: Remote path + description: Original file or folder to work with + type: string + query: + title: Querys + description: A space-separated list of sub-strings to search for. A file matches only if it contains all the sub-strings. If this option is not set, all files will be matched. + type: string + flow: + from: + uri: "timer:dropbox-stream" + parameters: + period: "{{period}}" + steps: + - to: + uri: "dropbox:search" + parameters: + accessToken: "{{accessToken}}" + remotePath: "{{remotePath}}" + clientIdentifier: "{{clientIdentifier}}" + query: "{{query}}" + - split: + jsonpath: "$.*" + steps: + - set-property: + name: dropboxFileName + simple: ${body.metadata.pathDisplay} + - tod: "dropbox:get?accessToken={{accessToken}}&clientIdentifier={{clientIdentifier}}&remotePath=${exchangeProperty.dropboxFileName}" + - to: "kamelet:sink" + - tod: "dropbox:del?accessToken={{accessToken}}&clientIdentifier={{clientIdentifier}}&remotePath=${exchangeProperty.dropboxFileName}" + From b494ad480c08754396315585251068ff6c1ee8ec Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Tue, 23 Mar 2021 14:16:36 +0100 Subject: [PATCH 2/4] Added Dropbox Kamelet source --- dropbox-source.kamelet.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dropbox-source.kamelet.yaml b/dropbox-source.kamelet.yaml index bfda21c93..7f819dc41 100644 --- a/dropbox-source.kamelet.yaml +++ b/dropbox-source.kamelet.yaml @@ -3,7 +3,7 @@ kind: Kamelet metadata: name: dropbox-source annotations: - camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHg9IjAiIHk9IjAiIHZpZXdCb3g9IjAgMCAyNDguMiAzMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxzdHlsZT4uc3QyOHtmaWxsOiM4YzMxMjN9LnN0Mjl7ZmlsbDojZTA1MjQzfTwvc3R5bGU+PHBhdGggY2xhc3M9InN0MjgiIGQ9Ik0yMCA1Mi4xTDAgNjJ2MTc1LjVsMjAgOS45LjEtLjFWNTIuMmwtLjEtLjEiLz48cGF0aCBjbGFzcz0ic3QyOSIgZD0iTTEyNyAyMjJMMjA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Zz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjQzcHgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDQzIDQwIiB2ZXJzaW9uPSIxLjEiIGhlaWdodD0iNDBweCI+CiA8cGF0aCBkPSJtMTIuNSAwbC0xMi41IDguMSA4LjcgNyAxMi41LTcuOC04LjctNy4zem0tMTIuNSAyMS45bDEyLjUgOC4yIDguNy03LjMtMTIuNS03LjctOC43IDYuOHptMjEuMiAwLjlsOC44IDcuMyAxMi40LTguMS04LjYtNi45LTEyLjYgNy43em0yMS4yLTE0LjdsLTEyLjQtOC4xLTguOCA3LjMgMTIuNiA3LjggOC42LTd6bS0yMS4xIDE2LjNsLTguOCA3LjMtMy43LTIuNXYyLjhsMTIuNSA3LjUgMTIuNS03LjV2LTIuOGwtMy44IDIuNS04LjctNy4zeiIgZmlsbD0iIzAwN0VFNSIvPgo8L3N2Zz4K" camel.apache.org/provider: "Apache Software Foundation" labels: camel.apache.org/kamelet.type: "source" From 4fb572932edbdd3358d6d0c619ab3169c3dbc03e Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Tue, 23 Mar 2021 14:17:24 +0100 Subject: [PATCH 3/4] Added Dropbox Kamelet source --- docs/modules/ROOT/nav.adoc | 1 + docs/modules/ROOT/pages/aws-sqs-fifo-sink.adoc | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index af62f69d6..409915d0b 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -5,6 +5,7 @@ * xref:ROOT:aws-sqs-sink.adoc[image:kamelets/aws-sqs-sink.svg[] AWS SQS Sink] * xref:ROOT:aws-sqs-source.adoc[image:kamelets/aws-sqs-source.svg[] AWS SQS Source] * xref:ROOT:bitcoin-source.adoc[image:kamelets/bitcoin-source.svg[] Bitcoin Source] +* xref:ROOT:dropbox-source.adoc[image:kamelets/dropbox-source.svg[] Dropbox Source] * xref:ROOT:earthquake-source.adoc[image:kamelets/earthquake-source.svg[] Earthquake Source] * xref:ROOT:file-watch-source.adoc[image:kamelets/file-watch-source.svg[] File Watch Source] * xref:ROOT:ftp-source.adoc[image:kamelets/ftp-source.svg[] FTP Source] diff --git a/docs/modules/ROOT/pages/aws-sqs-fifo-sink.adoc b/docs/modules/ROOT/pages/aws-sqs-fifo-sink.adoc index 44eeece92..d83e2d049 100644 --- a/docs/modules/ROOT/pages/aws-sqs-fifo-sink.adoc +++ b/docs/modules/ROOT/pages/aws-sqs-fifo-sink.adoc @@ -12,11 +12,10 @@ The following table summarizes the configuration options available for the `aws- |=== | Property| Name| Description| Type| Default| Example | *accessKey {empty}* *| Access Key| The access key obtained from AWS| string| | -| *messageDeduplicationIdStrategy {empty}* *| Message Deduplication ID Strategy| Strategy for setting the messageDeduplicationId on the message. Can be one of the following options useExchangeId, useContentBasedDeduplication| string| `"useExchangeId"`| -| *messageGroupIdStrategy {empty}* *| Message Group ID Strategy| Strategy for setting the messageGroupId on the message. Can be one of the following options useConstant, useExchangeId, usePropertyValue.| string| `"useExchangeId"`| | *queueNameOrArn {empty}* *| Queue Name| The SQS Queue name or ARN| string| | | *region {empty}* *| AWS Region| The AWS region to connect to| string| | `"eu-west-1"` | *secretKey {empty}* *| Secret Key| The secret key obtained from AWS| string| | +| contentBasedDeduplication| Content-Based Deduplication| Use content-based deduplication (should be enabled in the SQS FIFO queue first)| boolean| `false`| |=== NOTE: Fields marked with ({empty}*) are mandatory. From f24aa91795caff970f0e21e1f995b3ba00ac2e55 Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Tue, 23 Mar 2021 14:17:46 +0100 Subject: [PATCH 4/4] Added Dropbox Kamelet source --- .../assets/images/kamelets/dropbox-source.svg | 4 ++ docs/modules/ROOT/pages/dropbox-source.adoc | 66 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 docs/modules/ROOT/assets/images/kamelets/dropbox-source.svg create mode 100644 docs/modules/ROOT/pages/dropbox-source.adoc diff --git a/docs/modules/ROOT/assets/images/kamelets/dropbox-source.svg b/docs/modules/ROOT/assets/images/kamelets/dropbox-source.svg new file mode 100644 index 000000000..84ac86026 --- /dev/null +++ b/docs/modules/ROOT/assets/images/kamelets/dropbox-source.svg @@ -0,0 +1,4 @@ + + + + diff --git a/docs/modules/ROOT/pages/dropbox-source.adoc b/docs/modules/ROOT/pages/dropbox-source.adoc new file mode 100644 index 000000000..3b1d1c5e6 --- /dev/null +++ b/docs/modules/ROOT/pages/dropbox-source.adoc @@ -0,0 +1,66 @@ +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT += image:kamelets/dropbox-source.svg[] Dropbox Source + +*Provided by: "Apache Software Foundation"* + +Consume Files from Dropbox. + +== Configuration Options + +The following table summarizes the configuration options available for the `dropbox-source` Kamelet: +[width="100%",cols="2,^2,3,^2,^2,^3",options="header"] +|=== +| Property| Name| Description| Type| Default| Example +| *accessToken {empty}* *| Dropbox Access Token| The access Token to use to access Dropbox| string| | +| *clientIdentifier {empty}* *| The client identifier| Dropbox App client Identifier| string| | +| *period {empty}* *| Period between polls| The interval between fetches to the earthquake API in milliseconds| integer| `10000`| +| *remotePath {empty}* *| Remote path| Original file or folder to work with| string| | +| query| Querys| A space-separated list of sub-strings to search for. A file matches only if it contains all the sub-strings. If this option is not set, all files will be matched.| string| | +|=== + +NOTE: Fields marked with ({empty}*) are mandatory. + +== Usage + +This section summarizes how the `dropbox-source` can be used in various contexts. + +=== Knative Source + +The `dropbox-source` Kamelet can be used as Knative source by binding it to a Knative object. + +.dropbox-source-binding.yaml +[source,yaml] +---- +apiVersion: camel.apache.org/v1alpha1 +kind: KameletBinding +metadata: + name: dropbox-source-binding +spec: + source: + ref: + kind: Kamelet + apiVersion: camel.apache.org/v1alpha1 + name: dropbox-source + properties: + accessToken: "The Dropbox Access Token" + clientIdentifier: "The The client identifier" + remotePath: "The Remote path" + 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 `dropbox-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 dropbox-source-binding.yaml +---- +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT