-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathcli-definition.json
More file actions
279 lines (279 loc) · 10.2 KB
/
cli-definition.json
File metadata and controls
279 lines (279 loc) · 10.2 KB
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
{
"name": "pgstream",
"commands": [
{
"name": "destroy",
"short": "It destroys any pgstream setup, removing the replication slot and all the relevant tables/functions/triggers, along with the internal pgstream schema",
"use": "destroy",
"example": "\n\tpgstream destroy --postgres-url <source-postgres-url> --replication-slot <replication-slot-name>\n\tpgstream destroy -c config.yaml\n\tpgstream destroy -c config.env",
"flags": [
{
"name": "migrations-only",
"description": "Whether to only revert the database migrations",
"default": "false"
},
{
"name": "postgres-url",
"description": "Source postgres URL where pgstream destroy will be run",
"default": ""
},
{
"name": "replication-slot",
"description": "Name of the postgres replication slot to be deleted by pgstream from the source url",
"default": ""
},
{
"name": "with-injector",
"description": "Whether to also destroy the injector related database objects",
"default": "false"
}
],
"subcommands": [],
"args": []
},
{
"name": "init",
"short": "Initialises pgstream, creating the replication slot and the relevant tables/functions/triggers under the configured internal pgstream schema",
"use": "init",
"example": "\n\tpgstream init --postgres-url <source-postgres-url> --replication-slot <replication-slot-name>\n\tpgstream init -c config.yaml\n\tpgstream init -c config.env",
"flags": [
{
"name": "migrations-only",
"description": "Whether to only run the initialization database migrations",
"default": "false"
},
{
"name": "postgres-url",
"description": "Source postgres URL where pgstream setup will be run",
"default": ""
},
{
"name": "replication-slot",
"description": "Name of the postgres replication slot to be created by pgstream on the source url",
"default": ""
},
{
"name": "with-injector",
"description": "Whether to initialise pgstream with the injector database migrations",
"default": "false"
}
],
"subcommands": [],
"args": []
},
{
"name": "run",
"short": "Run starts a continuous data stream from the configured source to the configured target",
"use": "run",
"example": "\n\tpgstream run --source postgres --source-url <source-postgres-url> --target postgres --target-url <target-postgres-url> --init\n\tpgstream run --source postgres --source-url <source-postgres-url> --target postgres --target-url <target-postgres-url> --snapshot-tables <schema.table> --reset\n\tpgstream run --source kafka --source-url <kafka-url> --target elasticsearch --target-url <elasticsearch-url>\n\tpgstream run --source postgres --source-url <postgres-url> --target kafka --target-url <kafka-url>\n\tpgstream run --config config.yaml --log-level info\n\tpgstream run --config config.env",
"flags": [
{
"name": "dump-file",
"description": "File where the pg_dump output will be written if initial snapshot is enabled",
"default": ""
},
{
"name": "init",
"description": "Whether to initialize pgstream before starting replication",
"default": "false"
},
{
"name": "profile",
"description": "Whether to expose a /debug/pprof endpoint on localhost:6060",
"default": "false"
},
{
"name": "replication-slot",
"description": "Name of the postgres replication slot for pgstream to connect to",
"default": ""
},
{
"name": "reset",
"description": "Whether to reset the target before snapshotting (only for postgres target)",
"default": "false"
},
{
"name": "snapshot-tables",
"description": "List of tables to snapshot if initial snapshot is required, in the format <schema>.<table>. If not specified, the schema `public` will be assumed. Wildcards are supported",
"default": "[]"
},
{
"name": "source",
"description": "Source type. One of postgres, kafka",
"default": ""
},
{
"name": "source-url",
"description": "Source URL",
"default": ""
},
{
"name": "target",
"description": "Target type. One of postgres, opensearch, elasticsearch, kafka",
"default": ""
},
{
"name": "target-url",
"description": "Target URL",
"default": ""
},
{
"name": "with-injector",
"description": "Whether to enable the injection of pgstream metadata to the WAL events. Required for search targets.",
"default": "false"
}
],
"subcommands": [],
"args": []
},
{
"name": "snapshot",
"short": "Snapshot performs a snapshot of the configured source Postgres database into the configured target",
"use": "snapshot",
"example": "\n\tpgstream snapshot --postgres-url <postgres-url> --target postgres --target-url <target-url> --tables <schema.table> --reset\n\tpgstream snapshot --config config.yaml --log-level info\n\tpgstream snapshot --config config.env",
"flags": [
{
"name": "dump-file",
"description": "File where the pg_dump output will be written",
"default": ""
},
{
"name": "postgres-url",
"description": "Source postgres database to perform the snapshot from",
"default": ""
},
{
"name": "profile",
"description": "Whether to produce CPU and memory profile files, as well as exposing a /debug/pprof endpoint on localhost:6060",
"default": "false"
},
{
"name": "reset",
"description": "Whether to reset the target before snapshotting (only for postgres target)",
"default": "false"
},
{
"name": "tables",
"description": "List of tables to snapshot, in the format <schema>.<table>. If not specified, the schema `public` will be assumed. Wildcards are supported",
"default": "[]"
},
{
"name": "target",
"description": "Target type. One of postgres, opensearch, elasticsearch, kafka",
"default": ""
},
{
"name": "target-url",
"description": "Target URL",
"default": ""
}
],
"subcommands": [],
"args": []
},
{
"name": "status",
"short": "Checks the status of pgstream initialisation and provided configuration",
"use": "status",
"example": "\n\tpgstream status -c pg2pg.env\n\tpgstream status --postgres-url <postgres-url> --replication-slot <replication-slot-name>\n\tpgstream status -c pg2pg.yaml --json\n\t",
"flags": [
{
"name": "json",
"description": "Output the status in JSON format",
"default": "false"
},
{
"name": "postgres-url",
"description": "Source postgres URL where pgstream has been initialised",
"default": ""
},
{
"name": "replication-slot",
"description": "Name of the postgres replication slot created by pgstream on the source url",
"default": ""
}
],
"subcommands": [],
"args": []
},
{
"name": "tear-down",
"short": "tear-down is deprecated, please use destroy",
"use": "tear-down",
"example": "\n\tpgstream tear-down --postgres-url <source-postgres-url> --replication-slot <replication-slot-name>\n\tpgstream tear-down -c config.yaml\n\tpgstream tear-down -c config.env",
"flags": [
{
"name": "migrations-only",
"description": "Whether to only revert the database migrations",
"default": "false"
},
{
"name": "postgres-url",
"description": "Source postgres URL where pgstream tear down will be run",
"default": ""
},
{
"name": "replication-slot",
"description": "Name of the postgres replication slot to be deleted by pgstream from the source url",
"default": ""
},
{
"name": "with-injector",
"description": "Whether to also tear down the injector related database objects",
"default": "false"
}
],
"subcommands": [],
"args": []
},
{
"name": "validate",
"short": "Validate different parts of the pgstream configuration",
"use": "validate",
"example": "",
"flags": [],
"subcommands": [
{
"name": "rules",
"short": "Validates transformation rules against the provided Postgres database",
"use": "rules",
"example": "\n\tpgstream validate rules -c pg2pg.env\n\tpgstream validate rules --postgres-url <postgres-url> --rules-file rules.yaml\n\tpgstream validate rules -c pg2pg.yaml --json\n\t",
"flags": [
{
"name": "json",
"description": "Output the validation status in JSON format",
"default": "false"
},
{
"name": "postgres-url",
"description": "Source postgres URL to validate the rules against",
"default": ""
},
{
"name": "rules-file",
"shorthand": "f",
"description": "Path to a YAML file containing the transformation rules to validate",
"default": ""
}
],
"subcommands": [],
"args": []
}
],
"args": []
}
],
"flags": [
{
"name": "config",
"shorthand": "c",
"description": ".env or .yaml config file to use with pgstream if any",
"default": ""
},
{
"name": "log-level",
"description": "log level for the application. One of trace, debug, info, warn, error, fatal, panic",
"default": "debug"
}
]
}