-
Notifications
You must be signed in to change notification settings - Fork 26
/
aws-redshift-source.kamelet.yaml
114 lines (114 loc) · 4.64 KB
/
aws-redshift-source.kamelet.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------
apiVersion: camel.apache.org/v1
kind: Kamelet
metadata:
name: aws-redshift-source
annotations:
camel.apache.org/kamelet.support.level: "Stable"
camel.apache.org/catalog.version: "2.3.0"
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAxNjE1IDE3ODMuNyIgdmlld0JveD0iMCAwIDE2MTUgMTc4My43IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Im04MDcuNSAxMzYzLjggNjc4LjMgMTYxLjV2LTEyNzAuNWwtNjc4LjMgMTYxLjV6IiBmaWxsPSIjMjA1Yjk3Ii8+PHBhdGggZD0ibTE0ODUuOCAyNTQuOCAxMjkuMiA2NC42djExNDEuM2wtMTI5LjIgNjQuNnptLTY3OC4zIDExMDktNjc4LjMgMTYxLjV2LTEyNzAuNWw2NzguMyAxNjEuNXoiIGZpbGw9IiM1MTkzY2UiLz48cGF0aCBkPSJtMTI5LjIgMjU0LjgtMTI5LjIgNjQuNnYxMTQxLjNsMTI5LjIgNjQuNnoiIGZpbGw9IiMyMDViOTciLz48cGF0aCBkPSJtOTc5LjggMTc4My43IDI1OC40LTEyOS4ydi0xNTI1LjNsLTI1OC40LTEyOS4yLTc5IDg0N3oiIGZpbGw9IiM1MTkzY2UiLz48cGF0aCBkPSJtNjM1LjIgMTc4My43LTI1OC40LTEyOS4ydi0xNTI1LjNsMjU4LjQtMTI5LjIgNzkgODQ3eiIgZmlsbD0iIzIwNWI5NyIvPjxwYXRoIGQ9Im02MzUuMiAwaDM0OC4xdjE3ODAuMWgtMzQ4LjF6IiBmaWxsPSIjMmU3M2I3Ii8+PC9zdmc+"
camel.apache.org/provider: "Red Hat"
camel.apache.org/kamelet.group: "AWS Redshift"
camel.apache.org/kamelet.namespace: "AWS"
labels:
camel.apache.org/kamelet.type: "source"
spec:
definition:
title: "AWS Redshift Source"
description: |-
Query data from an AWS RedShift Database.
required:
- serverName
- username
- password
- query
- databaseName
type: object
properties:
serverName:
title: Server Name
description: The server name for the data source.
type: string
example: localhost
serverPort:
title: Server Port
description: The server port for the data source.
type: string
default: 5439
username:
title: Username
description: The username to access a secured AWS RedShift Database.
type: string
x-descriptors:
- urn:camel:group:credentials
password:
title: Password
description: The password to access a secured AWS RedShift Database.
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
- urn:camel:group:credentials
query:
title: Query
description: The query to execute against the AWS RedShift Database.
type: string
example: 'INSERT INTO accounts (username,city) VALUES (:#username,:#city)'
databaseName:
title: Database Name
description: The name of the AWS RedShift Database.
type: string
consumedQuery:
title: Consumed Query
description: A query to run on a tuple consumed.
type: string
example: 'DELETE FROM accounts where user_id = :#user_id'
delay:
title: Delay
description: The number of milliseconds before the next poll from the AWS RedShift database.
type: integer
default: 500
types:
out:
mediaType: application/json
dependencies:
- "camel:jackson"
- "camel:kamelet"
- "camel:sql"
- "mvn:com.amazon.redshift:redshift-jdbc42:2.1.0.18"
- "mvn:org.apache.commons:commons-dbcp2:2.10.0"
template:
beans:
- name: dsBean
type: "#class:org.apache.commons.dbcp2.BasicDataSource"
properties:
username: '{{username}}'
password: '{{password}}'
url: 'jdbc:redshift://{{serverName}}:{{serverPort}}/{{databaseName}}'
driverClassName: 'com.amazon.redshift.jdbc.Driver'
from:
uri: "sql:{{query}}"
parameters:
dataSource: "#bean:{{dsBean}}"
onConsume: "{{?consumedQuery}}"
delay: "{{delay}}"
steps:
- marshal:
json:
library: Jackson
- to: "kamelet:sink"