-
Notifications
You must be signed in to change notification settings - Fork 26
/
mariadb-sink.kamelet.yaml
98 lines (92 loc) · 10.3 KB
/
mariadb-sink.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
apiVersion: camel.apache.org/v1
kind: Kamelet
metadata:
name: mariadb-sink
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,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBoZWlnaHQ9IjExOC4xIiB2aWV3Qm94PSIwLDAsNDE2LjQsMTE4LjEiIHdpZHRoPSI0MTYuNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KIDxtZXRhZGF0YS8+CiA8c3dpdGNoIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMy45MSAtMjMuOTUpIj4KICA8Zm9yZWlnbk9iamVjdCBoZWlnaHQ9IjEiIHJlcXVpcmVkRXh0ZW5zaW9ucz0iaHR0cDovL25zLmFkb2JlLmNvbS9BZG9iZUlsbHVzdHJhdG9yLzEwLjAvIiB3aWR0aD0iMSIvPgogIDxnPgogICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTYxNCAtMTQuMTgpIj4KICAgIDxwYXRoIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTE4MTIgMzguMTNjLTIuNzMuMDktMS45NCAxLjMyLTcuODUgMi43OC01Ljk3IDEuNDctMTMuMTkuNTctMTkuNjEgMy4yNy0xNi44IDcuMDQtMTkuNTIgMzQuMjYtMzkuNTMg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UyaDIuNDFjMy42OCAwIDYuNDMtLjU5IDguMjMtMS43NiAxLjgtMS4xOCAyLjctMy4wMiAyLjctNS41MyAwLTQuMTUtMi44Mi02LjIzLTguNDctNi4yM3ptMCAxNy43NnYxNi4yMmg1LjIzYzMuMDIgMCA1LjIzLS4yOSA2LjY0LS44OCAxLjQ1LS42MyAyLjYzLTEuNTcgMy41My0yLjgyLjktMS4yOSAxLjM1LTIuNjEgMS4zNS0zLjk0cy0uMjUtMi41MS0uNzYtMy41My0xLjI3LTEuOTItMi4yOS0yLjdjLS45OC0uNzgtMi4xOC0xLjM3LTMuNTktMS43Ni0xLjM3LS4zOS0zLjk2LS41OS03Ljc2LS41OXoiIGZpbGw9IiMxZjMwNWYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC04My4zMiA5Mi41NSkiLz4KICA8L2c+CiA8L3N3aXRjaD4KPC9zdmc+Cg=="
camel.apache.org/provider: "Red Hat"
camel.apache.org/kamelet.group: "SQL"
camel.apache.org/kamelet.namespace: "Database"
labels:
camel.apache.org/kamelet.type: "sink"
spec:
definition:
title: "MariaDB Sink"
description: |-
Send data to a MariaDB Database.
In your Pipe file, you must explicitly declare the MariaDB Server driver dependency in spec->integration->dependencies.
- "mvn:org.mariadb.jdbc:mariadb-java-client:<version>"
This Kamelet expects a JSON-formatted body. Use key:value pairs to map the JSON fields and parameters. For example, here is a query:
'INSERT INTO accounts (username,city) VALUES (:#username,:#city)'
Here is example input for the example query:
'{ "username":"oscerd", "city":"Rome"}'
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: 3306
username:
title: Username
description: The username to access a secured MariaDB Database.
type: string
x-descriptors:
- urn:camel:group:credentials
password:
title: Password
description: The password to access a secured MariaDB 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 MariaDB Database.
type: string
example: 'INSERT INTO accounts (username,city) VALUES (:#username,:#city)'
databaseName:
title: Database Name
description: The name of the MariaDB Database.
type: string
types:
in:
mediaType: application/json
dependencies:
- "camel:jackson"
- "camel:kamelet"
- "camel:sql"
- "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:mariadb://{{serverName}}:{{serverPort}}/{{databaseName}}'
driverClassName: 'org.mariadb.jdbc.Driver'
from:
uri: "kamelet:source"
steps:
- unmarshal:
json:
library: Jackson
- to:
uri: "sql:{{query}}"
parameters:
dataSource: "#bean:{{dsBean}}"