ibee-cli 0.11.0__tar.gz → 0.13.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.
- {ibee_cli-0.11.0/src/ibee_cli.egg-info → ibee_cli-0.13.0}/PKG-INFO +33 -12
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/README.md +30 -9
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/pyproject.toml +3 -3
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/__init__.py +1 -1
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/commands/__init__.py +5 -2
- ibee_cli-0.13.0/src/ibee_cli/commands/api_tokens.py +82 -0
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/commands/billing.py +1 -1
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/commands/block_storage.py +1 -1
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/commands/buckets.py +4 -4
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/commands/cdn.py +1 -1
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/commands/compute.py +4 -4
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/commands/firewalls.py +1 -1
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/commands/gpus.py +1 -1
- ibee_cli-0.13.0/src/ibee_cli/commands/kubernetes.py +226 -0
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/commands/load_balancers.py +2 -2
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/commands/ops.py +1 -1
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/commands/registries.py +1 -1
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/commands/reserved_ips.py +1 -1
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/commands/secrets.py +1 -1
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/commands/vms.py +1 -1
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/commands/vpcs.py +1 -1
- ibee_cli-0.13.0/src/ibee_cli/commands/vpus.py +697 -0
- {ibee_cli-0.11.0 → ibee_cli-0.13.0/src/ibee_cli.egg-info}/PKG-INFO +33 -12
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli.egg-info/SOURCES.txt +3 -0
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli.egg-info/requires.txt +1 -1
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/tests/test_command_behaviour.py +41 -0
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/tests/test_contract_commands.py +4 -3
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/LICENSE +0 -0
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/setup.cfg +0 -0
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/billing_selection.py +0 -0
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/context.py +0 -0
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/helpers.py +0 -0
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/main.py +0 -0
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli/render.py +0 -0
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli.egg-info/dependency_links.txt +0 -0
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli.egg-info/entry_points.txt +0 -0
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/src/ibee_cli.egg-info/top_level.txt +0 -0
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/tests/test_cli_core.py +0 -0
- {ibee_cli-0.11.0 → ibee_cli-0.13.0}/tests/test_contract_014_commands.py +0 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ibee-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.13.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
|
|
7
7
|
Project-URL: Homepage, https://ibee.ai
|
|
8
8
|
Project-URL: Documentation, https://ibee.ai/docs/api-reference
|
|
9
|
-
Project-URL: Repository, https://github.com/
|
|
9
|
+
Project-URL: Repository, https://github.com/IBEE/ibee-cli
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
11
|
Classifier: Operating System :: OS Independent
|
|
12
12
|
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.
|
|
16
|
+
Requires-Dist: ibee<0.14,>=0.13.0
|
|
17
17
|
Requires-Dist: httpx>=0.27
|
|
18
18
|
Requires-Dist: typer>=0.12
|
|
19
19
|
Requires-Dist: click>=8.1
|
|
@@ -27,8 +27,8 @@ Dynamic: license-file
|
|
|
27
27
|
# IBEE Solutions CLI
|
|
28
28
|
|
|
29
29
|
Official command-line interface for the IBEE Solutions cloud platform, built on the
|
|
30
|
-
[`ibee` Python SDK](https://github.com/
|
|
31
|
-
operation of the IBEE public API (contract 0.
|
|
30
|
+
[`ibee` Python SDK](https://github.com/IBEE/ibee-python). It has one command per
|
|
31
|
+
operation of the IBEE public API (contract 0.18.0, 271 operations): each command makes
|
|
32
32
|
that operation's one SDK call and prints the server's answer. The server decides
|
|
33
33
|
prices, eligibility, limits and states; the CLI checks nothing before sending.
|
|
34
34
|
|
|
@@ -61,9 +61,9 @@ sent as every operation's `workspace_id`.
|
|
|
61
61
|
|
|
62
62
|
## Commands
|
|
63
63
|
|
|
64
|
-
`ibee --help` lists the groups (`vms`, `gpus`, `ops`, `compute`, `
|
|
65
|
-
`buckets`, `cdn`, `secrets`, `vpcs`, `reserved-ips`, `firewalls`,
|
|
66
|
-
`registries`, `billing`); [COMMANDS.md](COMMANDS.md) lists every command with its API operation,
|
|
64
|
+
`ibee --help` lists the groups (`vms`, `gpus`, `ops`, `compute`, `kubernetes`,
|
|
65
|
+
`block-storage`, `buckets`, `cdn`, `secrets`, `vpcs`, `reserved-ips`, `firewalls`,
|
|
66
|
+
`load-balancers`, `registries`, `billing`, `api-tokens`); [COMMANDS.md](COMMANDS.md) lists every command with its API operation,
|
|
67
67
|
and `ibee COMMAND --help` shows each option's description from the contract.
|
|
68
68
|
|
|
69
69
|
Every command follows the contract, field for field:
|
|
@@ -75,8 +75,13 @@ Every command follows the contract, field for field:
|
|
|
75
75
|
- booleans are `--name/--no-name`; arrays of strings or numbers repeat the option
|
|
76
76
|
(`--tags a --tags b`); objects and arrays of objects take JSON, and a JSON value of
|
|
77
77
|
`@FILE` reads the file, `@-` standard input (`--rules @rules.json`);
|
|
78
|
-
- `X-Idempotency-Key` (and
|
|
79
|
-
|
|
78
|
+
- `X-Idempotency-Key` (and the `Idempotency-Key` of Container Registry plan upgrade,
|
|
79
|
+
Secret Manager enable and app-credential create, and load balancer and Kubernetes
|
|
80
|
+
changes) is `--idempotency-key`; without it the SDK sends a new random key;
|
|
81
|
+
- each command calls the SDK method Fern generates for its operation:
|
|
82
|
+
`x-fern-sdk-group-name` / `x-fern-sdk-method-name` when the contract has them
|
|
83
|
+
(`ibee api-tokens scopes` calls `client.api_tokens.list_scopes`), else the tag and
|
|
84
|
+
operationId.
|
|
80
85
|
|
|
81
86
|
```bash
|
|
82
87
|
ibee compute sites
|
|
@@ -105,6 +110,22 @@ ibee load-balancers regions
|
|
|
105
110
|
ibee registries tokens create REGISTRY_ID --token-name ci-push --permission PULL_PUSH
|
|
106
111
|
```
|
|
107
112
|
|
|
113
|
+
### API tokens
|
|
114
|
+
|
|
115
|
+
A token with `api-tokens.write` creates, lists, reads and revokes its owner's API
|
|
116
|
+
tokens. A new token never gets more access than the token that creates it (403
|
|
117
|
+
`scope_not_held`, `workspace_not_held` or `expiry_exceeds_parent`). The value is in
|
|
118
|
+
`token` of the `create` answer only.
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
ibee api-tokens scopes
|
|
122
|
+
ibee api-tokens list
|
|
123
|
+
ibee api-tokens create --name ci-deploy --description "GitHub Actions deploys" \
|
|
124
|
+
--scopes vm.read --scopes vm.write --workspace-ids 907479 --expires-at 2027-06-30T00:00:00Z
|
|
125
|
+
ibee api-tokens get TOKEN_ID
|
|
126
|
+
ibee api-tokens delete TOKEN_ID --yes
|
|
127
|
+
```
|
|
128
|
+
|
|
108
129
|
### VM creates: `--billing-interval`
|
|
109
130
|
|
|
110
131
|
`vms create` and `gpus create` need the contract's `billing_catalog` (a
|
|
@@ -208,7 +229,7 @@ retried. After a retryable failure the CLI prints `Retry safely with:
|
|
|
208
229
|
## Development
|
|
209
230
|
|
|
210
231
|
```bash
|
|
211
|
-
pip install "ibee @ git+https://github.com/
|
|
232
|
+
pip install "ibee @ git+https://github.com/IBEE/ibee-python@main" # or the SDK branch you need
|
|
212
233
|
pip install -e ".[dev]"
|
|
213
234
|
python scripts/generate_commands.py --check # the commands match contract/ibee-cloud.yaml
|
|
214
235
|
python scripts/check_sdk_calls.py # every SDK method has a command, and only those are called
|
|
@@ -229,5 +250,5 @@ the CLI's range exists) and ibee-python `main` (or its branch of the same name).
|
|
|
229
250
|
|
|
230
251
|
## Related
|
|
231
252
|
|
|
232
|
-
- [Python SDK](https://github.com/
|
|
253
|
+
- [Python SDK](https://github.com/IBEE/ibee-python): `pip install ibee`
|
|
233
254
|
- [API documentation](https://ibee.ai/docs/api-reference)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# IBEE Solutions CLI
|
|
2
2
|
|
|
3
3
|
Official command-line interface for the IBEE Solutions cloud platform, built on the
|
|
4
|
-
[`ibee` Python SDK](https://github.com/
|
|
5
|
-
operation of the IBEE public API (contract 0.
|
|
4
|
+
[`ibee` Python SDK](https://github.com/IBEE/ibee-python). It has one command per
|
|
5
|
+
operation of the IBEE public API (contract 0.18.0, 271 operations): each command makes
|
|
6
6
|
that operation's one SDK call and prints the server's answer. The server decides
|
|
7
7
|
prices, eligibility, limits and states; the CLI checks nothing before sending.
|
|
8
8
|
|
|
@@ -35,9 +35,9 @@ sent as every operation's `workspace_id`.
|
|
|
35
35
|
|
|
36
36
|
## Commands
|
|
37
37
|
|
|
38
|
-
`ibee --help` lists the groups (`vms`, `gpus`, `ops`, `compute`, `
|
|
39
|
-
`buckets`, `cdn`, `secrets`, `vpcs`, `reserved-ips`, `firewalls`,
|
|
40
|
-
`registries`, `billing`); [COMMANDS.md](COMMANDS.md) lists every command with its API operation,
|
|
38
|
+
`ibee --help` lists the groups (`vms`, `gpus`, `ops`, `compute`, `kubernetes`,
|
|
39
|
+
`block-storage`, `buckets`, `cdn`, `secrets`, `vpcs`, `reserved-ips`, `firewalls`,
|
|
40
|
+
`load-balancers`, `registries`, `billing`, `api-tokens`); [COMMANDS.md](COMMANDS.md) lists every command with its API operation,
|
|
41
41
|
and `ibee COMMAND --help` shows each option's description from the contract.
|
|
42
42
|
|
|
43
43
|
Every command follows the contract, field for field:
|
|
@@ -49,8 +49,13 @@ Every command follows the contract, field for field:
|
|
|
49
49
|
- booleans are `--name/--no-name`; arrays of strings or numbers repeat the option
|
|
50
50
|
(`--tags a --tags b`); objects and arrays of objects take JSON, and a JSON value of
|
|
51
51
|
`@FILE` reads the file, `@-` standard input (`--rules @rules.json`);
|
|
52
|
-
- `X-Idempotency-Key` (and
|
|
53
|
-
|
|
52
|
+
- `X-Idempotency-Key` (and the `Idempotency-Key` of Container Registry plan upgrade,
|
|
53
|
+
Secret Manager enable and app-credential create, and load balancer and Kubernetes
|
|
54
|
+
changes) is `--idempotency-key`; without it the SDK sends a new random key;
|
|
55
|
+
- each command calls the SDK method Fern generates for its operation:
|
|
56
|
+
`x-fern-sdk-group-name` / `x-fern-sdk-method-name` when the contract has them
|
|
57
|
+
(`ibee api-tokens scopes` calls `client.api_tokens.list_scopes`), else the tag and
|
|
58
|
+
operationId.
|
|
54
59
|
|
|
55
60
|
```bash
|
|
56
61
|
ibee compute sites
|
|
@@ -79,6 +84,22 @@ ibee load-balancers regions
|
|
|
79
84
|
ibee registries tokens create REGISTRY_ID --token-name ci-push --permission PULL_PUSH
|
|
80
85
|
```
|
|
81
86
|
|
|
87
|
+
### API tokens
|
|
88
|
+
|
|
89
|
+
A token with `api-tokens.write` creates, lists, reads and revokes its owner's API
|
|
90
|
+
tokens. A new token never gets more access than the token that creates it (403
|
|
91
|
+
`scope_not_held`, `workspace_not_held` or `expiry_exceeds_parent`). The value is in
|
|
92
|
+
`token` of the `create` answer only.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
ibee api-tokens scopes
|
|
96
|
+
ibee api-tokens list
|
|
97
|
+
ibee api-tokens create --name ci-deploy --description "GitHub Actions deploys" \
|
|
98
|
+
--scopes vm.read --scopes vm.write --workspace-ids 907479 --expires-at 2027-06-30T00:00:00Z
|
|
99
|
+
ibee api-tokens get TOKEN_ID
|
|
100
|
+
ibee api-tokens delete TOKEN_ID --yes
|
|
101
|
+
```
|
|
102
|
+
|
|
82
103
|
### VM creates: `--billing-interval`
|
|
83
104
|
|
|
84
105
|
`vms create` and `gpus create` need the contract's `billing_catalog` (a
|
|
@@ -182,7 +203,7 @@ retried. After a retryable failure the CLI prints `Retry safely with:
|
|
|
182
203
|
## Development
|
|
183
204
|
|
|
184
205
|
```bash
|
|
185
|
-
pip install "ibee @ git+https://github.com/
|
|
206
|
+
pip install "ibee @ git+https://github.com/IBEE/ibee-python@main" # or the SDK branch you need
|
|
186
207
|
pip install -e ".[dev]"
|
|
187
208
|
python scripts/generate_commands.py --check # the commands match contract/ibee-cloud.yaml
|
|
188
209
|
python scripts/check_sdk_calls.py # every SDK method has a command, and only those are called
|
|
@@ -203,5 +224,5 @@ the CLI's range exists) and ibee-python `main` (or its branch of the same name).
|
|
|
203
224
|
|
|
204
225
|
## Related
|
|
205
226
|
|
|
206
|
-
- [Python SDK](https://github.com/
|
|
227
|
+
- [Python SDK](https://github.com/IBEE/ibee-python): `pip install ibee`
|
|
207
228
|
- [API documentation](https://ibee.ai/docs/api-reference)
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ibee-cli"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.13.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.
|
|
21
|
+
"ibee>=0.13.0,<0.14",
|
|
22
22
|
"httpx>=0.27",
|
|
23
23
|
"typer>=0.12",
|
|
24
24
|
"click>=8.1",
|
|
@@ -34,7 +34,7 @@ ibee = "ibee_cli.main:app"
|
|
|
34
34
|
[project.urls]
|
|
35
35
|
Homepage = "https://ibee.ai"
|
|
36
36
|
Documentation = "https://ibee.ai/docs/api-reference"
|
|
37
|
-
Repository = "https://github.com/
|
|
37
|
+
Repository = "https://github.com/IBEE/ibee-cli"
|
|
38
38
|
|
|
39
39
|
[tool.setuptools.packages.find]
|
|
40
40
|
where = ["src"]
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
# Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.
|
|
1
|
+
# Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.18.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 billing, block_storage, buckets, cdn, compute, firewalls, gpus, load_balancers, ops, registries, reserved_ips, secrets, vms, vpcs
|
|
5
|
+
from . import api_tokens, billing, block_storage, buckets, cdn, compute, firewalls, gpus, kubernetes, load_balancers, ops, registries, reserved_ips, secrets, vms, vpcs, vpus
|
|
6
6
|
|
|
7
7
|
#: (CLI name, Typer app) of every command group.
|
|
8
8
|
GROUPS = [
|
|
9
9
|
('vms', vms.app),
|
|
10
10
|
('gpus', gpus.app),
|
|
11
|
+
('vpus', vpus.app),
|
|
11
12
|
('ops', ops.app),
|
|
12
13
|
('compute', compute.app),
|
|
14
|
+
('kubernetes', kubernetes.app),
|
|
13
15
|
('block-storage', block_storage.app),
|
|
14
16
|
('buckets', buckets.app),
|
|
15
17
|
('cdn', cdn.app),
|
|
@@ -20,4 +22,5 @@ GROUPS = [
|
|
|
20
22
|
('load-balancers', load_balancers.app),
|
|
21
23
|
('registries', registries.app),
|
|
22
24
|
('billing', billing.app),
|
|
25
|
+
('api-tokens', api_tokens.app),
|
|
23
26
|
]
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.18.0).
|
|
2
|
+
# Do not edit by hand: change the contract or the generator and run the script again.
|
|
3
|
+
"""``ibee api-tokens``: Platform API tokens: scopes, create, list, read and revoke (one command per contract operation)."""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import List, Optional
|
|
8
|
+
|
|
9
|
+
import typer
|
|
10
|
+
|
|
11
|
+
from ..helpers import compact, confirm, sdk, workspace
|
|
12
|
+
from ..render import emit, handle_api_errors
|
|
13
|
+
|
|
14
|
+
app = typer.Typer(help='Platform API tokens: scopes, create, list, read and revoke', no_args_is_help=True)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@app.command('list', help="List API tokens.\n\nLists the platform API tokens of the calling token's owner in its organization, newest first, including revoked and expired ones. Token values are never returned. Requires scope: api-tokens.read.\n\nAPI: GET /api-tokens (listApiTokens).", short_help='List API tokens')
|
|
18
|
+
@handle_api_errors
|
|
19
|
+
def list_api_tokens(
|
|
20
|
+
ctx: typer.Context,
|
|
21
|
+
) -> None:
|
|
22
|
+
client = sdk(ctx)
|
|
23
|
+
result = client.api_tokens.list(**compact(workspace_id=workspace(ctx)))
|
|
24
|
+
emit(result, collection='items', id_field='id')
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@app.command('create', help="Create an API token.\n\nCreates a platform API token in the calling token's organization, owned by the same person, and returns its value once in `token`. The new token never gets more access than the calling token: every scope in `scopes` must be one the calling token holds (403 `scope_not_held`); `workspace_ids` must be workspaces the calling token can reach, and a token limited to some workspaces cannot create one for every workspace (403 `workspace_not_held`); `expires_at` cannot be later than the calling token's expiry (403 `expiry_exceeds_parent`). Leave out `workspace_ids` to get the calling token's workspaces and `expires_at` to get its expiry. The token's user must still be an Owner or Admin of the organization, identity-verified, and the organization must not be restricted, as for a token created in the portal. Requires scope: api-tokens.write.\n\nAPI: POST /api-tokens (createApiToken).", short_help='Create an API token')
|
|
28
|
+
@handle_api_errors
|
|
29
|
+
def create_api_token(
|
|
30
|
+
ctx: typer.Context,
|
|
31
|
+
name: str = typer.Option(..., '--name', show_default=False, help='What will use the token, for example `ci-deploy`.'),
|
|
32
|
+
scopes: List[str] = typer.Option(..., '--scopes', show_default=False, help='Scopes to grant, from `GET /api-token-scopes`. Each one must be held by the calling token.'),
|
|
33
|
+
description: Optional[str] = typer.Option(None, '--description', show_default=False, help='Optional note about the token.'),
|
|
34
|
+
workspace_ids: Optional[List[str]] = typer.Option(None, '--workspace-ids', show_default=False, help="Workspaces the token may use. Leave out (or send an empty list) for the calling token's workspaces: every workspace when the calling token has every workspace. Each one must be reachable by the calling token."),
|
|
35
|
+
expires_at: Optional[str] = typer.Option(None, '--expires-at', show_default=False, help="When the token stops working (RFC 3339). Leave out for the calling token's expiry, or no expiry when the calling token has none. Never later than the calling token's expiry."),
|
|
36
|
+
) -> None:
|
|
37
|
+
client = sdk(ctx)
|
|
38
|
+
result = client.api_tokens.create(
|
|
39
|
+
**compact(
|
|
40
|
+
workspace_id=workspace(ctx),
|
|
41
|
+
name=name,
|
|
42
|
+
scopes=scopes,
|
|
43
|
+
description=description,
|
|
44
|
+
workspace_ids=workspace_ids,
|
|
45
|
+
expires_at=expires_at,
|
|
46
|
+
),
|
|
47
|
+
)
|
|
48
|
+
emit(result)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@app.command('get', help="Get an API token.\n\nReturns one platform API token of the calling token's owner, without its value. 404 when the ID is unknown or belongs to another person or organization. Requires scope: api-tokens.read.\n\nAPI: GET /api-tokens/{token_id} (getApiToken).", short_help='Get an API token')
|
|
52
|
+
@handle_api_errors
|
|
53
|
+
def get_api_token(
|
|
54
|
+
ctx: typer.Context,
|
|
55
|
+
token_id: str = typer.Argument(..., metavar='TOKEN_ID', show_default=False, help="The API token's ID (`id` in its answers)."),
|
|
56
|
+
) -> None:
|
|
57
|
+
client = sdk(ctx)
|
|
58
|
+
result = client.api_tokens.get(token_id, **compact(workspace_id=workspace(ctx)))
|
|
59
|
+
emit(result)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
@app.command('delete', help="Revoke an API token.\n\nRevokes a platform API token of the calling token's owner. It stops working on its next call and cannot be restored; it stays listed with `status: revoked`. A token may revoke itself. Revoking an already revoked token answers 200 with the same shape. 404 when the ID is unknown or belongs to another person or organization. Requires scope: api-tokens.write.\n\nAPI: DELETE /api-tokens/{token_id} (deleteApiToken).", short_help='Revoke an API token')
|
|
63
|
+
@handle_api_errors
|
|
64
|
+
def delete_api_token(
|
|
65
|
+
ctx: typer.Context,
|
|
66
|
+
token_id: str = typer.Argument(..., metavar='TOKEN_ID', show_default=False, help="The API token's ID (`id` in its answers)."),
|
|
67
|
+
yes: bool = typer.Option(False, '--yes', '-y', help='Do not ask for confirmation.'),
|
|
68
|
+
) -> None:
|
|
69
|
+
confirm(ctx, yes, f'Revoke an API token {token_id}?')
|
|
70
|
+
client = sdk(ctx)
|
|
71
|
+
result = client.api_tokens.delete(token_id, **compact(workspace_id=workspace(ctx)))
|
|
72
|
+
emit(result)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@app.command('scopes', help='List API token scopes.\n\nLists every scope a platform API token can hold, with what it allows. A token you create can only get scopes the calling token holds. Requires scope: api-tokens.read.\n\nAPI: GET /api-token-scopes (listApiTokenScopes).', short_help='List API token scopes')
|
|
76
|
+
@handle_api_errors
|
|
77
|
+
def list_api_token_scopes(
|
|
78
|
+
ctx: typer.Context,
|
|
79
|
+
) -> None:
|
|
80
|
+
client = sdk(ctx)
|
|
81
|
+
result = client.api_tokens.list_scopes(**compact(workspace_id=workspace(ctx)))
|
|
82
|
+
emit(result, collection='items')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.
|
|
1
|
+
# Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.18.0).
|
|
2
2
|
# Do not edit by hand: change the contract or the generator and run the script again.
|
|
3
3
|
"""``ibee billing``: Organization wallet balance and top-ups (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.
|
|
1
|
+
# Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.18.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.
|
|
1
|
+
# Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.18.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
|
|
|
@@ -50,7 +50,7 @@ def list_buckets(
|
|
|
50
50
|
@handle_api_errors
|
|
51
51
|
def create_bucket(
|
|
52
52
|
ctx: typer.Context,
|
|
53
|
-
name: str = typer.Option(..., '--name', show_default=False, help=
|
|
53
|
+
name: str = typer.Option(..., '--name', show_default=False, help="Unique bucket name within the workspace. The longest name allowed is 63 characters minus the workspace ID's length minus 2 (55 for a 6-digit workspace ID); a longer name answers 400 with the limit."),
|
|
54
54
|
region: str = typer.Option(..., '--region', show_default=False, help='Required Object Storage region identifier. This must match a region configured for the target environment; it is not a compute `site_id` or display name.'),
|
|
55
55
|
is_public: Optional[bool] = typer.Option(None, '--is-public/--no-is-public', show_default=False, help='Whether the bucket allows unauthenticated read access.'),
|
|
56
56
|
object_lock_enabled: Optional[bool] = typer.Option(None, '--object-lock-enabled/--no-object-lock-enabled', show_default=False, help='Must be `true` when `default_retention` is provided.'),
|
|
@@ -214,7 +214,7 @@ def get_bucket_object_lock(
|
|
|
214
214
|
def set_bucket_object_lock(
|
|
215
215
|
ctx: typer.Context,
|
|
216
216
|
bucket_name: str = typer.Argument(..., metavar='BUCKET_NAME', show_default=False, help='Logical bucket name.'),
|
|
217
|
-
rule: Optional[str] = typer.Option(None, '--rule', metavar='JSON', show_default=False, help=
|
|
217
|
+
rule: Optional[str] = typer.Option(None, '--rule', metavar='JSON', show_default=False, help="New default retention, or null to remove it. Object Lock itself stays enabled on the bucket (it can't be turned off), and objects already stored keep their own retention. JSON (@FILE reads a file, @- stdin)."),
|
|
218
218
|
) -> None:
|
|
219
219
|
client = sdk(ctx)
|
|
220
220
|
result = client.object_storage.set_bucket_object_lock(
|
|
@@ -465,7 +465,7 @@ def get_s3credential(
|
|
|
465
465
|
emit(result)
|
|
466
466
|
|
|
467
467
|
|
|
468
|
-
@credentials_app.command('delete', help='Delete S3 credential.\n\nDeletes a credential record permanently. Revoke it first with POST /object-storage/credentials/{access_key_id}/revoke
|
|
468
|
+
@credentials_app.command('delete', help='Delete S3 credential.\n\nDeletes a credential record permanently. Revoke it first with POST /object-storage/credentials/{access_key_id}/revoke: an active key answers 409 ("revoke it first") and keeps working. Requires scope: object-storage.write.\n\nAPI: DELETE /object-storage/credentials/{access_key_id} (deleteS3Credential).', short_help='Delete S3 credential')
|
|
469
469
|
@handle_api_errors
|
|
470
470
|
def delete_s3credential(
|
|
471
471
|
ctx: typer.Context,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.
|
|
1
|
+
# Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.18.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.
|
|
1
|
+
# Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.18.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
|
|
|
@@ -28,10 +28,10 @@ def list_compute_sites(
|
|
|
28
28
|
@handle_api_errors
|
|
29
29
|
def list_compute_plans(
|
|
30
30
|
ctx: typer.Context,
|
|
31
|
-
vm_type: str = typer.Option(..., '--vm-type', show_default=False, help='Kind of VM the plans are for. Required. - `cloud` - `gpu`'),
|
|
31
|
+
vm_type: str = typer.Option(..., '--vm-type', show_default=False, help='Kind of VM the plans are for. Required. - `cloud` - `gpu` - `vpu`: VPU plans are sold hourly only, and are listed hourly unless you ask otherwise.'),
|
|
32
32
|
site_id: Optional[str] = typer.Option(None, '--site-id', show_default=False, help='Optional exact placement filter. Copy `site_id` from `GET /compute/sites`.'),
|
|
33
33
|
currency: Optional[str] = typer.Option(None, '--currency', show_default=False, help='ISO 4217 code of the currency to quote prices in. Default `INR`.'),
|
|
34
|
-
billing_interval: Optional[str] = typer.Option(None, '--billing-interval', show_default=False, help='Billing period to quote prices for. - `HOURLY` - `MONTHLY`
|
|
34
|
+
billing_interval: Optional[str] = typer.Option(None, '--billing-interval', show_default=False, help='Billing period to quote prices for. - `HOURLY`: the default for `vm_type=vpu`. - `MONTHLY`: the default for `cloud` and `gpu`. VPU has no monthly plans, so `vm_type=vpu` with `MONTHLY` lists none.'),
|
|
35
35
|
include_availability: Optional[bool] = typer.Option(None, '--include-availability/--no-include-availability', show_default=False, help='Check advisory placement by default when site_id is supplied. Set false for pricing-only discovery. This does not reserve stock.'),
|
|
36
36
|
os_type: Optional[str] = typer.Option(None, '--os-type', show_default=False, help='OS pool to check when include_availability is true. One of: linux, windows.'),
|
|
37
37
|
requires_public_ip: Optional[bool] = typer.Option(None, '--requires-public-ip/--no-requires-public-ip', show_default=False, help='Include public IPv4 capacity in the advisory placement check.'),
|
|
@@ -56,7 +56,7 @@ def list_compute_plans(
|
|
|
56
56
|
@handle_api_errors
|
|
57
57
|
def list_compute_images(
|
|
58
58
|
ctx: typer.Context,
|
|
59
|
-
vm_type: str = typer.Option(..., '--vm-type', show_default=False, help='Kind of VM the images are for. Required. - `cloud` - `gpu`'),
|
|
59
|
+
vm_type: str = typer.Option(..., '--vm-type', show_default=False, help='Kind of VM the images are for. Required. - `cloud` - `gpu` - `vpu`: the Ubuntu images the portal offers for VPU VMs.'),
|
|
60
60
|
site_id: Optional[str] = typer.Option(None, '--site-id', show_default=False, help='Optional exact placement filter. Copy `site_id` from `GET /compute/sites`.'),
|
|
61
61
|
) -> None:
|
|
62
62
|
client = sdk(ctx)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.
|
|
1
|
+
# Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.18.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
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.
|
|
1
|
+
# Generated by scripts/generate_commands.py from contract/ibee-cloud.yaml (IBEE Solutions API 0.18.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
|
|