Skip to content

Commit 26ad581

Browse files
authored
doc(Debezium): change examples to full with secrets
1 parent c146c4c commit 26ad581

File tree

18 files changed

+291
-150
lines changed

18 files changed

+291
-150
lines changed

plugin-debezium-db2/src/main/java/io/kestra/plugin/debezium/db2/Capture.java

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,23 @@
2525
@Plugin(
2626
examples = {
2727
@Example(
28-
code = {
29-
"snapshotMode: INITIAL",
30-
"hostname: 127.0.0.1",
31-
"port: \"50000\"",
32-
"username: db2inst1",
33-
"password: my_password",
34-
"database: my_database",
35-
"maxRecords: 100",
36-
}
28+
title = "Capture data from Db2 server."
29+
full = true,
30+
code = """
31+
id: db2_capture
32+
namespace: company.team
33+
34+
tasks:
35+
- id: capture
36+
type: io.kestra.plugin.debezium.db2.Capture
37+
snapshotMode: INITIAL
38+
hostname: 127.0.0.1
39+
port: "50000"
40+
username: "{{ secret('DB2_USERNAME') }}"
41+
password: "{{ secret('DB2_PASSWORD') }}"
42+
database: my_database
43+
maxRecords: 100
44+
"""
3745
)
3846
}
3947
)

plugin-debezium-db2/src/main/java/io/kestra/plugin/debezium/db2/RealtimeTrigger.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
title = "Consume a message from a DB2 database via change data capture in real-time.",
3030
full = true,
3131
code = """
32-
id: debezium-db2
32+
id: debezium_db2
3333
namespace: company.team
3434
3535
tasks:
@@ -41,9 +41,9 @@
4141
- id: realtime
4242
type: io.kestra.plugin.debezium.db2.RealtimeTrigger
4343
hostname: 127.0.0.1
44-
port: 50000
45-
username: db2inst1
46-
password: my_password
44+
port: "50000"
45+
username: "{{ secret('DB2_USERNAME') }}"
46+
password: "{{ secret('DB2_PASSWORD') }}"
4747
database: my_database
4848
"""
4949
)

plugin-debezium-db2/src/main/java/io/kestra/plugin/debezium/db2/Trigger.java

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,28 @@
2929
@Plugin(
3030
examples = {
3131
@Example(
32-
code = {
33-
"snapshotMode: INITIAL",
34-
"hostname: 127.0.0.1",
35-
"port: \"50000\"",
36-
"username: db2inst1",
37-
"password: my_password",
38-
"database: my_database",
39-
"maxRecords: 100",
40-
}
32+
title = "Consume a message from a DB2 database via change data capture periodically.",
33+
full = true,
34+
code = """
35+
id: debezium_db2
36+
namespace: company.team
37+
38+
tasks:
39+
- id: send_data
40+
type: io.kestra.plugin.core.log.Log
41+
message: "{{ trigger.uris }}"
42+
43+
triggers:
44+
- id: trigger
45+
type: io.kestra.plugin.debezium.db2.Trigger
46+
snapshotMode: INITIAL
47+
hostname: 127.0.0.1
48+
port: "50000"
49+
username: "{{ secret('DB2_USERNAME') }}"
50+
password: "{{ secret('DB2_PASSWORD') }}"
51+
database: my_database
52+
maxRecords: 100
53+
"""
4154
)
4255
}
4356
)

plugin-debezium-mongodb/src/main/java/io/kestra/plugin/debezium/mongodb/Capture.java

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,63 @@
2727
examples = {
2828
@Example(
2929
title = "Replica set connection",
30-
code = {
31-
"snapshotMode: INITIAL",
32-
"connectionString: mongodb://mongo_user:mongo_passwd@mongodb0.example.com:27017/?replicaSet=rs0",
33-
"maxRecords: 100"
34-
}
30+
full = true,
31+
code = """
32+
id: mongo_replica_connection
33+
namespace: company.team
34+
35+
tasks:
36+
- id: capture
37+
type: io.kestra.plugin.debezium.mongodb.Capture
38+
snapshotMode: INITIAL
39+
connectionString: "mongodb://mongo_user:{{secret('MONGO_PASSWORD')}}@mongodb0.example.com:27017/?replicaSet=rs0"
40+
maxRecords: 100
41+
"""
3542
),
3643
@Example(
3744
title = "Sharded connection",
38-
code = {
39-
"snapshotMode: INITIAL",
40-
"connectionString: mongodb://mongo_user:mongo_passwd@mongos0.example.com:27017,mongos1.example.com:27017/",
41-
"maxRecords: 100"
42-
}
45+
full = true,
46+
code = """
47+
id: mongo_sharded_connection
48+
namespace: company.team
49+
50+
tasks:
51+
- id: capture
52+
type: io.kestra.plugin.debezium.mongodb.Capture
53+
snapshotMode: INITIAL
54+
connectionString: "mongodb://mongo_user:{{secret('MONGO_PASSWORD')}}@mongos0.example.com:27017,mongos1.example.com:27017/"
55+
maxRecords: 100
56+
"""
4357
),
4458
@Example(
4559
title = "Replica set SRV connection",
46-
code = {
47-
"snapshotMode: INITIAL",
48-
"connectionString: mongodb+srv://mongo_user:mongo_passwd@mongos0.example.com/?replicaSet=rs0",
49-
"maxRecords: 100"
50-
}
60+
full = true,
61+
code = """
62+
id: mongo_replica_srv
63+
namespace: company.team
64+
65+
tasks:
66+
- id: capture
67+
type: io.kestra.plugin.debezium.mongodb.Capture
68+
snapshotMode: INITIAL
69+
connectionString: "mongodb+srv://mongo_user:{{secret('MONGO_PASSWORD')}}@mongos0.example.com/?replicaSet=rs0"
70+
maxRecords: 100
71+
"""
5172
),
5273
@Example(
5374
title = "Sharded SRV connection",
54-
code = {
55-
"snapshotMode: INITIAL",
56-
"connectionString: mongodb+srv://mongo_user:mongo_passwd@mongos0.example.com/",
57-
"maxRecords: 100"
58-
}
75+
full = true,
76+
code = """
77+
id: mongo
78+
namespace: company.team
79+
80+
tasks:
81+
- id: capture
82+
type: io.kestra.plugin.debezium.mongodb.Capture
83+
snapshotMode: INITIAL
84+
connectionString: "mongodb+srv://mongo_user:{{secret('MONGO_PASSWORD')}}@mongos0.example.com/"
85+
maxRecords: 100
86+
"""
5987
)
6088
}
6189
)

plugin-debezium-mongodb/src/main/java/io/kestra/plugin/debezium/mongodb/RealtimeTrigger.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
title = "Sharded connection",
3333
full = true,
3434
code = """
35-
id: debezium-mongodb
35+
id: debezium_mongodb
3636
namespace: company.team
3737
3838
tasks:
@@ -44,14 +44,14 @@
4444
- id: realtime
4545
type: io.kestra.plugin.debezium.mongodb.RealtimeTrigger
4646
snapshotMode: INITIAL
47-
connectionString: mongodb://mongo_user:mongo_passwd@mongos0.example.com:27017,mongos1.example.com:27017/
47+
connectionString: "mongodb://mongo_user:{{secret('MONGO_PASSWORD')}}@mongos0.example.com:27017,mongos1.example.com:27017/"
4848
"""
4949
),
5050
@Example(
5151
title = "Replica set connection",
5252
full = true,
5353
code = """
54-
id: debezium-mongodb
54+
id: debezium_mongodb
5555
namespace: company.team
5656
5757
tasks:
@@ -63,7 +63,7 @@
6363
- id: realtime
6464
type: io.kestra.plugin.debezium.mongodb.RealtimeTrigger
6565
snapshotMode: INITIAL
66-
connectionString: mongodb://mongo_user:mongo_passwd@mongodb0.example.com:27017/?replicaSet=rs0
66+
connectionString: "mongodb://mongo_user:{{secret('MONGO_PASSWORD')}}@mongodb0.example.com:27017/?replicaSet=rs0"
6767
"""
6868
)
6969
}

plugin-debezium-mongodb/src/main/java/io/kestra/plugin/debezium/mongodb/Trigger.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,38 +35,38 @@
3535
title = "Sharded connection",
3636
full = true,
3737
code = """
38-
id: debezium-mongodb
38+
id: debezium_mongodb
3939
namespace: company.team
4040
4141
tasks:
4242
- id: send_data
4343
type: io.kestra.plugin.core.log.Log
44-
message: "{{ trigger.data }}"
44+
message: "{{ trigger.uris }}"
4545
4646
triggers:
4747
- id: trigger
4848
type: io.kestra.plugin.debezium.mongodb.Trigger
4949
snapshotMode: INITIAL
50-
connectionString: mongodb://mongo_user:mongo_passwd@mongos0.example.com:27017,mongos1.example.com:27017/
50+
connectionString: "mongodb://mongo_user:{{secret('MONGO_PASSWORD')}}@mongos0.example.com:27017,mongos1.example.com:27017/"
5151
"""
5252
),
5353
@Example(
5454
title = "Replica set connection",
5555
full = true,
5656
code = """
57-
id: debezium-mongodb
57+
id: debezium_mongodb
5858
namespace: company.team
5959
6060
tasks:
6161
- id: send_data
6262
type: io.kestra.plugin.core.log.Log
63-
message: "{{ trigger.data }}"
63+
message: "{{ trigger.uris }}"
6464
6565
triggers:
6666
- id: trigger
6767
type: io.kestra.plugin.debezium.mongodb.Trigger
6868
snapshotMode: INITIAL
69-
connectionString: mongodb://mongo_user:mongo_passwd@mongodb0.example.com:27017/?replicaSet=rs0
69+
connectionString: "mongodb://mongo_user:{{secret('MONGO_PASSWORD')}}@mongodb0.example.com:27017/?replicaSet=rs0"
7070
"""
7171
)
7272
}

plugin-debezium-mysql/src/main/java/io/kestra/plugin/debezium/mysql/Capture.java

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,22 @@
2626
@Plugin(
2727
examples = {
2828
@Example(
29-
code = {
30-
"snapshotMode: NEVER",
31-
"hostname: 127.0.0.1",
32-
"port: \"3306\"",
33-
"username: mysql_user",
34-
"password: mysql_passwd",
35-
"maxRecords: 100",
36-
}
29+
title = "Capture data on MySQL server.",
30+
full = true,
31+
code = """
32+
id: mysql_capture
33+
namespace: company.team
34+
35+
tasks:
36+
- id: capture
37+
type: io.kestra.plugin.debezium.mysql.Capture
38+
snapshotMode: NEVER
39+
hostname: 127.0.0.1
40+
port: "3306"
41+
username: "{{ secret('MYSQL_USERNAME') }}"
42+
password: "{{ secret('MYSQL_PASSWORD') }}"
43+
maxRecords: 100
44+
"""
3745
)
3846
}
3947
)

plugin-debezium-mysql/src/main/java/io/kestra/plugin/debezium/mysql/RealtimeTrigger.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
title = "Consume a message from a MySQL database via change data capture in real-time.",
3030
full = true,
3131
code = """
32-
id: debezium-mysql
32+
id: debezium_mysql
3333
namespace: company.team
3434
3535
tasks:
@@ -40,11 +40,12 @@
4040
triggers:
4141
- id: realtime
4242
type: io.kestra.plugin.debezium.mysql.RealtimeTrigger
43-
serverId: 123456789
43+
serverId: "123456789"
4444
hostname: 127.0.0.1
45-
port: 63306
46-
username: mysql_user
47-
password: mysql_passwd"""
45+
port: "3306"
46+
username: "{{ secret('MYSQL_USERNAME') }}"
47+
password: "{{ secret('MYSQL_PASSWORD') }}"
48+
"""
4849
)
4950
}
5051
)

plugin-debezium-mysql/src/main/java/io/kestra/plugin/debezium/mysql/Trigger.java

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,26 @@
2929
@Plugin(
3030
examples = {
3131
@Example(
32-
code = {
33-
"snapshotMode: NEVER",
34-
"hostname: 127.0.0.1",
35-
"port: \"3306\"",
36-
"username: mysql_user",
37-
"password: mysql_passwd",
38-
"maxRecords: 100",
39-
}
32+
title = "Consume a message from a MySQL database via change data capture periodically.",
33+
full = true,
34+
code = """
35+
id: debezium_mysql
36+
namespace: company.team
37+
38+
tasks:
39+
- id: send_data
40+
type: io.kestra.plugin.core.log.Log
41+
message: "{{ trigger.uris }}"
42+
43+
triggers:
44+
- id: trigger
45+
type: io.kestra.plugin.debezium.mysql.RealtimeTrigger
46+
snapshotMode: NEVER
47+
hostname: 127.0.0.1
48+
port: "3306"
49+
username: "{{ secret('MYSQL_USERNAME') }}"
50+
password: "{{ secret('MYSQL_PASSWORD') }}"
51+
"""
4052
)
4153
}
4254
)

0 commit comments

Comments
 (0)