fivetran-cli 0.1.9__tar.gz → 0.1.11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of fivetran-cli might be problematic. Click here for more details.
- {fivetran_cli-0.1.9/src/fivetran_cli.egg-info → fivetran_cli-0.1.11}/PKG-INFO +31 -9
- {fivetran_cli-0.1.9 → fivetran_cli-0.1.11}/README.md +30 -8
- {fivetran_cli-0.1.9 → fivetran_cli-0.1.11}/pyproject.toml +1 -1
- {fivetran_cli-0.1.9 → fivetran_cli-0.1.11}/src/fivetran_cli/cli.py +89 -16
- fivetran_cli-0.1.11/src/fivetran_cli/output.py +575 -0
- fivetran_cli-0.1.11/src/fivetran_cli/views.py +123 -0
- {fivetran_cli-0.1.9 → fivetran_cli-0.1.11/src/fivetran_cli.egg-info}/PKG-INFO +31 -9
- {fivetran_cli-0.1.9 → fivetran_cli-0.1.11}/src/fivetran_cli.egg-info/SOURCES.txt +1 -0
- {fivetran_cli-0.1.9 → fivetran_cli-0.1.11}/tests/test_cli.py +82 -15
- {fivetran_cli-0.1.9 → fivetran_cli-0.1.11}/tests/test_client.py +3 -0
- fivetran_cli-0.1.11/tests/test_output.py +199 -0
- fivetran_cli-0.1.9/src/fivetran_cli/output.py +0 -201
- fivetran_cli-0.1.9/tests/test_output.py +0 -61
- {fivetran_cli-0.1.9 → fivetran_cli-0.1.11}/LICENSE +0 -0
- {fivetran_cli-0.1.9 → fivetran_cli-0.1.11}/MANIFEST.in +0 -0
- {fivetran_cli-0.1.9 → fivetran_cli-0.1.11}/setup.cfg +0 -0
- {fivetran_cli-0.1.9 → fivetran_cli-0.1.11}/src/fivetran_cli/__init__.py +0 -0
- {fivetran_cli-0.1.9 → fivetran_cli-0.1.11}/src/fivetran_cli/__main__.py +0 -0
- {fivetran_cli-0.1.9 → fivetran_cli-0.1.11}/src/fivetran_cli/client.py +0 -0
- {fivetran_cli-0.1.9 → fivetran_cli-0.1.11}/src/fivetran_cli.egg-info/dependency_links.txt +0 -0
- {fivetran_cli-0.1.9 → fivetran_cli-0.1.11}/src/fivetran_cli.egg-info/requires.txt +0 -0
- {fivetran_cli-0.1.9 → fivetran_cli-0.1.11}/src/fivetran_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fivetran-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.11
|
|
4
4
|
Summary: Command line wrapper for the Fivetran REST API and Connector SDK
|
|
5
5
|
Author: Fivetran
|
|
6
6
|
License-Expression: MIT
|
|
@@ -41,7 +41,7 @@ Credentials default to `FIVETRAN_API_KEY`. Set it to the single Base64-encoded A
|
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
43
|
fivetran --api-key "$FIVETRAN_API_KEY" connection list
|
|
44
|
-
fivetran connection create --
|
|
44
|
+
fivetran connection create --config-file connection.json
|
|
45
45
|
fivetran deploy
|
|
46
46
|
```
|
|
47
47
|
|
|
@@ -56,18 +56,38 @@ fivetran connector-metadata get google_ads
|
|
|
56
56
|
fivetran public-connector list
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
Output defaults to
|
|
59
|
+
Output defaults to readable text: list responses render as aligned, color-coded
|
|
60
|
+
tables and detail responses as aligned key/value sections. Use `--output json`
|
|
61
|
+
for compact JSON for scripting. Flag and config conventions follow the dbt CLI.
|
|
60
62
|
|
|
61
63
|
```bash
|
|
62
|
-
fivetran connection list
|
|
63
|
-
fivetran connection get connection_id
|
|
64
|
+
fivetran connection list # default text table
|
|
65
|
+
fivetran connection get connection_id # default text detail
|
|
66
|
+
fivetran connection list --output json # compact JSON
|
|
64
67
|
```
|
|
65
68
|
|
|
66
|
-
|
|
69
|
+
Output options (each with a `FIVETRAN_*` env override where noted):
|
|
70
|
+
|
|
71
|
+
| Flag | Env | Effect |
|
|
72
|
+
|------|-----|--------|
|
|
73
|
+
| `--output {text,json}` | `FIVETRAN_OUTPUT` | Output format (default `text`) |
|
|
74
|
+
| `--output-file PATH` | — | Write rendered output to a file |
|
|
75
|
+
| `--use-colors` / `--no-use-colors` | `FIVETRAN_USE_COLORS` | Toggle ANSI color (default on) |
|
|
76
|
+
| `--printer-width N` | `FIVETRAN_PRINTER_WIDTH` | Wrap/truncation width (default terminal width) |
|
|
77
|
+
| `--wide` | — | Show all non-sensitive fields/columns, no truncation |
|
|
78
|
+
| `--fields a,b,c` | — | Explicit fields/columns to show |
|
|
79
|
+
|
|
80
|
+
Curated resources (connection, destination, group, user, team, webhook,
|
|
81
|
+
transformation) show a focused set of columns by default; everything else is
|
|
82
|
+
shown with `--wide` or `--output json`. Sensitive values (passwords, secrets,
|
|
83
|
+
tokens, API/private keys, and exact `key` fields) are always redacted in text
|
|
84
|
+
output.
|
|
85
|
+
|
|
86
|
+
Create and update commands accept configuration as inline JSON or a JSON file:
|
|
67
87
|
|
|
68
88
|
```bash
|
|
69
|
-
fivetran private-link create --
|
|
70
|
-
fivetran connection-schema column update connection_id schema table column --
|
|
89
|
+
fivetran private-link create --config-file private-link.json
|
|
90
|
+
fivetran connection-schema column update connection_id schema table column --config '{"enabled":false}'
|
|
71
91
|
```
|
|
72
92
|
|
|
73
93
|
Destructive commands require `--yes` in non-interactive mode.
|
|
@@ -149,4 +169,6 @@ The remaining gaps are intentionally limited to endpoints that need behavior bey
|
|
|
149
169
|
- Hub registration
|
|
150
170
|
- Group destination listing, pending confirmation of a supported REST endpoint
|
|
151
171
|
- Interactive connector setup workflows
|
|
152
|
-
-
|
|
172
|
+
- Curated table/detail views for the long tail of resources (connection,
|
|
173
|
+
destination, group, user, team, webhook, and transformation are curated today;
|
|
174
|
+
the rest use the generic all-columns-capped fallback)
|
|
@@ -24,7 +24,7 @@ Credentials default to `FIVETRAN_API_KEY`. Set it to the single Base64-encoded A
|
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
26
|
fivetran --api-key "$FIVETRAN_API_KEY" connection list
|
|
27
|
-
fivetran connection create --
|
|
27
|
+
fivetran connection create --config-file connection.json
|
|
28
28
|
fivetran deploy
|
|
29
29
|
```
|
|
30
30
|
|
|
@@ -39,18 +39,38 @@ fivetran connector-metadata get google_ads
|
|
|
39
39
|
fivetran public-connector list
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
Output defaults to
|
|
42
|
+
Output defaults to readable text: list responses render as aligned, color-coded
|
|
43
|
+
tables and detail responses as aligned key/value sections. Use `--output json`
|
|
44
|
+
for compact JSON for scripting. Flag and config conventions follow the dbt CLI.
|
|
43
45
|
|
|
44
46
|
```bash
|
|
45
|
-
fivetran connection list
|
|
46
|
-
fivetran connection get connection_id
|
|
47
|
+
fivetran connection list # default text table
|
|
48
|
+
fivetran connection get connection_id # default text detail
|
|
49
|
+
fivetran connection list --output json # compact JSON
|
|
47
50
|
```
|
|
48
51
|
|
|
49
|
-
|
|
52
|
+
Output options (each with a `FIVETRAN_*` env override where noted):
|
|
53
|
+
|
|
54
|
+
| Flag | Env | Effect |
|
|
55
|
+
|------|-----|--------|
|
|
56
|
+
| `--output {text,json}` | `FIVETRAN_OUTPUT` | Output format (default `text`) |
|
|
57
|
+
| `--output-file PATH` | — | Write rendered output to a file |
|
|
58
|
+
| `--use-colors` / `--no-use-colors` | `FIVETRAN_USE_COLORS` | Toggle ANSI color (default on) |
|
|
59
|
+
| `--printer-width N` | `FIVETRAN_PRINTER_WIDTH` | Wrap/truncation width (default terminal width) |
|
|
60
|
+
| `--wide` | — | Show all non-sensitive fields/columns, no truncation |
|
|
61
|
+
| `--fields a,b,c` | — | Explicit fields/columns to show |
|
|
62
|
+
|
|
63
|
+
Curated resources (connection, destination, group, user, team, webhook,
|
|
64
|
+
transformation) show a focused set of columns by default; everything else is
|
|
65
|
+
shown with `--wide` or `--output json`. Sensitive values (passwords, secrets,
|
|
66
|
+
tokens, API/private keys, and exact `key` fields) are always redacted in text
|
|
67
|
+
output.
|
|
68
|
+
|
|
69
|
+
Create and update commands accept configuration as inline JSON or a JSON file:
|
|
50
70
|
|
|
51
71
|
```bash
|
|
52
|
-
fivetran private-link create --
|
|
53
|
-
fivetran connection-schema column update connection_id schema table column --
|
|
72
|
+
fivetran private-link create --config-file private-link.json
|
|
73
|
+
fivetran connection-schema column update connection_id schema table column --config '{"enabled":false}'
|
|
54
74
|
```
|
|
55
75
|
|
|
56
76
|
Destructive commands require `--yes` in non-interactive mode.
|
|
@@ -132,4 +152,6 @@ The remaining gaps are intentionally limited to endpoints that need behavior bey
|
|
|
132
152
|
- Hub registration
|
|
133
153
|
- Group destination listing, pending confirmation of a supported REST endpoint
|
|
134
154
|
- Interactive connector setup workflows
|
|
135
|
-
-
|
|
155
|
+
- Curated table/detail views for the long tail of resources (connection,
|
|
156
|
+
destination, group, user, team, webhook, and transformation are curated today;
|
|
157
|
+
the rest use the generic all-columns-capped fallback)
|
|
@@ -45,8 +45,17 @@ GLOBAL_OPTIONS_WITH_VALUES = {
|
|
|
45
45
|
"--profile",
|
|
46
46
|
"--base-url",
|
|
47
47
|
"--output",
|
|
48
|
+
"--output-file",
|
|
49
|
+
"--printer-width",
|
|
50
|
+
"--fields",
|
|
51
|
+
}
|
|
52
|
+
GLOBAL_FLAG_OPTIONS = {
|
|
53
|
+
"--quiet",
|
|
54
|
+
"--verbose",
|
|
55
|
+
"--wide",
|
|
56
|
+
"--use-colors",
|
|
57
|
+
"--no-use-colors",
|
|
48
58
|
}
|
|
49
|
-
GLOBAL_FLAG_OPTIONS = {"--pretty", "--quiet", "--verbose"}
|
|
50
59
|
OPERATION_EPILOG = (
|
|
51
60
|
"Credentials default to FIVETRAN_API_KEY, which should contain the Base64-encoded API key. "
|
|
52
61
|
"FIVETRAN_BASE_URL overrides the default API base URL. "
|
|
@@ -121,9 +130,14 @@ def run(
|
|
|
121
130
|
emit_output(
|
|
122
131
|
payload,
|
|
123
132
|
output_format=output_format,
|
|
124
|
-
output_path=args.
|
|
133
|
+
output_path=args.output_file,
|
|
125
134
|
quiet=args.quiet,
|
|
126
135
|
stdout=stdout,
|
|
136
|
+
view_key=(getattr(args, "resource", None), getattr(args, "operation", None)),
|
|
137
|
+
color=_use_color(args),
|
|
138
|
+
width=_printer_width(args),
|
|
139
|
+
wide=args.wide,
|
|
140
|
+
fields=_fields(args),
|
|
127
141
|
)
|
|
128
142
|
return 0
|
|
129
143
|
except CliError as exc:
|
|
@@ -181,8 +195,37 @@ def _add_global_options(parser: argparse.ArgumentParser) -> None:
|
|
|
181
195
|
"--base-url",
|
|
182
196
|
help="Fivetran API base URL. Defaults to FIVETRAN_BASE_URL or https://api.fivetran.com.",
|
|
183
197
|
)
|
|
184
|
-
parser.add_argument(
|
|
185
|
-
|
|
198
|
+
parser.add_argument(
|
|
199
|
+
"--output",
|
|
200
|
+
choices=("text", "json"),
|
|
201
|
+
default=None,
|
|
202
|
+
help="Output format. Defaults to FIVETRAN_OUTPUT or 'text'.",
|
|
203
|
+
)
|
|
204
|
+
parser.add_argument(
|
|
205
|
+
"--output-file",
|
|
206
|
+
help="Write rendered output to a path instead of stdout.",
|
|
207
|
+
)
|
|
208
|
+
parser.add_argument(
|
|
209
|
+
"--use-colors",
|
|
210
|
+
action=argparse.BooleanOptionalAction,
|
|
211
|
+
default=None,
|
|
212
|
+
help="Colorize text output. Defaults to FIVETRAN_USE_COLORS or on.",
|
|
213
|
+
)
|
|
214
|
+
parser.add_argument(
|
|
215
|
+
"--printer-width",
|
|
216
|
+
type=int,
|
|
217
|
+
default=None,
|
|
218
|
+
help="Wrap/truncation width. Defaults to FIVETRAN_PRINTER_WIDTH or terminal width.",
|
|
219
|
+
)
|
|
220
|
+
parser.add_argument(
|
|
221
|
+
"--wide",
|
|
222
|
+
action="store_true",
|
|
223
|
+
help="Show all non-sensitive fields/columns without truncation.",
|
|
224
|
+
)
|
|
225
|
+
parser.add_argument(
|
|
226
|
+
"--fields",
|
|
227
|
+
help="Comma-separated fields/columns to show, overriding the default view.",
|
|
228
|
+
)
|
|
186
229
|
parser.add_argument("--quiet", action="store_true", help="Suppress response output.")
|
|
187
230
|
parser.add_argument("--verbose", action="store_true", help="Enable verbose diagnostics.")
|
|
188
231
|
parser.add_argument(
|
|
@@ -193,9 +236,39 @@ def _add_global_options(parser: argparse.ArgumentParser) -> None:
|
|
|
193
236
|
|
|
194
237
|
|
|
195
238
|
def _output_format(args: argparse.Namespace) -> str:
|
|
196
|
-
if args.
|
|
197
|
-
return
|
|
198
|
-
|
|
239
|
+
if args.output:
|
|
240
|
+
return args.output
|
|
241
|
+
env = os.environ.get("FIVETRAN_OUTPUT")
|
|
242
|
+
if env in ("text", "json"):
|
|
243
|
+
return env
|
|
244
|
+
return "text"
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
def _use_color(args: argparse.Namespace) -> bool:
|
|
248
|
+
if args.use_colors is not None:
|
|
249
|
+
return bool(args.use_colors)
|
|
250
|
+
env = os.environ.get("FIVETRAN_USE_COLORS")
|
|
251
|
+
if env is not None:
|
|
252
|
+
return env.strip().lower() in ("1", "true", "yes", "on")
|
|
253
|
+
return True
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
def _printer_width(args: argparse.Namespace) -> int | None:
|
|
257
|
+
if args.printer_width is not None:
|
|
258
|
+
return args.printer_width
|
|
259
|
+
env = os.environ.get("FIVETRAN_PRINTER_WIDTH")
|
|
260
|
+
if env:
|
|
261
|
+
try:
|
|
262
|
+
return int(env)
|
|
263
|
+
except ValueError:
|
|
264
|
+
pass
|
|
265
|
+
return None
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
def _fields(args: argparse.Namespace) -> list[str] | None:
|
|
269
|
+
if not args.fields:
|
|
270
|
+
return None
|
|
271
|
+
return [field.strip() for field in args.fields.split(",") if field.strip()]
|
|
199
272
|
|
|
200
273
|
|
|
201
274
|
def _add_account(resources: argparse._SubParsersAction[argparse.ArgumentParser]) -> None:
|
|
@@ -1911,8 +1984,8 @@ def _sdk_command_help() -> tuple[tuple[str, str], ...]:
|
|
|
1911
1984
|
|
|
1912
1985
|
def _add_body_options(parser: argparse.ArgumentParser, *, required: bool) -> None:
|
|
1913
1986
|
group = parser.add_mutually_exclusive_group(required=required)
|
|
1914
|
-
group.add_argument("--
|
|
1915
|
-
group.add_argument("--
|
|
1987
|
+
group.add_argument("--config", help="Inline JSON configuration.")
|
|
1988
|
+
group.add_argument("--config-file", help="Path to a JSON configuration file, or '-' for stdin.")
|
|
1916
1989
|
|
|
1917
1990
|
|
|
1918
1991
|
def _handler(endpoint: Endpoint) -> Handler:
|
|
@@ -1956,23 +2029,23 @@ def _format_path(
|
|
|
1956
2029
|
|
|
1957
2030
|
def _load_body(args: argparse.Namespace) -> Any:
|
|
1958
2031
|
raw: str | None = None
|
|
1959
|
-
if getattr(args, "
|
|
1960
|
-
raw = args.
|
|
1961
|
-
elif getattr(args, "
|
|
1962
|
-
if args.
|
|
2032
|
+
if getattr(args, "config", None) is not None:
|
|
2033
|
+
raw = args.config
|
|
2034
|
+
elif getattr(args, "config_file", None) is not None:
|
|
2035
|
+
if args.config_file == "-":
|
|
1963
2036
|
raw = sys.stdin.read()
|
|
1964
2037
|
else:
|
|
1965
2038
|
try:
|
|
1966
|
-
raw = Path(args.
|
|
2039
|
+
raw = Path(args.config_file).read_text(encoding="utf-8")
|
|
1967
2040
|
except OSError as exc:
|
|
1968
|
-
raise CliError(f"Could not read
|
|
2041
|
+
raise CliError(f"Could not read config file {args.config_file}: {exc}") from exc
|
|
1969
2042
|
|
|
1970
2043
|
if raw is None:
|
|
1971
2044
|
return None
|
|
1972
2045
|
try:
|
|
1973
2046
|
return json.loads(raw)
|
|
1974
2047
|
except json.JSONDecodeError as exc:
|
|
1975
|
-
raise CliError(f"Invalid JSON
|
|
2048
|
+
raise CliError(f"Invalid JSON configuration: {exc}") from exc
|
|
1976
2049
|
|
|
1977
2050
|
|
|
1978
2051
|
def _confirm_destructive(args: argparse.Namespace) -> None:
|