twc-cli 2.10.0__tar.gz → 2.10.1__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 twc-cli might be problematic. Click here for more details.

Files changed (34) hide show
  1. {twc_cli-2.10.0 → twc_cli-2.10.1}/CHANGELOG.md +6 -0
  2. {twc_cli-2.10.0 → twc_cli-2.10.1}/PKG-INFO +1 -1
  3. {twc_cli-2.10.0 → twc_cli-2.10.1}/pyproject.toml +1 -1
  4. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/__version__.py +1 -1
  5. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/commands/database.py +17 -3
  6. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/vars.py +10 -0
  7. {twc_cli-2.10.0 → twc_cli-2.10.1}/COPYING +0 -0
  8. {twc_cli-2.10.0 → twc_cli-2.10.1}/README.md +0 -0
  9. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/__init__.py +0 -0
  10. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/__main__.py +0 -0
  11. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/api/__init__.py +0 -0
  12. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/api/base.py +0 -0
  13. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/api/client.py +0 -0
  14. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/api/exceptions.py +0 -0
  15. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/api/types.py +0 -0
  16. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/apiwrap.py +0 -0
  17. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/commands/__init__.py +0 -0
  18. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/commands/account.py +0 -0
  19. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/commands/balancer.py +0 -0
  20. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/commands/common.py +0 -0
  21. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/commands/config.py +0 -0
  22. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/commands/domain.py +0 -0
  23. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/commands/firewall.py +0 -0
  24. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/commands/floating_ip.py +0 -0
  25. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/commands/image.py +0 -0
  26. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/commands/kubernetes.py +0 -0
  27. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/commands/project.py +0 -0
  28. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/commands/server.py +0 -0
  29. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/commands/ssh_key.py +0 -0
  30. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/commands/storage.py +0 -0
  31. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/commands/vpc.py +0 -0
  32. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/fmt.py +0 -0
  33. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/typerx.py +0 -0
  34. {twc_cli-2.10.0 → twc_cli-2.10.1}/twc/utils.py +0 -0
@@ -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
  ## Добавлено
@@ -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,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "twc-cli"
3
- version = "2.10.0"
3
+ version = "2.10.1"
4
4
  description = "Timeweb Cloud Command Line Interface."
5
5
  authors = ["ge <dev@timeweb.cloud>"]
6
6
  homepage = "https://github.com/timeweb-cloud/twc"
@@ -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", "")
@@ -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(
@@ -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
+ }
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