fivetran-cli 0.1.10__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.10/src/fivetran_cli.egg-info → fivetran_cli-0.1.11}/PKG-INFO +5 -5
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11}/README.md +4 -4
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11}/pyproject.toml +1 -1
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11}/src/fivetran_cli/cli.py +9 -9
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11/src/fivetran_cli.egg-info}/PKG-INFO +5 -5
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11}/tests/test_cli.py +43 -10
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11}/LICENSE +0 -0
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11}/MANIFEST.in +0 -0
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11}/setup.cfg +0 -0
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11}/src/fivetran_cli/__init__.py +0 -0
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11}/src/fivetran_cli/__main__.py +0 -0
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11}/src/fivetran_cli/client.py +0 -0
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11}/src/fivetran_cli/output.py +0 -0
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11}/src/fivetran_cli/views.py +0 -0
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11}/src/fivetran_cli.egg-info/SOURCES.txt +0 -0
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11}/src/fivetran_cli.egg-info/dependency_links.txt +0 -0
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11}/src/fivetran_cli.egg-info/requires.txt +0 -0
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11}/src/fivetran_cli.egg-info/top_level.txt +0 -0
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11}/tests/test_client.py +0 -0
- {fivetran_cli-0.1.10 → fivetran_cli-0.1.11}/tests/test_output.py +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
|
|
|
@@ -83,11 +83,11 @@ shown with `--wide` or `--output json`. Sensitive values (passwords, secrets,
|
|
|
83
83
|
tokens, API/private keys, and exact `key` fields) are always redacted in text
|
|
84
84
|
output.
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
Create and update commands accept configuration as inline JSON or a JSON file:
|
|
87
87
|
|
|
88
88
|
```bash
|
|
89
|
-
fivetran private-link create --
|
|
90
|
-
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}'
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
Destructive commands require `--yes` in non-interactive mode.
|
|
@@ -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
|
|
|
@@ -66,11 +66,11 @@ shown with `--wide` or `--output json`. Sensitive values (passwords, secrets,
|
|
|
66
66
|
tokens, API/private keys, and exact `key` fields) are always redacted in text
|
|
67
67
|
output.
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
Create and update commands accept configuration as inline JSON or a JSON file:
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
|
-
fivetran private-link create --
|
|
73
|
-
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}'
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
Destructive commands require `--yes` in non-interactive mode.
|
|
@@ -1984,8 +1984,8 @@ def _sdk_command_help() -> tuple[tuple[str, str], ...]:
|
|
|
1984
1984
|
|
|
1985
1985
|
def _add_body_options(parser: argparse.ArgumentParser, *, required: bool) -> None:
|
|
1986
1986
|
group = parser.add_mutually_exclusive_group(required=required)
|
|
1987
|
-
group.add_argument("--
|
|
1988
|
-
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.")
|
|
1989
1989
|
|
|
1990
1990
|
|
|
1991
1991
|
def _handler(endpoint: Endpoint) -> Handler:
|
|
@@ -2029,23 +2029,23 @@ def _format_path(
|
|
|
2029
2029
|
|
|
2030
2030
|
def _load_body(args: argparse.Namespace) -> Any:
|
|
2031
2031
|
raw: str | None = None
|
|
2032
|
-
if getattr(args, "
|
|
2033
|
-
raw = args.
|
|
2034
|
-
elif getattr(args, "
|
|
2035
|
-
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 == "-":
|
|
2036
2036
|
raw = sys.stdin.read()
|
|
2037
2037
|
else:
|
|
2038
2038
|
try:
|
|
2039
|
-
raw = Path(args.
|
|
2039
|
+
raw = Path(args.config_file).read_text(encoding="utf-8")
|
|
2040
2040
|
except OSError as exc:
|
|
2041
|
-
raise CliError(f"Could not read
|
|
2041
|
+
raise CliError(f"Could not read config file {args.config_file}: {exc}") from exc
|
|
2042
2042
|
|
|
2043
2043
|
if raw is None:
|
|
2044
2044
|
return None
|
|
2045
2045
|
try:
|
|
2046
2046
|
return json.loads(raw)
|
|
2047
2047
|
except json.JSONDecodeError as exc:
|
|
2048
|
-
raise CliError(f"Invalid JSON
|
|
2048
|
+
raise CliError(f"Invalid JSON configuration: {exc}") from exc
|
|
2049
2049
|
|
|
2050
2050
|
|
|
2051
2051
|
def _confirm_destructive(args: argparse.Namespace) -> None:
|
|
@@ -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
|
|
|
@@ -83,11 +83,11 @@ shown with `--wide` or `--output json`. Sensitive values (passwords, secrets,
|
|
|
83
83
|
tokens, API/private keys, and exact `key` fields) are always redacted in text
|
|
84
84
|
output.
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
Create and update commands accept configuration as inline JSON or a JSON file:
|
|
87
87
|
|
|
88
88
|
```bash
|
|
89
|
-
fivetran private-link create --
|
|
90
|
-
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}'
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
Destructive commands require `--yes` in non-interactive mode.
|
|
@@ -88,14 +88,14 @@ class CliTests(unittest.TestCase):
|
|
|
88
88
|
)
|
|
89
89
|
self.assertEqual(json.loads(stdout)["data"]["items"], [{"id": "one"}, {"id": "two"}])
|
|
90
90
|
|
|
91
|
-
def
|
|
91
|
+
def test_connection_create_loads_inline_json_config(self):
|
|
92
92
|
code, _, stderr, client = self.run_cli(
|
|
93
93
|
[
|
|
94
94
|
"--api-key",
|
|
95
95
|
"key",
|
|
96
96
|
"connection",
|
|
97
97
|
"create",
|
|
98
|
-
"--
|
|
98
|
+
"--config",
|
|
99
99
|
'{"group_id":"group","service":"github","config":{}}',
|
|
100
100
|
]
|
|
101
101
|
)
|
|
@@ -108,6 +108,39 @@ class CliTests(unittest.TestCase):
|
|
|
108
108
|
{"group_id": "group", "service": "github", "config": {}},
|
|
109
109
|
)
|
|
110
110
|
|
|
111
|
+
def test_connection_create_loads_json_config_file(self):
|
|
112
|
+
with tempfile.TemporaryDirectory() as tmpdir:
|
|
113
|
+
config_path = Path(tmpdir) / "connection.json"
|
|
114
|
+
config_path.write_text(
|
|
115
|
+
'{"group_id":"group","service":"github","config":{}}',
|
|
116
|
+
encoding="utf-8",
|
|
117
|
+
)
|
|
118
|
+
code, _, stderr, client = self.run_cli(
|
|
119
|
+
[
|
|
120
|
+
"--api-key",
|
|
121
|
+
"key",
|
|
122
|
+
"connection",
|
|
123
|
+
"create",
|
|
124
|
+
"--config-file",
|
|
125
|
+
str(config_path),
|
|
126
|
+
]
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
self.assertEqual(code, 0, stderr)
|
|
130
|
+
self.assertEqual(client.calls[0][0:2], ("POST", "/v1/connections"))
|
|
131
|
+
self.assertEqual(
|
|
132
|
+
client.calls[0][3],
|
|
133
|
+
{"group_id": "group", "service": "github", "config": {}},
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
def test_legacy_data_flag_is_not_supported(self):
|
|
137
|
+
parser = cli.build_parser()
|
|
138
|
+
|
|
139
|
+
with patch("sys.stderr", io.StringIO()), self.assertRaises(SystemExit) as context:
|
|
140
|
+
parser.parse_args(["--api-key", "key", "connection", "create", "--data", "{}"])
|
|
141
|
+
|
|
142
|
+
self.assertEqual(context.exception.code, 2)
|
|
143
|
+
|
|
111
144
|
def test_default_output_is_text(self):
|
|
112
145
|
code, stdout, stderr, _ = self.run_cli(
|
|
113
146
|
["--api-key", "key", "account", "get"]
|
|
@@ -233,7 +266,7 @@ class CliTests(unittest.TestCase):
|
|
|
233
266
|
"update",
|
|
234
267
|
"user_id",
|
|
235
268
|
"connection_id",
|
|
236
|
-
"--
|
|
269
|
+
"--config",
|
|
237
270
|
'{"role":"Connector Reviewer"}',
|
|
238
271
|
]
|
|
239
272
|
)
|
|
@@ -260,7 +293,7 @@ class CliTests(unittest.TestCase):
|
|
|
260
293
|
"add",
|
|
261
294
|
"team_id",
|
|
262
295
|
"connection_id",
|
|
263
|
-
"--
|
|
296
|
+
"--config",
|
|
264
297
|
'{"role":"Connector Reviewer"}',
|
|
265
298
|
]
|
|
266
299
|
)
|
|
@@ -433,7 +466,7 @@ class CliTests(unittest.TestCase):
|
|
|
433
466
|
"column",
|
|
434
467
|
"drop-blocked",
|
|
435
468
|
"connection_id",
|
|
436
|
-
"--
|
|
469
|
+
"--config",
|
|
437
470
|
'{"columns":["schema.table.column"]}',
|
|
438
471
|
"--yes",
|
|
439
472
|
]
|
|
@@ -463,7 +496,7 @@ class CliTests(unittest.TestCase):
|
|
|
463
496
|
"ad schema",
|
|
464
497
|
"table/name",
|
|
465
498
|
"column name",
|
|
466
|
-
"--
|
|
499
|
+
"--config",
|
|
467
500
|
'{"enabled":false}',
|
|
468
501
|
]
|
|
469
502
|
)
|
|
@@ -548,7 +581,7 @@ class CliTests(unittest.TestCase):
|
|
|
548
581
|
"private-link",
|
|
549
582
|
"update",
|
|
550
583
|
"private_link_id",
|
|
551
|
-
"--
|
|
584
|
+
"--config",
|
|
552
585
|
'{"name":"warehouse link"}',
|
|
553
586
|
]
|
|
554
587
|
)
|
|
@@ -608,7 +641,7 @@ class CliTests(unittest.TestCase):
|
|
|
608
641
|
"transformation-project",
|
|
609
642
|
"update",
|
|
610
643
|
"project_id",
|
|
611
|
-
"--
|
|
644
|
+
"--config",
|
|
612
645
|
'{"paused":true}',
|
|
613
646
|
]
|
|
614
647
|
)
|
|
@@ -625,7 +658,7 @@ class CliTests(unittest.TestCase):
|
|
|
625
658
|
"webhook",
|
|
626
659
|
"create-group",
|
|
627
660
|
"group_id",
|
|
628
|
-
"--
|
|
661
|
+
"--config",
|
|
629
662
|
'{"url":"https://example.test/webhook"}',
|
|
630
663
|
]
|
|
631
664
|
)
|
|
@@ -659,7 +692,7 @@ class CliTests(unittest.TestCase):
|
|
|
659
692
|
"destination",
|
|
660
693
|
"approve",
|
|
661
694
|
"destination_id",
|
|
662
|
-
"--
|
|
695
|
+
"--config",
|
|
663
696
|
'{"hash":"abc"}',
|
|
664
697
|
]
|
|
665
698
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|