Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropbox Kamelet Source #80

Merged
merged 4 commits into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/modules/ROOT/assets/images/kamelets/dropbox-source.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 1 addition & 2 deletions docs/modules/ROOT/pages/aws-sqs-fifo-sink.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
66 changes: 66 additions & 0 deletions docs/modules/ROOT/pages/dropbox-source.adoc
Original file line number Diff line number Diff line change
@@ -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
66 changes: 66 additions & 0 deletions dropbox-source.kamelet.yaml
Original file line number Diff line number Diff line change
@@ -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,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjQzcHgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDQzIDQwIiB2ZXJzaW9uPSIxLjEiIGhlaWdodD0iNDBweCI+CiA8cGF0aCBkPSJtMTIuNSAwbC0xMi41IDguMSA4LjcgNyAxMi41LTcuOC04LjctNy4zem0tMTIuNSAyMS45bDEyLjUgOC4yIDguNy03LjMtMTIuNS03LjctOC43IDYuOHptMjEuMiAwLjlsOC44IDcuMyAxMi40LTguMS04LjYtNi45LTEyLjYgNy43em0yMS4yLTE0LjdsLTEyLjQtOC4xLTguOCA3LjMgMTIuNiA3LjggOC42LTd6bS0yMS4xIDE2LjNsLTguOCA3LjMtMy43LTIuNXYyLjhsMTIuNSA3LjUgMTIuNS03LjV2LTIuOGwtMy44IDIuNS04LjctNy4zeiIgZmlsbD0iIzAwN0VFNSIvPgo8L3N2Zz4K"
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}"