twc-cli 2.10.0__py3-none-any.whl → 2.10.1__py3-none-any.whl

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 twc-cli might be problematic. Click here for more details.

CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  В этом файле описаны все значимые изменения в Timeweb Cloud CLI. В выпусках мы придерживается правил [семантического версионирования](https://semver.org/lang/ru/).
4
4
 
5
+ # Версия 2.10.1 (2025.03.25)
6
+
7
+ ## Исправлено
8
+
9
+ - Исправлена ошибка получения публичного IP при создании кластера СУБД.
10
+
5
11
  # Версия 2.10.0 (2025.03.24)
6
12
 
7
13
  ## Добавлено
twc/__version__.py CHANGED
@@ -12,5 +12,5 @@
12
12
  import sys
13
13
 
14
14
 
15
- __version__ = "2.10.0"
15
+ __version__ = "2.10.1"
16
16
  __pyversion__ = sys.version.replace("\n", "")
twc/commands/database.py CHANGED
@@ -15,6 +15,7 @@ from twc import fmt
15
15
  from twc.typerx import TyperAlias
16
16
  from twc.api import ServiceRegion, MySQLAuthPlugin, BackupInterval
17
17
  from twc.apiwrap import create_client
18
+ from twc.vars import REGION_ZONE_MAP
18
19
  from twc.utils import merge_dicts
19
20
  from .common import (
20
21
  verbose_option,
@@ -24,6 +25,7 @@ from .common import (
24
25
  yes_option,
25
26
  output_format_option,
26
27
  load_from_config_callback,
28
+ zone_option,
27
29
  )
28
30
 
29
31
 
@@ -277,6 +279,7 @@ def database_create(
277
279
  config: Optional[Path] = config_option,
278
280
  profile: Optional[str] = profile_option,
279
281
  output_format: Optional[str] = output_format_option,
282
+ availability_zone: Optional[str] = zone_option,
280
283
  preset_id: int = typer.Option(..., help="Database configuration preset."),
281
284
  dbms: str = typer.Option(
282
285
  ...,
@@ -408,10 +411,21 @@ def database_create(
408
411
  except ValueError:
409
412
  sys.exit(f"Error: '{public_ip}' is not valid IPv4 address.")
410
413
  else:
411
- # New public IPv4 address will be automatically requested with
412
- # correct availability zone. This is an official dirty hack.
414
+ # Get new public IPv4 address.
413
415
  if no_public_ip is False:
414
- payload["network"]["floating_ip"] = "create_ip"
416
+ zone = None
417
+ if preset_id and not availability_zone:
418
+ for preset in client.get_database_presets().json()[
419
+ "databases_presets"
420
+ ]:
421
+ if preset["id"] == preset_id:
422
+ zone = REGION_ZONE_MAP[preset["location"]]
423
+ if availability_zone:
424
+ zone = availability_zone
425
+ ip = client.create_floating_ip(availability_zone=zone).json()[
426
+ "ip"
427
+ ]["ip"]
428
+ payload["network"]["floating_ip"] = ip
415
429
 
416
430
  if login:
417
431
  print(
twc/vars.py CHANGED
@@ -20,3 +20,13 @@ ZONES_WITH_LAN = [
20
20
  "gdn-1",
21
21
  "fra-1",
22
22
  ]
23
+ # The default availability zones per regions.
24
+ REGION_ZONE_MAP = {
25
+ "ru-1": "spb-3",
26
+ "ru-2": "nsk-1",
27
+ "ru-3": "msk-1",
28
+ "kz-1": "ala-1",
29
+ "pl-1": "gdn-1",
30
+ "nl-1": "ams-1",
31
+ "de-1": "fra-1",
32
+ }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: twc-cli
3
- Version: 2.10.0
3
+ Version: 2.10.1
4
4
  Summary: Timeweb Cloud Command Line Interface.
5
5
  Home-page: https://github.com/timeweb-cloud/twc
6
6
  License: MIT
@@ -1,8 +1,8 @@
1
- CHANGELOG.md,sha256=9i0MuhpW4DSXw848ZGwm7AdA-XA9rYyOigBRT2T76cU,29632
1
+ CHANGELOG.md,sha256=Qs4nN5qu8rQUqUgHQoGBQThGm0k5BaTLOx6BE6NiXWY,29824
2
2
  COPYING,sha256=fpJLxZS_kHr_659xkpmqEtqHeZp6lQR9CmKCwnYbsmE,1089
3
3
  twc/__init__.py,sha256=NwPAMNw3NuHdWGQvWS9_lromVF6VM194oVOipojfJns,113
4
4
  twc/__main__.py,sha256=ADHceaQUzgLmvhYHvb5O8urdJWj5IcEHLpTQkSExiD8,2468
5
- twc/__version__.py,sha256=hlCsp4lDiHyiPjydCpKPl4urI6KoC8-yx7qcaoAret8,443
5
+ twc/__version__.py,sha256=8icMDOUZhpUZ9qC5kE9GWifcKzo2RYQElI1jYfMVJCs,443
6
6
  twc/api/__init__.py,sha256=SXew0Fe51M7nRBNQaaLRH4NjnRHkQUn7J26OCkQsftA,128
7
7
  twc/api/base.py,sha256=QRefnIgmlbz8n37GLBKeAK1AtzkcNo1IFjZgHDDECJ4,7912
8
8
  twc/api/client.py,sha256=T74KLeKHyAxzKHkpdNF-VOkfiAwnu7us61xzPosV5_o,64366
@@ -14,7 +14,7 @@ twc/commands/account.py,sha256=6q9ri02oFbUUZuqNVXO-uHOX45B4ELJlPjyfVaEL5Qw,5960
14
14
  twc/commands/balancer.py,sha256=QAouc74ZT5go11gB1vjjfYtd1luTmWrfpACPwokZ5sU,20278
15
15
  twc/commands/common.py,sha256=Wph8cVogUNNvc456SQrASb7mv7G88I8ETwHgISVjLQQ,8282
16
16
  twc/commands/config.py,sha256=xHNEZVmM60c9dApLfNsj78sXZk6VsFwPdVIHO9r8xks,8802
17
- twc/commands/database.py,sha256=dX0z8LLpVTfCM7QNe0tU1DH7IWIwaJZBdSqHs6hWzNQ,31446
17
+ twc/commands/database.py,sha256=NOi5b-DGYgbbN7bPrsJt0wKTJBzrfKUPwltVx8YGsgU,31953
18
18
  twc/commands/domain.py,sha256=BIg5k0TDQ-iWnhjuAHaWlZBB0bfaZgqZ2EWZGk3BICA,17154
19
19
  twc/commands/firewall.py,sha256=KNolqbi2rsppOZwbs_j3yoZQt-0wKbj1JPGiZdfGxDE,27439
20
20
  twc/commands/floating_ip.py,sha256=G9nD5BbHCZcuytbzeneDJWQDhd8c8WRtq9pAfwI9m7E,8747
@@ -28,9 +28,9 @@ twc/commands/vpc.py,sha256=SAht6UD17mU0d_AZY6W34VEYs7CqUsS2iDakPFxAFQU,8876
28
28
  twc/fmt.py,sha256=nbuYZ8nVabYDwCmZqnL3-c6Tmri4B-R_sTCkG6sdfeI,7171
29
29
  twc/typerx.py,sha256=AZ6BgTQvlrZYfKVYd9YqRNQnAR2XuyqImz4rf6di6f4,6737
30
30
  twc/utils.py,sha256=uWizyUC4dHLwtk50q4Sub3zOvnVESfHKBbXYwk5t71w,651
31
- twc/vars.py,sha256=XRtd77WWy2Ym2Yaodx84CKqKu2272O-Bj_fMFCjzuwg,607
32
- twc_cli-2.10.0.dist-info/COPYING,sha256=fpJLxZS_kHr_659xkpmqEtqHeZp6lQR9CmKCwnYbsmE,1089
33
- twc_cli-2.10.0.dist-info/METADATA,sha256=ZTVW8woDo4IdmAsKC-Okd4tHJ6CKKNgBQ7pnKw5Yc98,2653
34
- twc_cli-2.10.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
35
- twc_cli-2.10.0.dist-info/entry_points.txt,sha256=tmTaVRhm8BkNrXC_9XJMum7O9wFVOvkXcBetxmahWvE,40
36
- twc_cli-2.10.0.dist-info/RECORD,,
31
+ twc/vars.py,sha256=AHZEwtQ_BQbnP0n7RXJ-qhqeKPQ_FPc8SDgg6osR5uU,822
32
+ twc_cli-2.10.1.dist-info/COPYING,sha256=fpJLxZS_kHr_659xkpmqEtqHeZp6lQR9CmKCwnYbsmE,1089
33
+ twc_cli-2.10.1.dist-info/METADATA,sha256=-BCPh3qtm2gn6edv2ih7nODdb0M0n8k8LMz2sGc5Dbs,2653
34
+ twc_cli-2.10.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
35
+ twc_cli-2.10.1.dist-info/entry_points.txt,sha256=tmTaVRhm8BkNrXC_9XJMum7O9wFVOvkXcBetxmahWvE,40
36
+ twc_cli-2.10.1.dist-info/RECORD,,