ibee-cli 0.7.0__tar.gz → 0.8.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.
Files changed (35) hide show
  1. {ibee_cli-0.7.0/src/ibee_cli.egg-info → ibee_cli-0.8.0}/PKG-INFO +11 -4
  2. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/README.md +9 -2
  3. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/pyproject.toml +2 -2
  4. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/__init__.py +1 -1
  5. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/billing_selection.py +7 -3
  6. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/commands/__init__.py +3 -2
  7. ibee_cli-0.8.0/src/ibee_cli/commands/billing.py +42 -0
  8. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/commands/block_storage.py +1 -1
  9. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/commands/buckets.py +5 -5
  10. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/commands/cdn.py +1 -1
  11. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/commands/compute.py +1 -1
  12. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/commands/firewalls.py +2 -2
  13. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/commands/gpus.py +14 -10
  14. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/commands/load_balancers.py +1 -1
  15. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/commands/ops.py +1 -1
  16. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/commands/registries.py +1 -1
  17. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/commands/reserved_ips.py +2 -2
  18. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/commands/secrets.py +1 -1
  19. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/commands/vms.py +14 -10
  20. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/commands/vpcs.py +5 -5
  21. {ibee_cli-0.7.0 → ibee_cli-0.8.0/src/ibee_cli.egg-info}/PKG-INFO +11 -4
  22. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli.egg-info/SOURCES.txt +1 -0
  23. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli.egg-info/requires.txt +1 -1
  24. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/tests/test_cli_core.py +5 -4
  25. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/tests/test_command_behaviour.py +54 -0
  26. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/tests/test_contract_commands.py +6 -3
  27. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/LICENSE +0 -0
  28. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/setup.cfg +0 -0
  29. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/context.py +0 -0
  30. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/helpers.py +0 -0
  31. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/main.py +0 -0
  32. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli/render.py +0 -0
  33. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli.egg-info/dependency_links.txt +0 -0
  34. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli.egg-info/entry_points.txt +0 -0
  35. {ibee_cli-0.7.0 → ibee_cli-0.8.0}/src/ibee_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ibee-cli
3
- Version: 0.7.0
3
+ Version: 0.8.0
4
4
  Summary: Official command-line interface for the IBEE Solutions cloud platform
5
5
  Author-email: IBEE Solutions <support@ibee.ai>
6
6
  License-Expression: MIT
@@ -13,7 +13,7 @@ Classifier: Environment :: Console
13
13
  Requires-Python: >=3.10
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
- Requires-Dist: ibee<0.8,>=0.7.0
16
+ Requires-Dist: ibee<0.9,>=0.8.0
17
17
  Requires-Dist: httpx>=0.27
18
18
  Requires-Dist: typer>=0.12
19
19
  Requires-Dist: click>=8.1
@@ -33,7 +33,7 @@ CDN remains available.
33
33
 
34
34
  Official command-line interface for the IBEE Solutions cloud platform, built on the
35
35
  [`ibee` Python SDK](https://github.com/devs-ibee/ibee-python). It has one command per
36
- operation of the IBEE public API (contract 0.9.0, 229 operations): each command makes
36
+ operation of the IBEE public API (contract 0.10.0, 231 operations): each command makes
37
37
  that operation's one SDK call and prints the server's answer. The server decides
38
38
  prices, eligibility, limits and states; the CLI checks nothing before sending.
39
39
 
@@ -86,7 +86,8 @@ ibee vms create --name web-1 --site-id SITE_ID --plan-id PLAN_ID --template-id I
86
86
  --billing-interval HOURLY --ssh-keys "$(cat ~/.ssh/id_ed25519.pub)"
87
87
  ibee ops get OPERATION_ID
88
88
  ibee vms list --limit 20
89
- ibee vms resize VM_ID --cpu 4 --ram-mb 8192
89
+ ibee vms resize VM_ID --cpu 4 --ram-mb 8192 --disk-gb 80 --plan-id PLAN_ID --billing-interval HOURLY
90
+ ibee billing wallet
90
91
  ibee vms delete VM_ID --public-ip-action release --yes
91
92
 
92
93
  ibee buckets create --name assets --region in-south-2
@@ -107,6 +108,12 @@ exactly as the portal does. Nothing else is filled in: CPU, RAM, disk, OS and th
107
108
  other fields are sent as you give them. `MONTHLY` is a one-month commitment (the API
108
109
  answers `409 VM_COMMITTED` to a delete or resize before it ends).
109
110
 
111
+ `vms resize` and `gpus resize` move a VM to another plan. Send the target plan's exact
112
+ `--cpu`, `--ram-mb` and `--disk-gb`, and its `billing_catalog`: `--billing-catalog JSON`,
113
+ or `--plan-id PLAN_ID --billing-interval HOURLY|MONTHLY` to build it the same way from
114
+ `GET /compute/plans`. A resize body has no plan field, so `--plan-id` is only used for
115
+ this lookup and is not sent.
116
+
110
117
  ## Global options
111
118
 
112
119
  | Option | Environment variable | Meaning |
@@ -7,7 +7,7 @@ CDN remains available.
7
7
 
8
8
  Official command-line interface for the IBEE Solutions cloud platform, built on the
9
9
  [`ibee` Python SDK](https://github.com/devs-ibee/ibee-python). It has one command per
10
- operation of the IBEE public API (contract 0.9.0, 229 operations): each command makes
10
+ operation of the IBEE public API (contract 0.10.0, 231 operations): each command makes
11
11
  that operation's one SDK call and prints the server's answer. The server decides
12
12
  prices, eligibility, limits and states; the CLI checks nothing before sending.
13
13
 
@@ -60,7 +60,8 @@ ibee vms create --name web-1 --site-id SITE_ID --plan-id PLAN_ID --template-id I
60
60
  --billing-interval HOURLY --ssh-keys "$(cat ~/.ssh/id_ed25519.pub)"
61
61
  ibee ops get OPERATION_ID
62
62
  ibee vms list --limit 20
63
- ibee vms resize VM_ID --cpu 4 --ram-mb 8192
63
+ ibee vms resize VM_ID --cpu 4 --ram-mb 8192 --disk-gb 80 --plan-id PLAN_ID --billing-interval HOURLY
64
+ ibee billing wallet
64
65
  ibee vms delete VM_ID --public-ip-action release --yes
65
66
 
66
67
  ibee buckets create --name assets --region in-south-2
@@ -81,6 +82,12 @@ exactly as the portal does. Nothing else is filled in: CPU, RAM, disk, OS and th
81
82
  other fields are sent as you give them. `MONTHLY` is a one-month commitment (the API
82
83
  answers `409 VM_COMMITTED` to a delete or resize before it ends).
83
84
 
85
+ `vms resize` and `gpus resize` move a VM to another plan. Send the target plan's exact
86
+ `--cpu`, `--ram-mb` and `--disk-gb`, and its `billing_catalog`: `--billing-catalog JSON`,
87
+ or `--plan-id PLAN_ID --billing-interval HOURLY|MONTHLY` to build it the same way from
88
+ `GET /compute/plans`. A resize body has no plan field, so `--plan-id` is only used for
89
+ this lookup and is not sent.
90
+
84
91
  ## Global options
85
92
 
86
93
  | Option | Environment variable | Meaning |
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ibee-cli"
7
- version = "0.7.0"
7
+ version = "0.8.0"
8
8
  description = "Official command-line interface for the IBEE Solutions cloud platform"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -18,7 +18,7 @@ classifiers = [
18
18
  "Environment :: Console",
19
19
  ]
20
20
  dependencies = [
21
- "ibee>=0.7.0,<0.8",
21
+ "ibee>=0.8.0,<0.9",
22
22
  "httpx>=0.27",
23
23
  "typer>=0.12",
24
24
  "click>=8.1",
@@ -1,3 +1,3 @@
1
1
  """IBEE Solutions command-line interface."""
2
2
 
3
- __version__ = "0.7.0"
3
+ __version__ = "0.8.0"
@@ -1,4 +1,4 @@
1
- """The CLI's one convenience: a VM create's ``billing_catalog`` from ``GET /compute/plans``.
1
+ """The CLI's one convenience: a VM create's or resize's ``billing_catalog`` from ``GET /compute/plans``.
2
2
 
3
3
  The contract's ``ComputeBillingSelection`` (``billing_catalog`` of ``POST
4
4
  /compute/cloud-vms`` and ``POST /compute/gpu-vms``) is the chosen plan's
@@ -9,8 +9,10 @@ the server's own data, as the portal does: read the ``--plan-id`` plan from ``GE
9
9
  ``billing_catalog`` and merge in the whole ``billing_options`` entry whose
10
10
  ``billing_interval`` is the one asked for (``billing_interval``, ``committed``,
11
11
  ``commitment_period``, ``commitment_months``, ``committed_hours``, ``price_unit``,
12
- ``unit_price_minor``...), keeping the catalog's ``price_currency``. Nothing is
13
- invented or checked here: the server validates the selection and decides the price.
12
+ ``unit_price_minor``...), keeping the catalog's ``price_currency``. ``vms resize`` and
13
+ ``gpus resize`` (contract 0.10.0) do the same for the target plan named by their
14
+ CLI-only ``--plan-id``, read from ``GET /compute/plans`` without a site filter. Nothing
15
+ is invented or checked here: the server validates the selection and decides the price.
14
16
  """
15
17
 
16
18
  from __future__ import annotations
@@ -41,6 +43,8 @@ def vm_billing_catalog(
41
43
  "billing_catalog is required: pass --billing-interval HOURLY|MONTHLY (built from the plan in "
42
44
  "GET /compute/plans) or --billing-catalog JSON."
43
45
  )
46
+ if not plan_id:
47
+ fail_usage("--billing-interval needs --plan-id: the plan whose billing_catalog is sent.")
44
48
  interval = str(billing_interval).strip().upper()
45
49
  answer = client.compute_catalog.list_compute_plans(
46
50
  workspace_id=workspace_id, vm_type=vm_type, **({"site_id": site_id} if site_id else {})
@@ -1,8 +1,8 @@
1
- # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.9.0).
1
+ # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.10.0).
2
2
  # Do not edit by hand: change the contract or the generator and run the script again.
3
3
  """The command groups, in `ibee --help` order."""
4
4
 
5
- from . import block_storage, buckets, cdn, compute, firewalls, gpus, load_balancers, ops, registries, reserved_ips, secrets, vms, vpcs
5
+ from . import billing, block_storage, buckets, cdn, compute, firewalls, gpus, load_balancers, ops, registries, reserved_ips, secrets, vms, vpcs
6
6
 
7
7
  #: (CLI name, Typer app) of every command group.
8
8
  GROUPS = [
@@ -19,4 +19,5 @@ GROUPS = [
19
19
  ('firewalls', firewalls.app),
20
20
  ('load-balancers', load_balancers.app),
21
21
  ('registries', registries.app),
22
+ ('billing', billing.app),
22
23
  ]
@@ -0,0 +1,42 @@
1
+ # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.10.0).
2
+ # Do not edit by hand: change the contract or the generator and run the script again.
3
+ """``ibee billing``: Organization wallet balance and top-ups (one command per contract operation)."""
4
+
5
+ from __future__ import annotations
6
+
7
+ from typing import Optional
8
+
9
+ import typer
10
+
11
+ from ..helpers import compact, sdk, workspace
12
+ from ..render import emit, handle_api_errors
13
+
14
+ app = typer.Typer(help='Organization wallet balance and top-ups', no_args_is_help=True)
15
+
16
+
17
+ @app.command('wallet', help="Get the organization wallet.\n\nReturns the wallet balance of the API token's organization. Amounts are integers in the currency's minor unit (paise for INR, cents for USD). The wallet belongs to the organization, so any workspace of the organization returns the same wallet. Read-only: an organization without a wallet gets 404 `wallet_not_found` and nothing is created. The token's principal also needs permission to view the organization's billing. Requires scope: billing.read.\n\nAPI: GET /billing/wallet (getBillingWallet).", short_help='Get the organization wallet')
18
+ @handle_api_errors
19
+ def get_billing_wallet(
20
+ ctx: typer.Context,
21
+ ) -> None:
22
+ client = sdk(ctx)
23
+ result = client.billing.get_billing_wallet(**compact(workspace_id=workspace(ctx)))
24
+ emit(result)
25
+
26
+
27
+ @app.command('topup', help="Create a wallet top-up link.\n\nCreates a hosted payment page (Stripe Checkout or a Razorpay Payment Link) that adds `amount_minor` to the API token's organization wallet once the customer pays. Open `checkout_url` in a browser; nothing is charged until the customer pays there, and the wallet is credited only after the payment succeeds (poll `GET /billing/wallet` to confirm). The gateway and currency follow the organization's billing profile. Billing applies its minimums and refuses a frozen or closed wallet, an organization that is not billed, or (first top-up) an amount below the first top-up minimum: 422 `topup_rejected` with Billing's `message`. An organization without a wallet gets 404 `wallet_not_found`; no wallet is created. The token's principal also needs permission to manage the organization's billing; a restricted or suspended organization can still top up. Requires scope: billing.topup.\n\nAPI: POST /billing/topups (createBillingTopup).", short_help='Create a wallet top-up link')
28
+ @handle_api_errors
29
+ def create_billing_topup(
30
+ ctx: typer.Context,
31
+ amount_minor: int = typer.Option(..., '--amount-minor', show_default=False, help="Amount to add, an integer in the wallet currency's minor unit (paise for INR, cents for USD). Billing applies its minimum."),
32
+ idempotency_key: Optional[str] = typer.Option(None, '--idempotency-key', show_default=False, help="Retry key for this top-up, scoped to the organization's wallet. A repeated key returns the payment link (and amount) it first created. Without a key, every call creates a new payment link."),
33
+ ) -> None:
34
+ client = sdk(ctx)
35
+ result = client.billing.create_billing_topup(
36
+ **compact(
37
+ workspace_id=workspace(ctx),
38
+ amount_minor=amount_minor,
39
+ idempotency_key=idempotency_key,
40
+ ),
41
+ )
42
+ emit(result)
@@ -1,4 +1,4 @@
1
- # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.9.0).
1
+ # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.10.0).
2
2
  # Do not edit by hand: change the contract or the generator and run the script again.
3
3
  """``ibee block-storage``: Block Storage volumes and plans (one command per contract operation)."""
4
4
 
@@ -1,4 +1,4 @@
1
- # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.9.0).
1
+ # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.10.0).
2
2
  # Do not edit by hand: change the contract or the generator and run the script again.
3
3
  """``ibee buckets``: Object Storage buckets, bucket settings and S3 credentials (one command per contract operation)."""
4
4
 
@@ -141,7 +141,7 @@ def set_bucket_lifecycle(
141
141
  emit(result)
142
142
 
143
143
 
144
- @lifecycle_app.command('delete', help='Delete bucket lifecycle rules.\n\nTemporarily paused on the public API. This client method is retained for compatibility. An empty HTTP 404 means the public operation is paused; it does not prove the resource was deleted. Removes every lifecycle rule from the bucket. Requires scope: object-storage.write.\n\nAPI: DELETE /object-storage/buckets/{bucket_name}/lifecycle (deleteBucketLifecycle).', short_help='Delete bucket lifecycle rules')
144
+ @lifecycle_app.command('delete', help='Delete bucket lifecycle rules.\n\nTemporarily paused on the public API. This client method is retained for compatibility. An empty HTTP 404 means the public operation is paused; it does not prove the resource was deleted. Removes every lifecycle rule from the bucket. Requires scope: object-storage.delete.\n\nAPI: DELETE /object-storage/buckets/{bucket_name}/lifecycle (deleteBucketLifecycle).', short_help='Delete bucket lifecycle rules')
145
145
  @handle_api_errors
146
146
  def delete_bucket_lifecycle(
147
147
  ctx: typer.Context,
@@ -183,7 +183,7 @@ def set_bucket_cors(
183
183
  emit(result)
184
184
 
185
185
 
186
- @cors_app.command('delete', help='Delete bucket CORS rules.\n\nTemporarily paused on the public API. This client method is retained for compatibility. An empty HTTP 404 means the public operation is paused; it does not prove the resource was deleted. Removes every CORS rule from the bucket. Requires scope: object-storage.write.\n\nAPI: DELETE /object-storage/buckets/{bucket_name}/cors (deleteBucketCors).', short_help='Delete bucket CORS rules')
186
+ @cors_app.command('delete', help='Delete bucket CORS rules.\n\nTemporarily paused on the public API. This client method is retained for compatibility. An empty HTTP 404 means the public operation is paused; it does not prove the resource was deleted. Removes every CORS rule from the bucket. Requires scope: object-storage.delete.\n\nAPI: DELETE /object-storage/buckets/{bucket_name}/cors (deleteBucketCors).', short_help='Delete bucket CORS rules')
187
187
  @handle_api_errors
188
188
  def delete_bucket_cors(
189
189
  ctx: typer.Context,
@@ -254,7 +254,7 @@ def set_bucket_notifications(
254
254
  emit(result)
255
255
 
256
256
 
257
- @notifications_app.command('delete', help='Delete bucket event notifications.\n\nTemporarily paused on the public API. This client method is retained for compatibility. An empty HTTP 404 means the public operation is paused; it does not prove the resource was deleted. Removes every notification rule from the bucket. Requires scope: object-storage.write.\n\nAPI: DELETE /object-storage/buckets/{bucket_name}/notifications (deleteBucketNotifications).', short_help='Delete bucket event notifications')
257
+ @notifications_app.command('delete', help='Delete bucket event notifications.\n\nTemporarily paused on the public API. This client method is retained for compatibility. An empty HTTP 404 means the public operation is paused; it does not prove the resource was deleted. Removes every notification rule from the bucket. Requires scope: object-storage.delete.\n\nAPI: DELETE /object-storage/buckets/{bucket_name}/notifications (deleteBucketNotifications).', short_help='Delete bucket event notifications')
258
258
  @handle_api_errors
259
259
  def delete_bucket_notifications(
260
260
  ctx: typer.Context,
@@ -301,7 +301,7 @@ def add_bucket_custom_domain(
301
301
  emit(result)
302
302
 
303
303
 
304
- @domains_app.command('remove', help='Remove a bucket custom domain.\n\nTemporarily paused on the public API. This client method is retained for compatibility. An empty HTTP 404 means the public operation is paused; it does not prove the resource was deleted. Removes a custom hostname from the bucket. Answers 400 when the bucket has no custom domain. Requires scope: object-storage.write.\n\nAPI: DELETE /object-storage/buckets/{bucket_name}/custom-domains/{domain} (removeBucketCustomDomain).', short_help='Remove a bucket custom domain')
304
+ @domains_app.command('remove', help='Remove a bucket custom domain.\n\nTemporarily paused on the public API. This client method is retained for compatibility. An empty HTTP 404 means the public operation is paused; it does not prove the resource was deleted. Removes a custom hostname from the bucket. Answers 400 when the bucket has no custom domain. Requires scope: object-storage.delete.\n\nAPI: DELETE /object-storage/buckets/{bucket_name}/custom-domains/{domain} (removeBucketCustomDomain).', short_help='Remove a bucket custom domain')
305
305
  @handle_api_errors
306
306
  def remove_bucket_custom_domain(
307
307
  ctx: typer.Context,
@@ -1,4 +1,4 @@
1
- # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.9.0).
1
+ # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.10.0).
2
2
  # Do not edit by hand: change the contract or the generator and run the script again.
3
3
  """``ibee cdn``: CDN distributions, website configuration and custom domains (one command per contract operation)."""
4
4
 
@@ -1,4 +1,4 @@
1
- # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.9.0).
1
+ # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.10.0).
2
2
  # Do not edit by hand: change the contract or the generator and run the script again.
3
3
  """``ibee compute``: Compute catalog: sites, plans, images and recovery storage plans (one command per contract operation)."""
4
4
 
@@ -1,4 +1,4 @@
1
- # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.9.0).
1
+ # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.10.0).
2
2
  # Do not edit by hand: change the contract or the generator and run the script again.
3
3
  """``ibee firewalls``: Firewall groups, rules and attachments (one command per contract operation)."""
4
4
 
@@ -43,7 +43,7 @@ def create_firewall_group(
43
43
  name: str = typer.Option(..., '--name', show_default=False, help='Display name of the group.'),
44
44
  description: Optional[str] = typer.Option(None, '--description', show_default=False, help='Optional description.'),
45
45
  is_default: Optional[bool] = typer.Option(None, '--is-default/--no-is-default', show_default=False, help="Mark the group as the workspace's default group. Default false."),
46
- idempotency_key: Optional[str] = typer.Option(None, '--idempotency-key', show_default=False, help='Retry the identical networking create with the same key to receive its dispatched create outcome for 24 hours. The key is scoped to organization, workspace and path. Reusing a dispatched key with a different request returns 409. Admission or validation refusals before a create is dispatched may be retried after correcting them. A pending or uncertain first request returns 409 with Retry-After; keep using the same body and key while its outcome is checked.'),
46
+ idempotency_key: Optional[str] = typer.Option(None, '--idempotency-key', show_default=False, help='Retry key for this create. Send the same key and the same body on every retry. The key is scoped to organization, workspace and path. - Create completed: you get the original answer for 24 hours, even if the plan limit has since been reached. - Refused or never sent: nothing was created, so the key is free to use again, including with a corrected body. - Unknown outcome (timeout, server error, lost connection): 409 `idempotency_in_progress` with `Retry-After`. This usually lasts 30 seconds and at most 3 minutes. Keep retrying with the same key and body. The next retry returns the Reserved IP, subnet or NAT gateway. For a VPC, firewall group or port forward, it either creates the resource or answers 409 "already exists". - Changed body, while the outcome is unresolved or after the create completed: 409 `idempotency_conflict`. - New key at the plan limit: 402.'),
47
47
  ) -> None:
48
48
  client = sdk(ctx)
49
49
  result = client.firewalls.create_firewall_group(
@@ -1,4 +1,4 @@
1
- # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.9.0).
1
+ # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.10.0).
2
2
  # Do not edit by hand: change the contract or the generator and run the script again.
3
3
  """``ibee gpus``: GPU VMs (one command per contract operation)."""
4
4
 
@@ -113,12 +113,12 @@ def get_gpu_vm(
113
113
  emit(result)
114
114
 
115
115
 
116
- @app.command('delete', help='Delete a GPU VM.\n\nDeletes a GPU VM. Returns an operation you can poll for status. A VM with an automatically assigned public IP needs `public_ip_action` in the body. Asynchronous: the response carries `operation_id`; poll `GET /compute/operations/{operation_id}` until `status` is `succeeded`, `failed`, `cancelled` or `timed_out`. If your client times out, read the status; never resubmit the request. Requires scope: vm.write.\n\nAPI: DELETE /compute/gpu-vms/{vm_id} (deleteGpuVm).', short_help='Delete a GPU VM')
116
+ @app.command('delete', help="Delete a GPU VM.\n\nDeletes a GPU VM. Returns an operation you can poll for status. A VM with an automatically assigned public IP needs `public_ip_action` in the body. If the VM's IP is already a Reserved IP, send no body: `release` and `reserve` are both refused with 400. The IP stays in the workspace and keeps billing until you release it from Reserved IPs. Asynchronous: the response carries `operation_id`; poll `GET /compute/operations/{operation_id}` until `status` is `succeeded`, `failed`, `cancelled` or `timed_out`. If your client times out, read the status; never resubmit the request. Requires scope: vm.write.\n\nAPI: DELETE /compute/gpu-vms/{vm_id} (deleteGpuVm).", short_help='Delete a GPU VM')
117
117
  @handle_api_errors
118
118
  def delete_gpu_vm(
119
119
  ctx: typer.Context,
120
120
  vm_id: str = typer.Argument(..., metavar='VM_ID', show_default=False, help='Virtual machine ID.'),
121
- public_ip_action: Optional[str] = typer.Option(None, '--public-ip-action', show_default=False, help="What to do with the VM's automatically assigned public IP. `reserve` converts it to a Reserved IP in this workspace; `release` releases it with the VM. Required when the VM has an automatically assigned public IP. `reserve` on a VM without one is refused with 400."),
121
+ public_ip_action: Optional[str] = typer.Option(None, '--public-ip-action', show_default=False, help="What to do with the VM's automatically assigned public IP. `reserve` converts it to a Reserved IP in this workspace; `release` releases it with the VM. Required when the VM has an automatically assigned public IP. `reserve` on a VM without one is refused with 400. If the IP has already been converted to a Reserved IP, `release` and `reserve` are both refused with 400: delete with no body to keep the IP, then release it from Reserved IPs to stop its billing."),
122
122
  reserved_ip_label: Optional[str] = typer.Option(None, '--reserved-ip-label', show_default=False, help='Label for the Reserved IP that `reserve` creates. Blank is treated as not set.'),
123
123
  reserved_ip_billing_catalog: Optional[str] = typer.Option(None, '--reserved-ip-billing-catalog', metavar='JSON', show_default=False, help='Billing catalog identifiers used to bill the Reserved IP that `reserve` creates. Required with `public_ip_action: reserve`, with a non-empty `sku_id`; refused with 400 otherwise. JSON (@FILE reads a file, @- stdin).'),
124
124
  idempotency_key: Optional[str] = typer.Option(None, '--idempotency-key', show_default=False, help='Unique key used to safely retry write operations.'),
@@ -262,14 +262,17 @@ def precheck_gpu_vm_resize(
262
262
  emit(result)
263
263
 
264
264
 
265
- @app.command('resize', help="Resize a GPU VM.\n\nChanges a GPU VM's CPU and memory, and optionally grows its root disk, after the same precheck the portal runs. Asynchronous: the response carries `operation_id`; poll `GET /compute/operations/{operation_id}` until `status` is `succeeded`, `failed`, `cancelled` or `timed_out`. If your client times out, read the status; never resubmit the request. Requires scope: vm.write.\n\nAPI: POST /compute/gpu-vms/{vm_id}/actions/resize (resizeGpuVm).", short_help='Resize a GPU VM')
265
+ @app.command('resize', help="Resize a GPU VM.\n\nMoves a GPU VM to another plan with the same GPU: send the target plan's `cpu`, `ram_mb`, `disk_gb` and `billing_catalog` (see the request body). The root disk can grow, never shrink. The same precheck the portal runs is applied first. Asynchronous: the response carries `operation_id`; poll `GET /compute/operations/{operation_id}` until `status` is `succeeded`, `failed`, `cancelled` or `timed_out`. If your client times out, read the status; never resubmit the request. Requires scope: vm.write.\n\nSend the target plan's exact --cpu, --ram-mb and --disk-gb. billing_catalog: pass --billing-catalog JSON, or --plan-id PLAN_ID --billing-interval HOURLY|MONTHLY to send that plan's billing_catalog from GET /compute/plans with the billing_options entry merged in (--plan-id is not sent).\n\nAPI: POST /compute/gpu-vms/{vm_id}/actions/resize (resizeGpuVm).", short_help='Resize a GPU VM')
266
266
  @handle_api_errors
267
267
  def resize_gpu_vm(
268
268
  ctx: typer.Context,
269
269
  vm_id: str = typer.Argument(..., metavar='VM_ID', show_default=False, help='Virtual machine ID.'),
270
- cpu: Optional[int] = typer.Option(None, '--cpu', show_default=False, help='Target vCPUs.'),
271
- ram_mb: Optional[int] = typer.Option(None, '--ram-mb', show_default=False, help='Target memory in MB.'),
272
- disk_gb: Optional[int] = typer.Option(None, '--disk-gb', show_default=False, help='Target root disk size in GB.'),
270
+ cpu: int = typer.Option(..., '--cpu', show_default=False, help='Target vCPUs, from the target plan.'),
271
+ ram_mb: int = typer.Option(..., '--ram-mb', show_default=False, help='Target memory in MB, from the target plan.'),
272
+ disk_gb: int = typer.Option(..., '--disk-gb', show_default=False, help='Target root disk size in GB, from the target plan. The disk can grow, never shrink.'),
273
+ billing_catalog: Optional[str] = typer.Option(None, '--billing-catalog', metavar='JSON', show_default=False, help="Copy the selected plan's billing_catalog, choose one supported HOURLY or MONTHLY entry from its billing_options, and merge that complete entry into the copy. Send the result here, including the canonical price_currency. Hourly requests also require an explicit selected term. Do not invent prices, drop commitment fields from the selected option, or send only billing_interval and committed. Admission validates the selection against the server's current catalog. Amounts remain server-authoritative. JSON (@FILE reads a file, @- stdin)."),
274
+ plan_id: Optional[str] = typer.Option(None, '--plan-id', show_default=False, help='Target plan from GET /compute/plans: with --billing-interval, its billing_catalog is sent. Not sent itself.'),
275
+ billing_interval: Optional[str] = typer.Option(None, '--billing-interval', show_default=False, help='HOURLY or MONTHLY: send the --plan-id plan\'s billing_catalog from GET /compute/plans with its billing_options entry for this interval merged in (instead of --billing-catalog).'),
273
276
  idempotency_key: Optional[str] = typer.Option(None, '--idempotency-key', show_default=False, help='Unique key used to safely retry write operations.'),
274
277
  ) -> None:
275
278
  client = sdk(ctx)
@@ -280,6 +283,7 @@ def resize_gpu_vm(
280
283
  cpu=cpu,
281
284
  ram_mb=ram_mb,
282
285
  disk_gb=disk_gb,
286
+ billing_catalog=vm_billing_catalog(client, workspace(ctx), 'gpu', plan_id, None, billing_catalog, billing_interval),
283
287
  idempotency_key=idempotency_key,
284
288
  ),
285
289
  )
@@ -607,7 +611,7 @@ def disable_gpu_vm_backups(
607
611
  emit(result)
608
612
 
609
613
 
610
- @backups_app.command('list', help='List GPU VM recovery points.\n\nLists backup runs and usable recovery points for one GPU VM. Requires scope: vm.read.\n\nAPI: GET /compute/gpu-vms/{vm_id}/backups/runs (listGpuVmBackupRuns).', short_help='List GPU VM recovery points')
614
+ @backups_app.command('list', help="List GPU VM recovery points.\n\nLists the finished, successful backup runs (usable recovery points) of one GPU VM, newest first. A run being deleted shows `status: deleting`. Queued, running, failed and cancelled runs are not listed: read a run by ID with `GET /compute/gpu-vm-backups/runs/{run_id}` to see those states. The backup policy's `last_status` shows how the latest finished run ended. Requires scope: vm.read.\n\nAPI: GET /compute/gpu-vms/{vm_id}/backups/runs (listGpuVmBackupRuns).", short_help='List GPU VM recovery points')
611
615
  @handle_api_errors
612
616
  def list_gpu_vm_backup_runs(
613
617
  ctx: typer.Context,
@@ -695,12 +699,12 @@ def restore_gpu_vm_backup(
695
699
  emit(result)
696
700
 
697
701
 
698
- @backups_app.command('list-all', help="List Gpu VM backup runs in the workspace.\n\nLists backup runs and recovery points of every Gpu VM in the workspace, as the portal's Backups page does. Filter by `vm_id` or `status`. Requires scope: vm.read.\n\nAPI: GET /compute/gpu-vm-backups/runs (listAllGpuVmBackupRuns).", short_help='List Gpu VM backup runs in the workspace')
702
+ @backups_app.command('list-all', help="List Gpu VM backup runs in the workspace.\n\nLists the finished, successful backup runs (usable recovery points) of every Gpu VM in the workspace, newest first, as the portal's Backups page does. A run being deleted shows `status: deleting`. Queued, running, failed and cancelled runs are not listed: read a run by ID with `GET /compute/gpu-vm-backups/runs/{run_id}` to see those states. Filter by `vm_id` or `status`. Requires scope: vm.read.\n\nAPI: GET /compute/gpu-vm-backups/runs (listAllGpuVmBackupRuns).", short_help='List Gpu VM backup runs in the workspace')
699
703
  @handle_api_errors
700
704
  def list_all_gpu_vm_backup_runs(
701
705
  ctx: typer.Context,
702
706
  vm_id: Optional[str] = typer.Option(None, '--vm-id', show_default=False, help='Return only runs of this VM.'),
703
- status: Optional[List[str]] = typer.Option(None, '--status', show_default=False, help='Return only runs in these states. Repeat the parameter for several states. One of: queued, running, succeeded, failed, cancelled, deleting.'),
707
+ status: Optional[List[str]] = typer.Option(None, '--status', show_default=False, help='Return only runs in these states. Repeat the parameter for several states. Only `succeeded` and `deleting` can match; any other state returns an empty list. One of: queued, running, succeeded, failed, cancelled, deleting.'),
704
708
  limit: Optional[int] = typer.Option(None, '--limit', show_default=False, help='Maximum number of records to return.'),
705
709
  offset: Optional[int] = typer.Option(None, '--offset', show_default=False, help='Number of items to skip before the first returned item. Default 0.'),
706
710
  search: Optional[str] = typer.Option(None, '--search', show_default=False, help='Return only backup runs whose fields contain this text.'),
@@ -1,4 +1,4 @@
1
- # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.9.0).
1
+ # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.10.0).
2
2
  # Do not edit by hand: change the contract or the generator and run the script again.
3
3
  """``ibee load-balancers``: L4 and L7 load balancers (one command per contract operation)."""
4
4
 
@@ -1,4 +1,4 @@
1
- # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.9.0).
1
+ # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.10.0).
2
2
  # Do not edit by hand: change the contract or the generator and run the script again.
3
3
  """``ibee ops``: Async compute operations of cloud and GPU VMs (one command per contract operation)."""
4
4
 
@@ -1,4 +1,4 @@
1
- # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.9.0).
1
+ # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.10.0).
2
2
  # Do not edit by hand: change the contract or the generator and run the script again.
3
3
  """``ibee registries``: Container Registry (one command per contract operation)."""
4
4
 
@@ -1,4 +1,4 @@
1
- # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.9.0).
1
+ # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.10.0).
2
2
  # Do not edit by hand: change the contract or the generator and run the script again.
3
3
  """``ibee reserved-ips``: Reserved IPs (one command per contract operation)."""
4
4
 
@@ -31,7 +31,7 @@ def reserve_ip(
31
31
  ctx: typer.Context,
32
32
  site_id: str = typer.Option(..., '--site-id', show_default=False, help="Site whose public IP pool allocates the address. Copy an available `site_id` from `GET /networking/sites`; use the target VM or VPC's site when the address will be attached."),
33
33
  label: Optional[str] = typer.Option(None, '--label', show_default=False, help='Optional label for the address (up to 120 characters), shown as its name in the portal.'),
34
- idempotency_key: Optional[str] = typer.Option(None, '--idempotency-key', show_default=False, help='Retry the identical networking create with the same key to receive its dispatched create outcome for 24 hours. The key is scoped to organization, workspace and path. Reusing a dispatched key with a different request returns 409. Admission or validation refusals before a create is dispatched may be retried after correcting them. A pending or uncertain first request returns 409 with Retry-After; keep using the same body and key while its outcome is checked.'),
34
+ idempotency_key: Optional[str] = typer.Option(None, '--idempotency-key', show_default=False, help='Retry key for this create. Send the same key and the same body on every retry. The key is scoped to organization, workspace and path. - Create completed: you get the original answer for 24 hours, even if the plan limit has since been reached. - Refused or never sent: nothing was created, so the key is free to use again, including with a corrected body. - Unknown outcome (timeout, server error, lost connection): 409 `idempotency_in_progress` with `Retry-After`. This usually lasts 30 seconds and at most 3 minutes. Keep retrying with the same key and body. The next retry returns the Reserved IP, subnet or NAT gateway. For a VPC, firewall group or port forward, it either creates the resource or answers 409 "already exists". - Changed body, while the outcome is unresolved or after the create completed: 409 `idempotency_conflict`. - New key at the plan limit: 402.'),
35
35
  ) -> None:
36
36
  client = sdk(ctx)
37
37
  result = client.reserved_ips.reserve_ip(
@@ -1,4 +1,4 @@
1
- # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.9.0).
1
+ # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.10.0).
2
2
  # Do not edit by hand: change the contract or the generator and run the script again.
3
3
  """``ibee secrets``: Secret Store: stores, secrets, application identities and their scopes (one command per contract operation)."""
4
4
 
@@ -1,4 +1,4 @@
1
- # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.9.0).
1
+ # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.10.0).
2
2
  # Do not edit by hand: change the contract or the generator and run the script again.
3
3
  """``ibee vms``: Cloud VMs (one command per contract operation)."""
4
4
 
@@ -113,12 +113,12 @@ def get_cloud_vm(
113
113
  emit(result)
114
114
 
115
115
 
116
- @app.command('delete', help='Delete a cloud VM.\n\nDeletes a cloud VM. Returns an operation you can poll for status. A VM with an automatically assigned public IP needs `public_ip_action` in the body. Asynchronous: the response carries `operation_id`; poll `GET /compute/operations/{operation_id}` until `status` is `succeeded`, `failed`, `cancelled` or `timed_out`. If your client times out, read the status; never resubmit the request. Requires scope: vm.write.\n\nAPI: DELETE /compute/cloud-vms/{vm_id} (deleteCloudVm).', short_help='Delete a cloud VM')
116
+ @app.command('delete', help="Delete a cloud VM.\n\nDeletes a cloud VM. Returns an operation you can poll for status. A VM with an automatically assigned public IP needs `public_ip_action` in the body. If the VM's IP is already a Reserved IP, send no body: `release` and `reserve` are both refused with 400. The IP stays in the workspace and keeps billing until you release it from Reserved IPs. Asynchronous: the response carries `operation_id`; poll `GET /compute/operations/{operation_id}` until `status` is `succeeded`, `failed`, `cancelled` or `timed_out`. If your client times out, read the status; never resubmit the request. Requires scope: vm.write.\n\nAPI: DELETE /compute/cloud-vms/{vm_id} (deleteCloudVm).", short_help='Delete a cloud VM')
117
117
  @handle_api_errors
118
118
  def delete_cloud_vm(
119
119
  ctx: typer.Context,
120
120
  vm_id: str = typer.Argument(..., metavar='VM_ID', show_default=False, help='Virtual machine ID.'),
121
- public_ip_action: Optional[str] = typer.Option(None, '--public-ip-action', show_default=False, help="What to do with the VM's automatically assigned public IP. `reserve` converts it to a Reserved IP in this workspace; `release` releases it with the VM. Required when the VM has an automatically assigned public IP. `reserve` on a VM without one is refused with 400."),
121
+ public_ip_action: Optional[str] = typer.Option(None, '--public-ip-action', show_default=False, help="What to do with the VM's automatically assigned public IP. `reserve` converts it to a Reserved IP in this workspace; `release` releases it with the VM. Required when the VM has an automatically assigned public IP. `reserve` on a VM without one is refused with 400. If the IP has already been converted to a Reserved IP, `release` and `reserve` are both refused with 400: delete with no body to keep the IP, then release it from Reserved IPs to stop its billing."),
122
122
  reserved_ip_label: Optional[str] = typer.Option(None, '--reserved-ip-label', show_default=False, help='Label for the Reserved IP that `reserve` creates. Blank is treated as not set.'),
123
123
  reserved_ip_billing_catalog: Optional[str] = typer.Option(None, '--reserved-ip-billing-catalog', metavar='JSON', show_default=False, help='Billing catalog identifiers used to bill the Reserved IP that `reserve` creates. Required with `public_ip_action: reserve`, with a non-empty `sku_id`; refused with 400 otherwise. JSON (@FILE reads a file, @- stdin).'),
124
124
  idempotency_key: Optional[str] = typer.Option(None, '--idempotency-key', show_default=False, help='Unique key used to safely retry write operations.'),
@@ -262,14 +262,17 @@ def precheck_cloud_vm_resize(
262
262
  emit(result)
263
263
 
264
264
 
265
- @app.command('resize', help="Resize a cloud VM.\n\nChanges a cloud VM's CPU and memory, and optionally grows its root disk, after the same precheck the portal runs. Asynchronous: the response carries `operation_id`; poll `GET /compute/operations/{operation_id}` until `status` is `succeeded`, `failed`, `cancelled` or `timed_out`. If your client times out, read the status; never resubmit the request. Requires scope: vm.write.\n\nAPI: POST /compute/cloud-vms/{vm_id}/actions/resize (resizeCloudVm).", short_help='Resize a cloud VM')
265
+ @app.command('resize', help="Resize a cloud VM.\n\nMoves a cloud VM to another plan: send the target plan's `cpu`, `ram_mb`, `disk_gb` and `billing_catalog` (see the request body). The root disk can grow, never shrink. The same precheck the portal runs is applied first. Asynchronous: the response carries `operation_id`; poll `GET /compute/operations/{operation_id}` until `status` is `succeeded`, `failed`, `cancelled` or `timed_out`. If your client times out, read the status; never resubmit the request. Requires scope: vm.write.\n\nSend the target plan's exact --cpu, --ram-mb and --disk-gb. billing_catalog: pass --billing-catalog JSON, or --plan-id PLAN_ID --billing-interval HOURLY|MONTHLY to send that plan's billing_catalog from GET /compute/plans with the billing_options entry merged in (--plan-id is not sent).\n\nAPI: POST /compute/cloud-vms/{vm_id}/actions/resize (resizeCloudVm).", short_help='Resize a cloud VM')
266
266
  @handle_api_errors
267
267
  def resize_cloud_vm(
268
268
  ctx: typer.Context,
269
269
  vm_id: str = typer.Argument(..., metavar='VM_ID', show_default=False, help='Virtual machine ID.'),
270
- cpu: Optional[int] = typer.Option(None, '--cpu', show_default=False, help='Target vCPUs.'),
271
- ram_mb: Optional[int] = typer.Option(None, '--ram-mb', show_default=False, help='Target memory in MB.'),
272
- disk_gb: Optional[int] = typer.Option(None, '--disk-gb', show_default=False, help='Target root disk size in GB.'),
270
+ cpu: int = typer.Option(..., '--cpu', show_default=False, help='Target vCPUs, from the target plan.'),
271
+ ram_mb: int = typer.Option(..., '--ram-mb', show_default=False, help='Target memory in MB, from the target plan.'),
272
+ disk_gb: int = typer.Option(..., '--disk-gb', show_default=False, help='Target root disk size in GB, from the target plan. The disk can grow, never shrink.'),
273
+ billing_catalog: Optional[str] = typer.Option(None, '--billing-catalog', metavar='JSON', show_default=False, help="Copy the selected plan's billing_catalog, choose one supported HOURLY or MONTHLY entry from its billing_options, and merge that complete entry into the copy. Send the result here, including the canonical price_currency. Hourly requests also require an explicit selected term. Do not invent prices, drop commitment fields from the selected option, or send only billing_interval and committed. Admission validates the selection against the server's current catalog. Amounts remain server-authoritative. JSON (@FILE reads a file, @- stdin)."),
274
+ plan_id: Optional[str] = typer.Option(None, '--plan-id', show_default=False, help='Target plan from GET /compute/plans: with --billing-interval, its billing_catalog is sent. Not sent itself.'),
275
+ billing_interval: Optional[str] = typer.Option(None, '--billing-interval', show_default=False, help='HOURLY or MONTHLY: send the --plan-id plan\'s billing_catalog from GET /compute/plans with its billing_options entry for this interval merged in (instead of --billing-catalog).'),
273
276
  idempotency_key: Optional[str] = typer.Option(None, '--idempotency-key', show_default=False, help='Unique key used to safely retry write operations.'),
274
277
  ) -> None:
275
278
  client = sdk(ctx)
@@ -280,6 +283,7 @@ def resize_cloud_vm(
280
283
  cpu=cpu,
281
284
  ram_mb=ram_mb,
282
285
  disk_gb=disk_gb,
286
+ billing_catalog=vm_billing_catalog(client, workspace(ctx), 'cloud', plan_id, None, billing_catalog, billing_interval),
283
287
  idempotency_key=idempotency_key,
284
288
  ),
285
289
  )
@@ -607,7 +611,7 @@ def disable_cloud_vm_backups(
607
611
  emit(result)
608
612
 
609
613
 
610
- @backups_app.command('list', help='List cloud VM recovery points.\n\nLists backup runs and usable recovery points for one cloud VM. Requires scope: vm.read.\n\nAPI: GET /compute/cloud-vms/{vm_id}/backups/runs (listCloudVmBackupRuns).', short_help='List cloud VM recovery points')
614
+ @backups_app.command('list', help="List cloud VM recovery points.\n\nLists the finished, successful backup runs (usable recovery points) of one cloud VM, newest first. A run being deleted shows `status: deleting`. Queued, running, failed and cancelled runs are not listed: read a run by ID with `GET /compute/cloud-vm-backups/runs/{run_id}` to see those states. The backup policy's `last_status` shows how the latest finished run ended. Requires scope: vm.read.\n\nAPI: GET /compute/cloud-vms/{vm_id}/backups/runs (listCloudVmBackupRuns).", short_help='List cloud VM recovery points')
611
615
  @handle_api_errors
612
616
  def list_cloud_vm_backup_runs(
613
617
  ctx: typer.Context,
@@ -695,12 +699,12 @@ def restore_cloud_vm_backup(
695
699
  emit(result)
696
700
 
697
701
 
698
- @backups_app.command('list-all', help="List Cloud VM backup runs in the workspace.\n\nLists backup runs and recovery points of every Cloud VM in the workspace, as the portal's Backups page does. Filter by `vm_id` or `status`. Requires scope: vm.read.\n\nAPI: GET /compute/cloud-vm-backups/runs (listAllCloudVmBackupRuns).", short_help='List Cloud VM backup runs in the workspace')
702
+ @backups_app.command('list-all', help="List Cloud VM backup runs in the workspace.\n\nLists the finished, successful backup runs (usable recovery points) of every Cloud VM in the workspace, newest first, as the portal's Backups page does. A run being deleted shows `status: deleting`. Queued, running, failed and cancelled runs are not listed: read a run by ID with `GET /compute/cloud-vm-backups/runs/{run_id}` to see those states. Filter by `vm_id` or `status`. Requires scope: vm.read.\n\nAPI: GET /compute/cloud-vm-backups/runs (listAllCloudVmBackupRuns).", short_help='List Cloud VM backup runs in the workspace')
699
703
  @handle_api_errors
700
704
  def list_all_cloud_vm_backup_runs(
701
705
  ctx: typer.Context,
702
706
  vm_id: Optional[str] = typer.Option(None, '--vm-id', show_default=False, help='Return only runs of this VM.'),
703
- status: Optional[List[str]] = typer.Option(None, '--status', show_default=False, help='Return only runs in these states. Repeat the parameter for several states. One of: queued, running, succeeded, failed, cancelled, deleting.'),
707
+ status: Optional[List[str]] = typer.Option(None, '--status', show_default=False, help='Return only runs in these states. Repeat the parameter for several states. Only `succeeded` and `deleting` can match; any other state returns an empty list. One of: queued, running, succeeded, failed, cancelled, deleting.'),
704
708
  limit: Optional[int] = typer.Option(None, '--limit', show_default=False, help='Maximum number of records to return.'),
705
709
  offset: Optional[int] = typer.Option(None, '--offset', show_default=False, help='Number of items to skip before the first returned item. Default 0.'),
706
710
  search: Optional[str] = typer.Option(None, '--search', show_default=False, help='Return only backup runs whose fields contain this text.'),
@@ -1,4 +1,4 @@
1
- # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.9.0).
1
+ # Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.10.0).
2
2
  # Do not edit by hand: change the contract or the generator and run the script again.
3
3
  """``ibee vpcs``: VPCs, subnets, nodes, NAT gateways and port forwarding (one command per contract operation)."""
4
4
 
@@ -57,7 +57,7 @@ def create_vpc(
57
57
  default_subnet_cidr: Optional[str] = typer.Option(None, '--default-subnet-cidr', show_default=False, help='CIDR for that first subnet; chosen automatically when omitted.'),
58
58
  is_default: Optional[bool] = typer.Option(None, '--is-default/--no-is-default', show_default=False, help="Mark the VPC as the workspace's default VPC. Default false."),
59
59
  connectivity_type: Optional[str] = typer.Option(None, '--connectivity-type', show_default=False, help="The VPC's internet model; the server uses `public` when this is omitted. `public` keeps dedicated public IPs available to its VMs. `private` has no shared public edge, but a VM can still be given a Reserved IP. `nat_gateway` is a private VPC with managed outbound NAT and refuses dedicated public IPs."),
60
- idempotency_key: Optional[str] = typer.Option(None, '--idempotency-key', show_default=False, help='Retry the identical networking create with the same key to receive its dispatched create outcome for 24 hours. The key is scoped to organization, workspace and path. Reusing a dispatched key with a different request returns 409. Admission or validation refusals before a create is dispatched may be retried after correcting them. A pending or uncertain first request returns 409 with Retry-After; keep using the same body and key while its outcome is checked.'),
60
+ idempotency_key: Optional[str] = typer.Option(None, '--idempotency-key', show_default=False, help='Retry key for this create. Send the same key and the same body on every retry. The key is scoped to organization, workspace and path. - Create completed: you get the original answer for 24 hours, even if the plan limit has since been reached. - Refused or never sent: nothing was created, so the key is free to use again, including with a corrected body. - Unknown outcome (timeout, server error, lost connection): 409 `idempotency_in_progress` with `Retry-After`. This usually lasts 30 seconds and at most 3 minutes. Keep retrying with the same key and body. The next retry returns the Reserved IP, subnet or NAT gateway. For a VPC, firewall group or port forward, it either creates the resource or answers 409 "already exists". - Changed body, while the outcome is unresolved or after the create completed: 409 `idempotency_conflict`. - New key at the plan limit: 402.'),
61
61
  ) -> None:
62
62
  client = sdk(ctx)
63
63
  result = client.vpcs.create_vpc(
@@ -144,7 +144,7 @@ def create_vpc_subnet(
144
144
  auto_cidr: Optional[bool] = typer.Option(None, '--auto-cidr/--no-auto-cidr', show_default=False, help='Let the service choose a free CIDR when `cidr` is omitted. Default true.'),
145
145
  prefix_length: Optional[int] = typer.Option(None, '--prefix-length', show_default=False, help='Prefix length to use for an automatically chosen CIDR.'),
146
146
  dns: Optional[List[str]] = typer.Option(None, '--dns', show_default=False, help='DNS resolvers handed to instances in the subnet. Default `1.1.1.1` and `8.8.8.8`.'),
147
- idempotency_key: Optional[str] = typer.Option(None, '--idempotency-key', show_default=False, help='Retry the identical networking create with the same key to receive its dispatched create outcome for 24 hours. The key is scoped to organization, workspace and path. Reusing a dispatched key with a different request returns 409. Admission or validation refusals before a create is dispatched may be retried after correcting them. A pending or uncertain first request returns 409 with Retry-After; keep using the same body and key while its outcome is checked.'),
147
+ idempotency_key: Optional[str] = typer.Option(None, '--idempotency-key', show_default=False, help='Retry key for this create. Send the same key and the same body on every retry. The key is scoped to organization, workspace and path. - Create completed: you get the original answer for 24 hours, even if the plan limit has since been reached. - Refused or never sent: nothing was created, so the key is free to use again, including with a corrected body. - Unknown outcome (timeout, server error, lost connection): 409 `idempotency_in_progress` with `Retry-After`. This usually lasts 30 seconds and at most 3 minutes. Keep retrying with the same key and body. The next retry returns the Reserved IP, subnet or NAT gateway. For a VPC, firewall group or port forward, it either creates the resource or answers 409 "already exists". - Changed body, while the outcome is unresolved or after the create completed: 409 `idempotency_conflict`. - New key at the plan limit: 402.'),
148
148
  ) -> None:
149
149
  client = sdk(ctx)
150
150
  result = client.vpcs.create_vpc_subnet(
@@ -258,7 +258,7 @@ def create_nat_gateway(
258
258
  subnet_id: Optional[str] = typer.Option(None, '--subnet-id', show_default=False, help='Subnet the gateway is placed in; chosen by the service when omitted.'),
259
259
  reserved_public_ip_id: Optional[str] = typer.Option(None, '--reserved-public-ip-id', show_default=False, help="Reserved IP to use as the gateway's public address; a platform-assigned address is used when omitted."),
260
260
  name: Optional[str] = typer.Option(None, '--name', show_default=False, help='Display name of the gateway. Default `NAT Gateway`.'),
261
- idempotency_key: Optional[str] = typer.Option(None, '--idempotency-key', show_default=False, help='Retry the identical networking create with the same key to receive its dispatched create outcome for 24 hours. The key is scoped to organization, workspace and path. Reusing a dispatched key with a different request returns 409. Admission or validation refusals before a create is dispatched may be retried after correcting them. A pending or uncertain first request returns 409 with Retry-After; keep using the same body and key while its outcome is checked.'),
261
+ idempotency_key: Optional[str] = typer.Option(None, '--idempotency-key', show_default=False, help='Retry key for this create. Send the same key and the same body on every retry. The key is scoped to organization, workspace and path. - Create completed: you get the original answer for 24 hours, even if the plan limit has since been reached. - Refused or never sent: nothing was created, so the key is free to use again, including with a corrected body. - Unknown outcome (timeout, server error, lost connection): 409 `idempotency_in_progress` with `Retry-After`. This usually lasts 30 seconds and at most 3 minutes. Keep retrying with the same key and body. The next retry returns the Reserved IP, subnet or NAT gateway. For a VPC, firewall group or port forward, it either creates the resource or answers 409 "already exists". - Changed body, while the outcome is unresolved or after the create completed: 409 `idempotency_conflict`. - New key at the plan limit: 402.'),
262
262
  ) -> None:
263
263
  client = sdk(ctx)
264
264
  result = client.vpcs.create_nat_gateway(
@@ -349,7 +349,7 @@ def create_nat_port_forwarding_rule(
349
349
  target_vm_ids: Optional[List[str]] = typer.Option(None, '--target-vm-ids', show_default=False, help='VMs that announce the Virtual IP. Required with `vip`, must be empty with `vm`.'),
350
350
  note: Optional[str] = typer.Option(None, '--note', show_default=False, help='Free-text note stored with the rule. Default empty.'),
351
351
  enabled: Optional[bool] = typer.Option(None, '--enabled/--no-enabled', show_default=False, help='Whether the rule is applied. Default true.'),
352
- idempotency_key: Optional[str] = typer.Option(None, '--idempotency-key', show_default=False, help='Retry the identical networking create with the same key to receive its dispatched create outcome for 24 hours. The key is scoped to organization, workspace and path. Reusing a dispatched key with a different request returns 409. Admission or validation refusals before a create is dispatched may be retried after correcting them. A pending or uncertain first request returns 409 with Retry-After; keep using the same body and key while its outcome is checked.'),
352
+ idempotency_key: Optional[str] = typer.Option(None, '--idempotency-key', show_default=False, help='Retry key for this create. Send the same key and the same body on every retry. The key is scoped to organization, workspace and path. - Create completed: you get the original answer for 24 hours, even if the plan limit has since been reached. - Refused or never sent: nothing was created, so the key is free to use again, including with a corrected body. - Unknown outcome (timeout, server error, lost connection): 409 `idempotency_in_progress` with `Retry-After`. This usually lasts 30 seconds and at most 3 minutes. Keep retrying with the same key and body. The next retry returns the Reserved IP, subnet or NAT gateway. For a VPC, firewall group or port forward, it either creates the resource or answers 409 "already exists". - Changed body, while the outcome is unresolved or after the create completed: 409 `idempotency_conflict`. - New key at the plan limit: 402.'),
353
353
  ) -> None:
354
354
  client = sdk(ctx)
355
355
  result = client.vpcs.create_nat_port_forwarding_rule(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ibee-cli
3
- Version: 0.7.0
3
+ Version: 0.8.0
4
4
  Summary: Official command-line interface for the IBEE Solutions cloud platform
5
5
  Author-email: IBEE Solutions <support@ibee.ai>
6
6
  License-Expression: MIT
@@ -13,7 +13,7 @@ Classifier: Environment :: Console
13
13
  Requires-Python: >=3.10
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
- Requires-Dist: ibee<0.8,>=0.7.0
16
+ Requires-Dist: ibee<0.9,>=0.8.0
17
17
  Requires-Dist: httpx>=0.27
18
18
  Requires-Dist: typer>=0.12
19
19
  Requires-Dist: click>=8.1
@@ -33,7 +33,7 @@ CDN remains available.
33
33
 
34
34
  Official command-line interface for the IBEE Solutions cloud platform, built on the
35
35
  [`ibee` Python SDK](https://github.com/devs-ibee/ibee-python). It has one command per
36
- operation of the IBEE public API (contract 0.9.0, 229 operations): each command makes
36
+ operation of the IBEE public API (contract 0.10.0, 231 operations): each command makes
37
37
  that operation's one SDK call and prints the server's answer. The server decides
38
38
  prices, eligibility, limits and states; the CLI checks nothing before sending.
39
39
 
@@ -86,7 +86,8 @@ ibee vms create --name web-1 --site-id SITE_ID --plan-id PLAN_ID --template-id I
86
86
  --billing-interval HOURLY --ssh-keys "$(cat ~/.ssh/id_ed25519.pub)"
87
87
  ibee ops get OPERATION_ID
88
88
  ibee vms list --limit 20
89
- ibee vms resize VM_ID --cpu 4 --ram-mb 8192
89
+ ibee vms resize VM_ID --cpu 4 --ram-mb 8192 --disk-gb 80 --plan-id PLAN_ID --billing-interval HOURLY
90
+ ibee billing wallet
90
91
  ibee vms delete VM_ID --public-ip-action release --yes
91
92
 
92
93
  ibee buckets create --name assets --region in-south-2
@@ -107,6 +108,12 @@ exactly as the portal does. Nothing else is filled in: CPU, RAM, disk, OS and th
107
108
  other fields are sent as you give them. `MONTHLY` is a one-month commitment (the API
108
109
  answers `409 VM_COMMITTED` to a delete or resize before it ends).
109
110
 
111
+ `vms resize` and `gpus resize` move a VM to another plan. Send the target plan's exact
112
+ `--cpu`, `--ram-mb` and `--disk-gb`, and its `billing_catalog`: `--billing-catalog JSON`,
113
+ or `--plan-id PLAN_ID --billing-interval HOURLY|MONTHLY` to build it the same way from
114
+ `GET /compute/plans`. A resize body has no plan field, so `--plan-id` is only used for
115
+ this lookup and is not sent.
116
+
110
117
  ## Global options
111
118
 
112
119
  | Option | Environment variable | Meaning |
@@ -14,6 +14,7 @@ src/ibee_cli.egg-info/entry_points.txt
14
14
  src/ibee_cli.egg-info/requires.txt
15
15
  src/ibee_cli.egg-info/top_level.txt
16
16
  src/ibee_cli/commands/__init__.py
17
+ src/ibee_cli/commands/billing.py
17
18
  src/ibee_cli/commands/block_storage.py
18
19
  src/ibee_cli/commands/buckets.py
19
20
  src/ibee_cli/commands/cdn.py
@@ -1,4 +1,4 @@
1
- ibee<0.8,>=0.7.0
1
+ ibee<0.9,>=0.8.0
2
2
  httpx>=0.27
3
3
  typer>=0.12
4
4
  click>=8.1
@@ -22,7 +22,7 @@ EDGE_402 = {
22
22
  }
23
23
  REQ = {"x-request-id": "req-123"}
24
24
  GROUPS = ("vms", "gpus", "ops", "compute", "block-storage", "buckets", "cdn", "secrets", "vpcs", "reserved-ips",
25
- "firewalls", "load-balancers", "registries")
25
+ "firewalls", "load-balancers", "registries", "billing")
26
26
 
27
27
 
28
28
  def test_help_and_version() -> None:
@@ -30,9 +30,10 @@ def test_help_and_version() -> None:
30
30
  assert result.exit_code == 0
31
31
  for group in GROUPS:
32
32
  assert group in result.output
33
- for gone in ("billing", "console"):
34
- assert runner.invoke(app, [gone, "--help"]).exit_code == 2
35
- assert runner.invoke(app, ["--version"]).output.strip() == f"ibee-cli {__version__}" == "ibee-cli 0.7.0"
33
+ assert runner.invoke(app, ["console", "--help"]).exit_code == 2
34
+ # Contract 0.10.0 brings `billing` back with the wallet and top-ups only (no eligibility check).
35
+ assert runner.invoke(app, ["billing", "eligibility", "--help"]).exit_code == 2
36
+ assert runner.invoke(app, ["--version"]).output.strip() == f"ibee-cli {__version__}" == "ibee-cli 0.8.0"
36
37
 
37
38
 
38
39
  def test_missing_token_and_workspace_are_usage_errors(monkeypatch: pytest.MonkeyPatch) -> None:
@@ -58,6 +58,60 @@ def test_billing_interval_merges_the_plans_option_into_its_catalog(gw, group, vm
58
58
  assert json.loads(result.output) == ACCEPTED
59
59
 
60
60
 
61
+ @pytest.mark.parametrize(("group", "vm_type", "path"), [("vms", "cloud", "compute/cloud-vms"), ("gpus", "gpu", "compute/gpu-vms")])
62
+ def test_resize_builds_the_target_plans_catalog(gw, group, vm_type, path) -> None:
63
+ """Contract 0.10.0: a resize sends the target plan's size and billing_catalog; --plan-id is not sent."""
64
+ gw.on("GET", "compute/plans", plans(plan("other", vm_type), plan("plan-1", vm_type), vm_type=vm_type))
65
+ gw.on("POST", f"{path}/vm-1/actions/resize", (202, ACCEPTED))
66
+ result = run([group, "resize", "vm-1", "--cpu", "1", "--ram-mb", "2048", "--disk-gb", "50",
67
+ "--plan-id", "plan-1", "--billing-interval", "HOURLY"])
68
+ assert result.exit_code == 0, result.output
69
+ lookup, resize = gw.calls
70
+ assert (lookup.method, lookup.path) == ("GET", "compute/plans")
71
+ assert lookup.params == {"workspace_id": [WS], "vm_type": [vm_type]}
72
+ assert (resize.method, resize.path) == ("POST", f"{path}/vm-1/actions/resize")
73
+ assert resize.json == {"cpu": 1, "ram_mb": 2048, "disk_gb": 50, "billing_catalog": {**CATALOG, **HOURLY}}
74
+
75
+
76
+ @pytest.mark.parametrize(
77
+ ("extra", "message"),
78
+ [
79
+ ([], "--billing-interval"),
80
+ (["--billing-interval", "HOURLY"], "--plan-id"),
81
+ (["--plan-id", "plan-1", "--billing-interval", "HOURLY", "--billing-catalog", "{}"], "not both"),
82
+ ],
83
+ )
84
+ def test_resize_needs_one_catalog_source(gw, extra, message) -> None:
85
+ result = run(["vms", "resize", "vm-1", "--cpu", "1", "--ram-mb", "2048", "--disk-gb", "50", *extra])
86
+ assert result.exit_code == 2 and message in plain(result)
87
+ assert gw.calls == []
88
+
89
+
90
+ def test_resize_catalog_is_sent_as_given(gw) -> None:
91
+ gw.on("POST", "compute/cloud-vms/vm-1/actions/resize", (202, ACCEPTED))
92
+ selection = {**CATALOG, **HOURLY}
93
+ result = run(["vms", "resize", "vm-1", "--cpu", "1", "--ram-mb", "2048", "--disk-gb", "50",
94
+ "--billing-catalog", json.dumps(selection)])
95
+ assert result.exit_code == 0, result.output
96
+ assert [c.method for c in gw.calls] == ["POST"]
97
+ assert gw.calls[0].json == {"cpu": 1, "ram_mb": 2048, "disk_gb": 50, "billing_catalog": selection}
98
+
99
+
100
+ def test_billing_wallet_and_topup(gw) -> None:
101
+ wallet = {"organization_id": "org-1", "currency": "INR", "status": "ACTIVE", "available_paid_balance_minor": 100,
102
+ "available_promo_balance_minor": 0, "held_paid_balance_minor": 0, "total_balance_minor": 100}
103
+ topup = {"checkout_url": "https://pay.example.test/x", "gateway": "razorpay", "amount_minor": 100000,
104
+ "currency": "INR", "expires_at": None, "payment_attempt_id": "pa-1", "organization_id": "org-1"}
105
+ gw.on("GET", "billing/wallet", wallet)
106
+ gw.on("POST", "billing/topups", (201, topup))
107
+ assert json.loads(run(["billing", "wallet"]).output)["total_balance_minor"] == 100
108
+ result = run(["billing", "topup", "--amount-minor", "100000"])
109
+ assert result.exit_code == 0, result.output
110
+ assert json.loads(result.output)["checkout_url"] == topup["checkout_url"]
111
+ assert gw.calls[1].json == {"amount_minor": 100000}
112
+ assert gw.calls[1].headers.get("idempotency-key")
113
+
114
+
61
115
  def test_billing_catalog_is_sent_as_given_without_a_lookup(gw, tmp_path) -> None:
62
116
  gw.on("POST", "compute/cloud-vms", (202, ACCEPTED))
63
117
  selection = {**CATALOG, **HOURLY}
@@ -23,6 +23,7 @@ ROOT = pathlib.Path(__file__).resolve().parent.parent
23
23
  CONTRACT = yaml.safe_load((ROOT / "contract" / "ibee-cloud.yaml").read_text(encoding="utf-8"))
24
24
  COMPONENTS = CONTRACT["components"]
25
25
  VM_CREATES = {"createCloudVm", "createGpuVm"}
26
+ VM_RESIZES = {"resizeCloudVm", "resizeGpuVm"}
26
27
  #: Destructive commands besides DELETE: they ask for confirmation unless --yes.
27
28
  CONFIRMED_POSTS = {
28
29
  "archiveSecretStore", "revokeSecretIdentitySessions", "destroySecretVersions", "revokeS3Credential", "purgeCdnCache",
@@ -122,8 +123,8 @@ TREE = command_tree()
122
123
 
123
124
 
124
125
  def test_one_command_per_operation() -> None:
125
- assert len(OPS) == 229
126
- assert CONTRACT["info"]["version"] == "0.9.0"
126
+ assert len(OPS) == 231
127
+ assert CONTRACT["info"]["version"] == "0.10.0"
127
128
  assert set(TREE) == {op.id for op in OPS}
128
129
 
129
130
 
@@ -149,9 +150,11 @@ def test_flags_map_one_to_one(op: SimpleOp) -> None:
149
150
  expected = {op.option(p): bool(p.get("required")) and p["in"] != "header"
150
151
  for p in op.params if p["in"] in ("query", "header") and p["name"] != "workspace_id"}
151
152
  expected.update({"--" + name.replace("_", "-"): name in op.required for name in op.props})
152
- if op.id in VM_CREATES:
153
+ if op.id in VM_CREATES | VM_RESIZES:
153
154
  expected["--billing-catalog"] = False
154
155
  expected["--billing-interval"] = False
156
+ if op.id in VM_RESIZES:
157
+ expected["--plan-id"] = False # CLI-only: names the plan whose billing_catalog is sent
155
158
  if op.confirm:
156
159
  expected["--yes"] = False
157
160
  assert {name: option.required for name, option in options.items()} == expected
File without changes
File without changes
File without changes