blob: 5a1a3d4e9f4ddcf279697a39d491f8eb01585a7b [file] [log] [blame]
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
- query
properties:
period:
title: Period between polls
description: The interval between fetches to the Dropbox remote path 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}
- to-d: "dropbox:get?accessToken={{accessToken}}&clientIdentifier={{clientIdentifier}}&remotePath=${exchangeProperty.dropboxFileName}"
- to: "kamelet:sink"
- to-d: "dropbox:del?accessToken={{accessToken}}&clientIdentifier={{clientIdentifier}}&remotePath=${exchangeProperty.dropboxFileName}"