twc-cli 2.13.1__tar.gz → 2.14.0__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 (35) hide show
  1. {twc_cli-2.13.1 → twc_cli-2.14.0}/CHANGELOG.md +12 -0
  2. {twc_cli-2.13.1 → twc_cli-2.14.0}/PKG-INFO +2 -1
  3. {twc_cli-2.13.1 → twc_cli-2.14.0}/pyproject.toml +3 -1
  4. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/__version__.py +1 -1
  5. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/commands/server.py +70 -1
  6. {twc_cli-2.13.1 → twc_cli-2.14.0}/COPYING +0 -0
  7. {twc_cli-2.13.1 → twc_cli-2.14.0}/README.md +0 -0
  8. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/__init__.py +0 -0
  9. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/__main__.py +0 -0
  10. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/api/__init__.py +0 -0
  11. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/api/base.py +0 -0
  12. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/api/client.py +0 -0
  13. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/api/exceptions.py +0 -0
  14. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/api/types.py +0 -0
  15. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/apiwrap.py +0 -0
  16. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/commands/__init__.py +0 -0
  17. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/commands/account.py +0 -0
  18. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/commands/apps.py +0 -0
  19. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/commands/balancer.py +0 -0
  20. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/commands/common.py +0 -0
  21. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/commands/config.py +0 -0
  22. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/commands/database.py +0 -0
  23. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/commands/domain.py +0 -0
  24. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/commands/firewall.py +0 -0
  25. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/commands/floating_ip.py +0 -0
  26. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/commands/image.py +0 -0
  27. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/commands/kubernetes.py +0 -0
  28. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/commands/project.py +0 -0
  29. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/commands/ssh_key.py +0 -0
  30. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/commands/storage.py +0 -0
  31. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/commands/vpc.py +0 -0
  32. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/fmt.py +0 -0
  33. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/typerx.py +0 -0
  34. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/utils.py +0 -0
  35. {twc_cli-2.13.1 → twc_cli-2.14.0}/twc/vars.py +0 -0
@@ -2,6 +2,18 @@
2
2
 
3
3
  В этом файле описаны все значимые изменения в Timeweb Cloud CLI. В выпусках мы придерживается правил [семантического версионирования](https://semver.org/lang/ru/).
4
4
 
5
+ # Версия 2.14.0 (2025.09.15)
6
+
7
+ ## Добавлено
8
+
9
+ - Добавлена новая команда `twc server list-configurators` с помощью которой можно просмотреть список доступных конфигураторов облачных серверов. Конфигуратор это набор ограничений для параметров виртуальной машины (CPU, RAM, диск и т.п.).
10
+
11
+ # Версия 2.13.2 (2025.06.19)
12
+
13
+ ## Исправлено
14
+
15
+ - Исправлена ошибка фильтрации списка пресетов с опцией `--region` в команде `twc server list-presets`
16
+
5
17
  # Версия 2.13.1 (2025.06.19)
6
18
 
7
19
  ## Исправлено
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: twc-cli
3
- Version: 2.13.1
3
+ Version: 2.14.0
4
4
  Summary: Timeweb Cloud Command Line Interface.
5
5
  License: MIT
6
6
  Author: ge
@@ -13,6 +13,7 @@ Classifier: Programming Language :: Python :: 3.10
13
13
  Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
+ Requires-Dist: click (<8.2.0)
16
17
  Requires-Dist: colorama (>=0.4.6,<0.5.0)
17
18
  Requires-Dist: pygments (>=2.18.0,<3.0.0)
18
19
  Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "twc-cli"
3
- version = "2.13.1"
3
+ version = "2.14.0"
4
4
  description = "Timeweb Cloud Command Line Interface."
5
5
  authors = ["ge <dev@timeweb.cloud>"]
6
6
  homepage = "https://github.com/timeweb-cloud/twc"
@@ -19,6 +19,7 @@ colorama = "^0.4.6"
19
19
  toml = "^0.10.2"
20
20
  pyyaml = "^6.0.1"
21
21
  pygments = "^2.18.0"
22
+ click = "<8.2.0" # force old click to avoid typer/click compatibility issue
22
23
 
23
24
  [tool.poetry.group.dev.dependencies]
24
25
  black = "^24.4.2"
@@ -48,4 +49,5 @@ disable = [
48
49
  "duplicate-code",
49
50
  "invalid-name",
50
51
  "missing-function-docstring",
52
+ "too-many-positional-arguments",
51
53
  ]
@@ -12,5 +12,5 @@
12
12
  import sys
13
13
 
14
14
 
15
- __version__ = "2.13.1"
15
+ __version__ = "2.14.0"
16
16
  __pyversion__ = sys.version.replace("\n", "")
@@ -1270,7 +1270,10 @@ def server_list_presets(
1270
1270
  ):
1271
1271
  """List configuration presets."""
1272
1272
  if region:
1273
- filters = f"{filters},location:{region}"
1273
+ if filters:
1274
+ filters = f"{filters},location:{region.value}"
1275
+ else:
1276
+ filters = f"location:{region.value}"
1274
1277
  client = create_client(config, profile)
1275
1278
  response = client.get_server_presets()
1276
1279
  fmt.printer(
@@ -1281,6 +1284,72 @@ def server_list_presets(
1281
1284
  )
1282
1285
 
1283
1286
 
1287
+ # ------------------------------------------------------------- #
1288
+ # $ twc server list-configurators #
1289
+ # ------------------------------------------------------------- #
1290
+
1291
+
1292
+ def _print_configurators(response: Response, filters: Optional[str] = None):
1293
+ confs = response.json()["server_configurators"]
1294
+ if filters:
1295
+ confs = fmt.filter_list(confs, filters)
1296
+ table = fmt.Table()
1297
+ table.header(
1298
+ [
1299
+ "ID",
1300
+ "REGION",
1301
+ "TYPE",
1302
+ "CPU(MIN/MAX)",
1303
+ "RAM(MIN/MAX)",
1304
+ "DISK(MIN/MAX)",
1305
+ "BW(MIN/MAX)",
1306
+ ]
1307
+ )
1308
+ for conf in confs:
1309
+ table.row(
1310
+ [
1311
+ conf["id"],
1312
+ conf["location"],
1313
+ conf["disk_type"],
1314
+ f"{conf['requirements']['cpu_min']}/{conf['requirements']['cpu_max']}",
1315
+ f"{conf['requirements']['ram_min']}/{conf['requirements']['ram_max']}",
1316
+ f"{conf['requirements']['disk_min']}/{conf['requirements']['disk_max']}",
1317
+ (
1318
+ f"{conf['requirements']['network_bandwidth_min']}/"
1319
+ f"{conf['requirements']['network_bandwidth_max']}"
1320
+ ),
1321
+ ]
1322
+ )
1323
+ table.print()
1324
+
1325
+
1326
+ @server.command("list-configurators", "lc")
1327
+ def server_list_configurators(
1328
+ verbose: Optional[bool] = verbose_option,
1329
+ config: Optional[Path] = config_option,
1330
+ profile: Optional[str] = profile_option,
1331
+ output_format: Optional[str] = output_format_option,
1332
+ filters: Optional[str] = filter_option,
1333
+ region: Optional[ServiceRegion] = typer.Option(
1334
+ None, help="Use region (location)."
1335
+ ),
1336
+ ):
1337
+ """List Cloud Server configurators (sets of configuration constraints)."""
1338
+ if region:
1339
+ if filters:
1340
+ filters = f"{filters},location:{region.value}"
1341
+ else:
1342
+ filters = f"location:{region.value}"
1343
+ client = create_client(config, profile)
1344
+ response = client.get_server_configurators()
1345
+ fmt.printer(
1346
+ response,
1347
+ output_format=output_format,
1348
+ filters=filters,
1349
+ func=_print_configurators,
1350
+ )
1351
+
1352
+
1284
1353
  # ------------------------------------------------------------- #
1285
1354
  # $ twc server list-os-images #
1286
1355
  # ------------------------------------------------------------- #
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