tinybird-cli 2.1.0.dev12__tar.gz → 2.1.0.dev14__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.
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/PKG-INFO +11 -1
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/__cli__.py +2 -2
- tinybird-cli-2.1.0.dev14/tinybird/connector_settings.py +134 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/datafile.py +1 -1
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/feedback_manager.py +7 -2
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/branch.py +45 -27
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/connection.py +5 -7
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird_cli.egg-info/PKG-INFO +11 -1
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird_cli.egg-info/requires.txt +1 -0
- tinybird-cli-2.1.0.dev12/tinybird/connector_settings.py +0 -74
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/setup.cfg +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/check_pypi.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/client.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/config.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/connectors.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/context.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/datatypes.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/sql.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/sql_template.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/sql_toolset.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/syncasync.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/token.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tornado_template.py +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird_cli.egg-info/SOURCES.txt +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird_cli.egg-info/dependency_links.txt +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird_cli.egg-info/entry_points.txt +0 -0
- {tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tinybird-cli
|
|
3
|
-
Version: 2.1.0.
|
|
3
|
+
Version: 2.1.0.dev14
|
|
4
4
|
Summary: Tinybird Command Line Tool
|
|
5
5
|
Home-page: https://docs.tinybird.co/cli.html
|
|
6
6
|
Author: Tinybird
|
|
@@ -19,6 +19,16 @@ Changelog
|
|
|
19
19
|
|
|
20
20
|
---------
|
|
21
21
|
|
|
22
|
+
2.1.0.dev14
|
|
23
|
+
************
|
|
24
|
+
|
|
25
|
+
- `Changed` `tb release rollback` now requires double confirmation
|
|
26
|
+
|
|
27
|
+
2.1.0.dev13
|
|
28
|
+
************
|
|
29
|
+
|
|
30
|
+
- `Fixed` Ignore .diff_tmp/ on `tb deploy`
|
|
31
|
+
|
|
22
32
|
2.1.0.dev12
|
|
23
33
|
************
|
|
24
34
|
|
|
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
|
|
|
4
4
|
__url__ = 'https://docs.tinybird.co/cli.html'
|
|
5
5
|
__author__ = 'Tinybird'
|
|
6
6
|
__author_email__ = 'support@tinybird.co'
|
|
7
|
-
__version__ = '2.1.0.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '2.1.0.dev14'
|
|
8
|
+
__revision__ = '579c3e5'
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
from typing import List, Optional
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class DataConnectorType(str, Enum):
|
|
10
|
+
KAFKA = "kafka"
|
|
11
|
+
GCLOUD_SCHEDULER = "gcscheduler"
|
|
12
|
+
SNOWFLAKE = "snowflake"
|
|
13
|
+
BIGQUERY = "bigquery"
|
|
14
|
+
GCLOUD_STORAGE = "gcs"
|
|
15
|
+
GCLOUD_STORAGE_HMAC = "gcs_hmac"
|
|
16
|
+
AMAZON_S3 = "s3"
|
|
17
|
+
|
|
18
|
+
def __str__(self) -> str:
|
|
19
|
+
return self.value
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class DataConnectorSetting(BaseModel):
|
|
23
|
+
...
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class KafkaConnectorSetting(DataConnectorSetting):
|
|
27
|
+
kafka_bootstrap_servers: str
|
|
28
|
+
kafka_sasl_plain_username: str
|
|
29
|
+
kafka_sasl_plain_password: str
|
|
30
|
+
cli_version: Optional[str] = None
|
|
31
|
+
tb_endpoint: Optional[str] = None
|
|
32
|
+
kafka_security_protocol: Optional[str] = None
|
|
33
|
+
kafka_sasl_mechanism: Optional[str] = None
|
|
34
|
+
kafka_schema_registry_url: Optional[str] = None
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class S3ConnectorSetting(DataConnectorSetting):
|
|
38
|
+
s3_access_key_id: str
|
|
39
|
+
s3_secret_access_key: str
|
|
40
|
+
s3_region: str
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class SnowflakeConnectorSetting(DataConnectorSetting):
|
|
44
|
+
account: str
|
|
45
|
+
username: str
|
|
46
|
+
password: str
|
|
47
|
+
role: str
|
|
48
|
+
warehouse: str
|
|
49
|
+
warehouse_size: Optional[str] = None
|
|
50
|
+
stage: Optional[str] = None
|
|
51
|
+
integration: Optional[str] = None
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class GCSchedulerConnectorSetting(DataConnectorSetting):
|
|
55
|
+
gcscheduler_region: Optional[str] = None
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class BigQueryConnectorSetting(DataConnectorSetting):
|
|
59
|
+
account: Optional[str] = None
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class GCSHmacConnectorSetting(DataConnectorSetting):
|
|
63
|
+
gcs_hmac_access_id: str
|
|
64
|
+
gcs_hmac_secret: str
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class GCSConnectorSetting(DataConnectorSetting):
|
|
68
|
+
gcs_private_key_id: str
|
|
69
|
+
gcs_client_x509_cert_url: str
|
|
70
|
+
gcs_project_id: str
|
|
71
|
+
gcs_client_id: str
|
|
72
|
+
gcs_client_email: str
|
|
73
|
+
gcs_private_key: str
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
DATA_CONNECTOR_SETTINGS: dict[DataConnectorType, type[DataConnectorSetting]] = {
|
|
77
|
+
DataConnectorType.KAFKA: KafkaConnectorSetting,
|
|
78
|
+
DataConnectorType.GCLOUD_SCHEDULER: GCSchedulerConnectorSetting,
|
|
79
|
+
DataConnectorType.SNOWFLAKE: SnowflakeConnectorSetting,
|
|
80
|
+
DataConnectorType.BIGQUERY: BigQueryConnectorSetting,
|
|
81
|
+
DataConnectorType.GCLOUD_STORAGE: GCSConnectorSetting,
|
|
82
|
+
DataConnectorType.GCLOUD_STORAGE_HMAC: GCSHmacConnectorSetting,
|
|
83
|
+
DataConnectorType.AMAZON_S3: S3ConnectorSetting,
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class DataLinkerSettings:
|
|
88
|
+
kafka = [
|
|
89
|
+
"tb_datasource",
|
|
90
|
+
"tb_token",
|
|
91
|
+
"kafka_topic",
|
|
92
|
+
"kafka_group_id",
|
|
93
|
+
"kafka_auto_offset_reset",
|
|
94
|
+
"kafka_store_raw_value",
|
|
95
|
+
"kafka_store_headers",
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
class DataSinkSettings:
|
|
100
|
+
gcscheduler = [
|
|
101
|
+
"cron",
|
|
102
|
+
"timezone",
|
|
103
|
+
"status",
|
|
104
|
+
"gcscheduler_target_url",
|
|
105
|
+
"gcscheduler_job_name",
|
|
106
|
+
"gcscheduler_region",
|
|
107
|
+
]
|
|
108
|
+
gcs_hmac = [
|
|
109
|
+
"bucket_path",
|
|
110
|
+
"file_template",
|
|
111
|
+
"partition_node",
|
|
112
|
+
"format",
|
|
113
|
+
"compression",
|
|
114
|
+
]
|
|
115
|
+
s3 = [
|
|
116
|
+
"bucket_path",
|
|
117
|
+
"file_template",
|
|
118
|
+
"partition_node",
|
|
119
|
+
"format",
|
|
120
|
+
"compression",
|
|
121
|
+
]
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
class DataSensitiveSettings:
|
|
125
|
+
kafka = ["kafka_sasl_plain_password"]
|
|
126
|
+
gcscheduler = [
|
|
127
|
+
"gcscheduler_target_url",
|
|
128
|
+
"gcscheduler_job_name",
|
|
129
|
+
"gcscheduler_region",
|
|
130
|
+
]
|
|
131
|
+
bigquery: List[str] = []
|
|
132
|
+
snowflake: List[str] = []
|
|
133
|
+
gcs_hmac: List[str] = ["gcs_hmac_secret"]
|
|
134
|
+
s3: List[str] = ["s3_secret_access_key"]
|
|
@@ -260,7 +260,7 @@ def is_shared_datasource(ds_name: str) -> bool:
|
|
|
260
260
|
|
|
261
261
|
|
|
262
262
|
class CLIGitRelease:
|
|
263
|
-
NO_DATAFILES_PATHS = ["vendor/", "tests/", "scripts/"]
|
|
263
|
+
NO_DATAFILES_PATHS = ["vendor/", "tests/", "scripts/", ".diff_tmp/"]
|
|
264
264
|
DATAFILES_SUFFIXES = [".datasource", ".pipe", ".incl", ".token"]
|
|
265
265
|
|
|
266
266
|
class ChangeType(Enum):
|
|
@@ -419,6 +419,8 @@ Ready? """
|
|
|
419
419
|
warning_confirm_delete_workspace = prompt_message("Do you want to remove {workspace_name} workspace?")
|
|
420
420
|
warning_confirm_delete_branch = prompt_message("Do you want to remove '{branch}' Environment?")
|
|
421
421
|
warning_confirm_delete_release = prompt_message("Do you want to remove Release {semver}?")
|
|
422
|
+
warning_confirm_rollback_release = prompt_message("Do you want to rollback current Release {semver} to {rollback}?")
|
|
423
|
+
|
|
422
424
|
warning_confirm_delete_token = prompt_message("Do you want to delete Token {token}?")
|
|
423
425
|
warning_confirm_refresh_token = prompt_message("Do you want to refresh Token {token}?")
|
|
424
426
|
warning_datasource_is_connected = warning_message(
|
|
@@ -617,7 +619,10 @@ Ready? """
|
|
|
617
619
|
"** {provider} CI/CD config files generated. Read this guide to learn how to run CI/CD pipelines: https://www.tinybird.co/docs/guides/continuous-integration.html"
|
|
618
620
|
)
|
|
619
621
|
info_release_rm_resources = info_message(
|
|
620
|
-
"** The following resources are
|
|
622
|
+
"** The following resources IDs are only present in this Release and will be deleted:"
|
|
623
|
+
)
|
|
624
|
+
info_release_rollback = info_message(
|
|
625
|
+
"** The following resources IDs are present in the {semver} Release and will be restored:"
|
|
621
626
|
)
|
|
622
627
|
|
|
623
628
|
success_test_endpoint = info_message(
|
|
@@ -779,7 +784,7 @@ Ready? """
|
|
|
779
784
|
success_release_rollback = success_message("** Workspace rolled back to Release {semver}")
|
|
780
785
|
success_release_delete = success_message("** Release {semver} deleted")
|
|
781
786
|
success_release_delete_dry_run = success_message(
|
|
782
|
-
"** Release {semver} delete (dry run). The following resources are
|
|
787
|
+
"** Release {semver} delete (dry run). The following resources IDs are only present in this Release and will be deleted:"
|
|
783
788
|
)
|
|
784
789
|
|
|
785
790
|
success_delete_token = success_message("** Token '{token}' removed successfully")
|
|
@@ -32,6 +32,25 @@ from tinybird.tb_cli_modules.config import CLIConfig
|
|
|
32
32
|
from tinybird.tb_cli_modules.exceptions import CLIBranchException, CLIException, CLIReleaseException
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
async def print_release_summary(config: CLIConfig, semver: str):
|
|
36
|
+
try:
|
|
37
|
+
client = config.get_client()
|
|
38
|
+
response = await client.release_rm(config["id"], semver, confirmation=config["name"], dry_run=True)
|
|
39
|
+
except Exception as e:
|
|
40
|
+
raise CLIReleaseException(FeedbackManager.error_exception(error=str(e)))
|
|
41
|
+
else:
|
|
42
|
+
columns = ["name", "id"]
|
|
43
|
+
if len(response["datasources"]):
|
|
44
|
+
click.echo("\nDatasources:")
|
|
45
|
+
echo_safe_humanfriendly_tables_format_smart_table(
|
|
46
|
+
list(response["datasources"].items()), column_names=columns
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
if len(response["pipes"]):
|
|
50
|
+
click.echo("\nPipes:")
|
|
51
|
+
echo_safe_humanfriendly_tables_format_smart_table(list(response["pipes"].items()), column_names=columns)
|
|
52
|
+
|
|
53
|
+
|
|
35
54
|
@cli.group(hidden=True)
|
|
36
55
|
def release() -> None:
|
|
37
56
|
"""Release commands"""
|
|
@@ -45,6 +64,10 @@ async def release_ls() -> None:
|
|
|
45
64
|
config = CLIConfig.get_project_config()
|
|
46
65
|
_ = await try_update_config_with_remote(config, only_if_needed=True)
|
|
47
66
|
|
|
67
|
+
await print_releases(config)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
async def print_releases(config: CLIConfig):
|
|
48
71
|
response = await config.get_client().releases(config["id"])
|
|
49
72
|
|
|
50
73
|
table: List[Tuple[str, str, str, str, str]] = []
|
|
@@ -173,8 +196,9 @@ async def release_preview(semver: str) -> None:
|
|
|
173
196
|
|
|
174
197
|
|
|
175
198
|
@release.command(name="rollback", short_help="Rollbacks to a previous Release")
|
|
199
|
+
@click.option("--yes", is_flag=True, default=False, help="Do not ask for confirmation")
|
|
176
200
|
@coro
|
|
177
|
-
async def release_rollback() -> None:
|
|
201
|
+
async def release_rollback(yes: bool) -> None:
|
|
178
202
|
config = CLIConfig.get_project_config()
|
|
179
203
|
_ = await try_update_config_with_remote(config, only_if_needed=False)
|
|
180
204
|
|
|
@@ -183,14 +207,22 @@ async def release_rollback() -> None:
|
|
|
183
207
|
releases_response = await config.get_client().releases(config["id"])
|
|
184
208
|
|
|
185
209
|
try:
|
|
186
|
-
|
|
187
|
-
(release
|
|
210
|
+
release_to_rollback = next(
|
|
211
|
+
(release for release in releases_response["releases"] if release["status"] == "live"), None
|
|
188
212
|
)
|
|
189
|
-
if not
|
|
213
|
+
if not release_to_rollback:
|
|
190
214
|
raise CLIBranchException(FeedbackManager.error_release_rollback_live_not_found())
|
|
191
215
|
|
|
192
|
-
|
|
193
|
-
|
|
216
|
+
await print_releases(config)
|
|
217
|
+
semver = release_to_rollback.get("semver")
|
|
218
|
+
rollback_version = release_to_rollback.get("rollback")
|
|
219
|
+
click.echo(FeedbackManager.info_release_rollback(semver=rollback_version))
|
|
220
|
+
await print_release_summary(config, rollback_version)
|
|
221
|
+
if yes or click.confirm(
|
|
222
|
+
FeedbackManager.warning_confirm_rollback_release(semver=semver, rollback=rollback_version)
|
|
223
|
+
):
|
|
224
|
+
release = await client.release_rollback(config["id"], semver=semver)
|
|
225
|
+
click.echo(FeedbackManager.success_release_rollback(semver=release["semver"]))
|
|
194
226
|
except Exception as e:
|
|
195
227
|
raise CLIReleaseException(FeedbackManager.error_exception(error=str(e)))
|
|
196
228
|
|
|
@@ -209,40 +241,26 @@ async def release_rollback() -> None:
|
|
|
209
241
|
@coro
|
|
210
242
|
async def release_rm(semver: str, force: bool, yes: bool, dry_run: bool) -> None:
|
|
211
243
|
config = CLIConfig.get_project_config()
|
|
244
|
+
client = config.get_client()
|
|
212
245
|
_ = await try_update_config_with_remote(config)
|
|
213
246
|
|
|
214
247
|
if not force:
|
|
215
248
|
raise CLIReleaseException(
|
|
216
249
|
FeedbackManager.error_exception(
|
|
217
|
-
error="Use --force to delete a Release.
|
|
250
|
+
error="Use --force to delete a Release. A summary of the resources to be deleted will be shown."
|
|
218
251
|
)
|
|
219
252
|
)
|
|
220
253
|
|
|
221
254
|
click.echo(FeedbackManager.info_release_rm_resources())
|
|
222
|
-
|
|
223
|
-
client = config.get_client()
|
|
224
|
-
response = await client.release_rm(config["id"], semver, confirmation=config["name"], dry_run=True)
|
|
225
|
-
except Exception as e:
|
|
226
|
-
raise CLIReleaseException(FeedbackManager.error_exception(error=str(e)))
|
|
227
|
-
else:
|
|
228
|
-
columns = ["name", "id"]
|
|
229
|
-
if len(response["datasources"]):
|
|
230
|
-
click.echo("\nDatasources:")
|
|
231
|
-
echo_safe_humanfriendly_tables_format_smart_table(
|
|
232
|
-
list(response["datasources"].items()), column_names=columns
|
|
233
|
-
)
|
|
234
|
-
|
|
235
|
-
if len(response["pipes"]):
|
|
236
|
-
click.echo("\nPipes:")
|
|
237
|
-
echo_safe_humanfriendly_tables_format_smart_table(list(response["pipes"].items()), column_names=columns)
|
|
255
|
+
await print_release_summary(config, semver)
|
|
238
256
|
|
|
239
257
|
if dry_run or yes or click.confirm(FeedbackManager.warning_confirm_delete_release(semver=semver)):
|
|
240
258
|
try:
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
click.echo(FeedbackManager.success_release_delete(semver=semver))
|
|
244
|
-
else:
|
|
259
|
+
await client.release_rm(config["id"], semver, confirmation=config["name"], dry_run=dry_run)
|
|
260
|
+
if dry_run:
|
|
245
261
|
click.echo(FeedbackManager.success_release_delete_dry_run(semver=semver))
|
|
262
|
+
else:
|
|
263
|
+
click.echo(FeedbackManager.success_release_delete(semver=semver))
|
|
246
264
|
except Exception as e:
|
|
247
265
|
raise CLIReleaseException(FeedbackManager.error_exception(error=str(e)))
|
|
248
266
|
|
|
@@ -12,6 +12,7 @@ import click
|
|
|
12
12
|
from click import Context
|
|
13
13
|
|
|
14
14
|
from tinybird.client import DoesNotExistException, TinyB
|
|
15
|
+
from tinybird.connector_settings import DATA_CONNECTOR_SETTINGS, DataConnectorType, DataSensitiveSettings
|
|
15
16
|
from tinybird.feedback_manager import FeedbackManager
|
|
16
17
|
from tinybird.tb_cli_modules.cli import cli
|
|
17
18
|
from tinybird.tb_cli_modules.common import (
|
|
@@ -339,11 +340,8 @@ async def connection_rm(ctx: Context, connection_id: str, force: bool) -> None:
|
|
|
339
340
|
@click.option("--connector", help="Filter by connector")
|
|
340
341
|
@click.pass_context
|
|
341
342
|
@coro
|
|
342
|
-
async def connection_ls(ctx: Context, connector:
|
|
343
|
+
async def connection_ls(ctx: Context, connector: Optional[DataConnectorType] = None) -> None:
|
|
343
344
|
"""List connections."""
|
|
344
|
-
|
|
345
|
-
from tinybird.connector_settings import DataConnectorSettings, DataSensitiveSettings
|
|
346
|
-
|
|
347
345
|
obj: Dict[str, Any] = ctx.ensure_object(dict)
|
|
348
346
|
client: TinyB = obj["client"]
|
|
349
347
|
|
|
@@ -358,9 +356,9 @@ async def connection_ls(ctx: Context, connector: str) -> None:
|
|
|
358
356
|
columns = ["service", "name", "id", "connected_datasources"]
|
|
359
357
|
else:
|
|
360
358
|
sensitive_settings = getattr(DataSensitiveSettings, connector)
|
|
361
|
-
columns = ["service", "name", "id", "connected_datasources"]
|
|
362
|
-
|
|
363
|
-
|
|
359
|
+
columns = ["service", "name", "id", "connected_datasources"]
|
|
360
|
+
if connector_settings := DATA_CONNECTOR_SETTINGS.get(connector):
|
|
361
|
+
columns += [setting.replace("tb_", "") for setting in connector_settings.model_fields.keys()]
|
|
364
362
|
|
|
365
363
|
for connection in connections:
|
|
366
364
|
row = [_get_setting_value(connection, setting, sensitive_settings) for setting in columns]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tinybird-cli
|
|
3
|
-
Version: 2.1.0.
|
|
3
|
+
Version: 2.1.0.dev14
|
|
4
4
|
Summary: Tinybird Command Line Tool
|
|
5
5
|
Home-page: https://docs.tinybird.co/cli.html
|
|
6
6
|
Author: Tinybird
|
|
@@ -19,6 +19,16 @@ Changelog
|
|
|
19
19
|
|
|
20
20
|
---------
|
|
21
21
|
|
|
22
|
+
2.1.0.dev14
|
|
23
|
+
************
|
|
24
|
+
|
|
25
|
+
- `Changed` `tb release rollback` now requires double confirmation
|
|
26
|
+
|
|
27
|
+
2.1.0.dev13
|
|
28
|
+
************
|
|
29
|
+
|
|
30
|
+
- `Fixed` Ignore .diff_tmp/ on `tb deploy`
|
|
31
|
+
|
|
22
32
|
2.1.0.dev12
|
|
23
33
|
************
|
|
24
34
|
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
from typing import List
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class DataConnectorSettings:
|
|
5
|
-
kafka = [
|
|
6
|
-
"cli_version",
|
|
7
|
-
"tb_endpoint",
|
|
8
|
-
"kafka_bootstrap_servers",
|
|
9
|
-
"kafka_sasl_plain_username",
|
|
10
|
-
"kafka_sasl_plain_password",
|
|
11
|
-
"kafka_security_protocol",
|
|
12
|
-
"kafka_sasl_mechanism",
|
|
13
|
-
"kafka_schema_registry_url",
|
|
14
|
-
]
|
|
15
|
-
gcscheduler = ["gcscheduler_region"]
|
|
16
|
-
bigquery = ["account"]
|
|
17
|
-
snowflake = ["account", "username", "password", "warehouse", "warehouse_size", "role", "stage", "integration"]
|
|
18
|
-
gcs_hmac = ["gcs_hmac_access_id", "gcs_hmac_secret"]
|
|
19
|
-
s3 = [
|
|
20
|
-
"s3_access_key_id",
|
|
21
|
-
"s3_secret_access_key",
|
|
22
|
-
"s3_region",
|
|
23
|
-
]
|
|
24
|
-
gcs = [
|
|
25
|
-
"gcs_private_key_id",
|
|
26
|
-
"gcs_client_x509_cert_url",
|
|
27
|
-
"gcs_project_id",
|
|
28
|
-
"gcs_client_id",
|
|
29
|
-
"gcs_client_email",
|
|
30
|
-
"gcs_private_key",
|
|
31
|
-
]
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
class DataLinkerSettings:
|
|
35
|
-
kafka = [
|
|
36
|
-
"tb_datasource",
|
|
37
|
-
"tb_token",
|
|
38
|
-
"kafka_topic",
|
|
39
|
-
"kafka_group_id",
|
|
40
|
-
"kafka_auto_offset_reset",
|
|
41
|
-
"kafka_store_raw_value",
|
|
42
|
-
"kafka_store_headers",
|
|
43
|
-
]
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
class DataSinkSettings:
|
|
47
|
-
gcscheduler = ["cron", "timezone", "status", "gcscheduler_target_url", "gcscheduler_job_name", "gcscheduler_region"]
|
|
48
|
-
gcs_hmac = [
|
|
49
|
-
"bucket_path",
|
|
50
|
-
"file_template",
|
|
51
|
-
"partition_node",
|
|
52
|
-
"format",
|
|
53
|
-
"compression",
|
|
54
|
-
]
|
|
55
|
-
s3 = [
|
|
56
|
-
"bucket_path",
|
|
57
|
-
"file_template",
|
|
58
|
-
"partition_node",
|
|
59
|
-
"format",
|
|
60
|
-
"compression",
|
|
61
|
-
]
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
class DataSensitiveSettings:
|
|
65
|
-
kafka = ["kafka_sasl_plain_password"]
|
|
66
|
-
gcscheduler = [
|
|
67
|
-
"gcscheduler_target_url",
|
|
68
|
-
"gcscheduler_job_name",
|
|
69
|
-
"gcscheduler_region",
|
|
70
|
-
]
|
|
71
|
-
bigquery: List[str] = []
|
|
72
|
-
snowflake: List[str] = []
|
|
73
|
-
gcs_hmac: List[str] = ["gcs_hmac_secret"]
|
|
74
|
-
s3: List[str] = ["s3_secret_access_key"]
|
|
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
|
|
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
|
{tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/tinyunit/tinyunit.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird/tb_cli_modules/workspace_members.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird_cli.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{tinybird-cli-2.1.0.dev12 → tinybird-cli-2.1.0.dev14}/tinybird_cli.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|