ibee-cli 0.8.0__tar.gz → 0.11.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.8.0/src/ibee_cli.egg-info → ibee_cli-0.11.0}/PKG-INFO +48 -16
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/README.md +46 -14
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/pyproject.toml +2 -2
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/__init__.py +1 -1
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/commands/__init__.py +1 -1
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/commands/billing.py +1 -1
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/commands/block_storage.py +1 -1
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/commands/buckets.py +110 -27
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/commands/cdn.py +1 -1
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/commands/compute.py +1 -1
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/commands/firewalls.py +1 -1
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/commands/gpus.py +4 -2
- ibee_cli-0.11.0/src/ibee_cli/commands/load_balancers.py +191 -0
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/commands/ops.py +1 -1
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/commands/registries.py +27 -47
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/commands/reserved_ips.py +1 -1
- ibee_cli-0.11.0/src/ibee_cli/commands/secrets.py +354 -0
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/commands/vms.py +4 -2
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/commands/vpcs.py +1 -1
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/helpers.py +13 -1
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/render.py +16 -2
- {ibee_cli-0.8.0 → ibee_cli-0.11.0/src/ibee_cli.egg-info}/PKG-INFO +48 -16
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli.egg-info/SOURCES.txt +1 -0
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli.egg-info/requires.txt +1 -1
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/tests/test_cli_core.py +4 -1
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/tests/test_command_behaviour.py +9 -11
- ibee_cli-0.11.0/tests/test_contract_014_commands.py +105 -0
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/tests/test_contract_commands.py +7 -3
- ibee_cli-0.8.0/src/ibee_cli/commands/load_balancers.py +0 -206
- ibee_cli-0.8.0/src/ibee_cli/commands/secrets.py +0 -496
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/LICENSE +0 -0
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/setup.cfg +0 -0
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/billing_selection.py +0 -0
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/context.py +0 -0
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli/main.py +0 -0
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli.egg-info/dependency_links.txt +0 -0
- {ibee_cli-0.8.0 → ibee_cli-0.11.0}/src/ibee_cli.egg-info/entry_points.txt +0 -0
- {ibee_cli-0.8.0 → ibee_cli-0.11.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.
|
|
3
|
+
Version: 0.11.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.
|
|
16
|
+
Requires-Dist: ibee<0.12,>=0.11.0
|
|
17
17
|
Requires-Dist: httpx>=0.27
|
|
18
18
|
Requires-Dist: typer>=0.12
|
|
19
19
|
Requires-Dist: click>=8.1
|
|
@@ -26,17 +26,19 @@ Dynamic: license-file
|
|
|
26
26
|
|
|
27
27
|
# IBEE Solutions CLI
|
|
28
28
|
|
|
29
|
-
Object Storage and Container Registry public management operations are temporarily paused.
|
|
30
|
-
Published methods and commands remain available for compatibility. An empty 404
|
|
31
|
-
from these routes reports the pause; it does not prove an existing resource was deleted.
|
|
32
|
-
CDN remains available.
|
|
33
|
-
|
|
34
29
|
Official command-line interface for the IBEE Solutions cloud platform, built on the
|
|
35
30
|
[`ibee` Python SDK](https://github.com/devs-ibee/ibee-python). It has one command per
|
|
36
|
-
operation of the IBEE public API (contract 0.
|
|
31
|
+
operation of the IBEE public API (contract 0.14.3, 222 operations): each command makes
|
|
37
32
|
that operation's one SDK call and prints the server's answer. The server decides
|
|
38
33
|
prices, eligibility, limits and states; the CLI checks nothing before sending.
|
|
39
34
|
|
|
35
|
+
The API manages resources. Data stays on each product's own endpoint, with the
|
|
36
|
+
clients that already exist for it: files over the S3 API
|
|
37
|
+
(`<workspace>.blob.ibeestorage.com`, any S3 tool such as `aws s3` or `rclone`, or one
|
|
38
|
+
file at a time with `ibee buckets objects upload` and an upload or download link),
|
|
39
|
+
container images with `docker` at `registry.ibee.ai`, and secret values with `bao` or
|
|
40
|
+
`vault` at your Secret Manager endpoint.
|
|
41
|
+
|
|
40
42
|
## Installation
|
|
41
43
|
|
|
42
44
|
```bash
|
|
@@ -61,7 +63,7 @@ sent as every operation's `workspace_id`.
|
|
|
61
63
|
|
|
62
64
|
`ibee --help` lists the groups (`vms`, `gpus`, `ops`, `compute`, `block-storage`,
|
|
63
65
|
`buckets`, `cdn`, `secrets`, `vpcs`, `reserved-ips`, `firewalls`, `load-balancers`,
|
|
64
|
-
`registries`); [COMMANDS.md](COMMANDS.md) lists every command with its API operation,
|
|
66
|
+
`registries`, `billing`); [COMMANDS.md](COMMANDS.md) lists every command with its API operation,
|
|
65
67
|
and `ibee COMMAND --help` shows each option's description from the contract.
|
|
66
68
|
|
|
67
69
|
Every command follows the contract, field for field:
|
|
@@ -93,7 +95,13 @@ ibee vms delete VM_ID --public-ip-action release --yes
|
|
|
93
95
|
ibee buckets create --name assets --region in-south-2
|
|
94
96
|
ibee buckets cors set assets --rules @cors.json
|
|
95
97
|
ibee buckets credentials create --name ci --permission-type object_rw
|
|
96
|
-
ibee
|
|
98
|
+
ibee buckets objects upload assets docs/report.pdf ./report.pdf --content-type application/pdf
|
|
99
|
+
ibee buckets objects metadata assets docs/report.pdf
|
|
100
|
+
ibee buckets objects download-link assets docs/report.pdf --expires 600 --disposition attachment
|
|
101
|
+
ibee load-balancers list --include-deleted
|
|
102
|
+
ibee secrets credentials create --name ci --access read --folder apps
|
|
103
|
+
ibee secrets update apps/billing/db --custom-metadata '{"owner": "billing"}'
|
|
104
|
+
ibee load-balancers regions
|
|
97
105
|
ibee registries tokens create REGISTRY_ID --token-name ci-push --permission PULL_PUSH
|
|
98
106
|
```
|
|
99
107
|
|
|
@@ -114,6 +122,17 @@ or `--plan-id PLAN_ID --billing-interval HOURLY|MONTHLY` to build it the same wa
|
|
|
114
122
|
`GET /compute/plans`. A resize body has no plan field, so `--plan-id` is only used for
|
|
115
123
|
this lookup and is not sent.
|
|
116
124
|
|
|
125
|
+
### One file: `buckets objects upload`
|
|
126
|
+
|
|
127
|
+
`ibee buckets objects upload BUCKET_NAME OBJECT_PATH FILE` (`-` reads stdin) uploads
|
|
128
|
+
one file with an upload link: the SDK's `upload_file` computes the file's size and
|
|
129
|
+
SHA-256, asks for the link (`createObjectUploadLink`) and PUTs the file to it on the
|
|
130
|
+
workspace's S3 host; the API token is not sent there. It prints the key, size, SHA-256
|
|
131
|
+
and ETag; `buckets objects metadata` shows what was stored. One link carries one whole
|
|
132
|
+
file of at most 80,000,000 bytes (the server's limit); use an S3 tool for larger
|
|
133
|
+
files. `buckets objects upload-link`, `download-link` and `metadata` are the plain
|
|
134
|
+
operations.
|
|
135
|
+
|
|
117
136
|
## Global options
|
|
118
137
|
|
|
119
138
|
| Option | Environment variable | Meaning |
|
|
@@ -134,11 +153,11 @@ The endpoint is chosen in this order: `--base-url`, `IBEE_BASE_URL`, `IBEE_ENDPO
|
|
|
134
153
|
The server's answer is printed as JSON by default. `-o yaml` prints it as YAML,
|
|
135
154
|
`-o table` as a table (one row per item of a list, or one row per field of an
|
|
136
155
|
object) and `-o id` one identifier per line (for a list, the value the API takes for
|
|
137
|
-
each item, such as a bucket's name).
|
|
138
|
-
`
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
156
|
+
each item, such as a bucket's name). Every delete prints its answer, including
|
|
157
|
+
`deletion`: whether the resource is gone (`deleted`) or still going (`deleting`).
|
|
158
|
+
Destructive commands (every delete and revoke, `buckets credentials revoke`, `cdn purge`,
|
|
159
|
+
VM restores and volume detach, `secrets versions destroy` and `secrets workspace enable`,
|
|
160
|
+
which can't be undone) ask for confirmation; `--yes` (or the global `--yes`) skips it.
|
|
142
161
|
|
|
143
162
|
## Errors
|
|
144
163
|
|
|
@@ -151,6 +170,18 @@ Error: HTTP 409
|
|
|
151
170
|
request_id: 6f1c2e...
|
|
152
171
|
```
|
|
153
172
|
|
|
173
|
+
A Billing refusal adds `reason` (`billing_reason`) and, with
|
|
174
|
+
`initial_topup_required`, Billing's first top-up minimum:
|
|
175
|
+
|
|
176
|
+
```text
|
|
177
|
+
Error: HTTP 402
|
|
178
|
+
code: billing_denied
|
|
179
|
+
reason: initial_topup_required
|
|
180
|
+
required_topup_minor: 50000
|
|
181
|
+
billing_currency: INR
|
|
182
|
+
message: Add at least ₹500 to your wallet ...
|
|
183
|
+
```
|
|
184
|
+
|
|
154
185
|
With `-o json` the same fields, plus the raw `body`, are printed on stderr as
|
|
155
186
|
`{"error": {...}}`. A success answer the SDK cannot read (it does not match the
|
|
156
187
|
contract) is printed the same way, as received, with exit code 1.
|
|
@@ -189,7 +220,8 @@ The command modules in `src/ibee_cli/commands/` and `COMMANDS.md` are generated
|
|
|
189
220
|
`scripts/generate_commands.py`; after updating the contract, run the script and commit
|
|
190
221
|
what it writes. The hand-written parts are the global options (`context.py`), output
|
|
191
222
|
and errors (`render.py`), the shared request helpers (`helpers.py`) and the VM
|
|
192
|
-
`billing_catalog` convenience (`billing_selection.py`).
|
|
223
|
+
`billing_catalog` convenience (`billing_selection.py`). `buckets objects upload` is
|
|
224
|
+
generated too; it calls the SDK's `upload_file`.
|
|
193
225
|
|
|
194
226
|
CI runs the tests on Python 3.10-3.12 with the ibee-python branch of the same name (or
|
|
195
227
|
ibee from PyPI), and the "SDK drift" check against ibee from PyPI (once a release in
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
# IBEE Solutions CLI
|
|
2
2
|
|
|
3
|
-
Object Storage and Container Registry public management operations are temporarily paused.
|
|
4
|
-
Published methods and commands remain available for compatibility. An empty 404
|
|
5
|
-
from these routes reports the pause; it does not prove an existing resource was deleted.
|
|
6
|
-
CDN remains available.
|
|
7
|
-
|
|
8
3
|
Official command-line interface for the IBEE Solutions cloud platform, built on the
|
|
9
4
|
[`ibee` Python SDK](https://github.com/devs-ibee/ibee-python). It has one command per
|
|
10
|
-
operation of the IBEE public API (contract 0.
|
|
5
|
+
operation of the IBEE public API (contract 0.14.3, 222 operations): each command makes
|
|
11
6
|
that operation's one SDK call and prints the server's answer. The server decides
|
|
12
7
|
prices, eligibility, limits and states; the CLI checks nothing before sending.
|
|
13
8
|
|
|
9
|
+
The API manages resources. Data stays on each product's own endpoint, with the
|
|
10
|
+
clients that already exist for it: files over the S3 API
|
|
11
|
+
(`<workspace>.blob.ibeestorage.com`, any S3 tool such as `aws s3` or `rclone`, or one
|
|
12
|
+
file at a time with `ibee buckets objects upload` and an upload or download link),
|
|
13
|
+
container images with `docker` at `registry.ibee.ai`, and secret values with `bao` or
|
|
14
|
+
`vault` at your Secret Manager endpoint.
|
|
15
|
+
|
|
14
16
|
## Installation
|
|
15
17
|
|
|
16
18
|
```bash
|
|
@@ -35,7 +37,7 @@ sent as every operation's `workspace_id`.
|
|
|
35
37
|
|
|
36
38
|
`ibee --help` lists the groups (`vms`, `gpus`, `ops`, `compute`, `block-storage`,
|
|
37
39
|
`buckets`, `cdn`, `secrets`, `vpcs`, `reserved-ips`, `firewalls`, `load-balancers`,
|
|
38
|
-
`registries`); [COMMANDS.md](COMMANDS.md) lists every command with its API operation,
|
|
40
|
+
`registries`, `billing`); [COMMANDS.md](COMMANDS.md) lists every command with its API operation,
|
|
39
41
|
and `ibee COMMAND --help` shows each option's description from the contract.
|
|
40
42
|
|
|
41
43
|
Every command follows the contract, field for field:
|
|
@@ -67,7 +69,13 @@ ibee vms delete VM_ID --public-ip-action release --yes
|
|
|
67
69
|
ibee buckets create --name assets --region in-south-2
|
|
68
70
|
ibee buckets cors set assets --rules @cors.json
|
|
69
71
|
ibee buckets credentials create --name ci --permission-type object_rw
|
|
70
|
-
ibee
|
|
72
|
+
ibee buckets objects upload assets docs/report.pdf ./report.pdf --content-type application/pdf
|
|
73
|
+
ibee buckets objects metadata assets docs/report.pdf
|
|
74
|
+
ibee buckets objects download-link assets docs/report.pdf --expires 600 --disposition attachment
|
|
75
|
+
ibee load-balancers list --include-deleted
|
|
76
|
+
ibee secrets credentials create --name ci --access read --folder apps
|
|
77
|
+
ibee secrets update apps/billing/db --custom-metadata '{"owner": "billing"}'
|
|
78
|
+
ibee load-balancers regions
|
|
71
79
|
ibee registries tokens create REGISTRY_ID --token-name ci-push --permission PULL_PUSH
|
|
72
80
|
```
|
|
73
81
|
|
|
@@ -88,6 +96,17 @@ or `--plan-id PLAN_ID --billing-interval HOURLY|MONTHLY` to build it the same wa
|
|
|
88
96
|
`GET /compute/plans`. A resize body has no plan field, so `--plan-id` is only used for
|
|
89
97
|
this lookup and is not sent.
|
|
90
98
|
|
|
99
|
+
### One file: `buckets objects upload`
|
|
100
|
+
|
|
101
|
+
`ibee buckets objects upload BUCKET_NAME OBJECT_PATH FILE` (`-` reads stdin) uploads
|
|
102
|
+
one file with an upload link: the SDK's `upload_file` computes the file's size and
|
|
103
|
+
SHA-256, asks for the link (`createObjectUploadLink`) and PUTs the file to it on the
|
|
104
|
+
workspace's S3 host; the API token is not sent there. It prints the key, size, SHA-256
|
|
105
|
+
and ETag; `buckets objects metadata` shows what was stored. One link carries one whole
|
|
106
|
+
file of at most 80,000,000 bytes (the server's limit); use an S3 tool for larger
|
|
107
|
+
files. `buckets objects upload-link`, `download-link` and `metadata` are the plain
|
|
108
|
+
operations.
|
|
109
|
+
|
|
91
110
|
## Global options
|
|
92
111
|
|
|
93
112
|
| Option | Environment variable | Meaning |
|
|
@@ -108,11 +127,11 @@ The endpoint is chosen in this order: `--base-url`, `IBEE_BASE_URL`, `IBEE_ENDPO
|
|
|
108
127
|
The server's answer is printed as JSON by default. `-o yaml` prints it as YAML,
|
|
109
128
|
`-o table` as a table (one row per item of a list, or one row per field of an
|
|
110
129
|
object) and `-o id` one identifier per line (for a list, the value the API takes for
|
|
111
|
-
each item, such as a bucket's name).
|
|
112
|
-
`
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
130
|
+
each item, such as a bucket's name). Every delete prints its answer, including
|
|
131
|
+
`deletion`: whether the resource is gone (`deleted`) or still going (`deleting`).
|
|
132
|
+
Destructive commands (every delete and revoke, `buckets credentials revoke`, `cdn purge`,
|
|
133
|
+
VM restores and volume detach, `secrets versions destroy` and `secrets workspace enable`,
|
|
134
|
+
which can't be undone) ask for confirmation; `--yes` (or the global `--yes`) skips it.
|
|
116
135
|
|
|
117
136
|
## Errors
|
|
118
137
|
|
|
@@ -125,6 +144,18 @@ Error: HTTP 409
|
|
|
125
144
|
request_id: 6f1c2e...
|
|
126
145
|
```
|
|
127
146
|
|
|
147
|
+
A Billing refusal adds `reason` (`billing_reason`) and, with
|
|
148
|
+
`initial_topup_required`, Billing's first top-up minimum:
|
|
149
|
+
|
|
150
|
+
```text
|
|
151
|
+
Error: HTTP 402
|
|
152
|
+
code: billing_denied
|
|
153
|
+
reason: initial_topup_required
|
|
154
|
+
required_topup_minor: 50000
|
|
155
|
+
billing_currency: INR
|
|
156
|
+
message: Add at least ₹500 to your wallet ...
|
|
157
|
+
```
|
|
158
|
+
|
|
128
159
|
With `-o json` the same fields, plus the raw `body`, are printed on stderr as
|
|
129
160
|
`{"error": {...}}`. A success answer the SDK cannot read (it does not match the
|
|
130
161
|
contract) is printed the same way, as received, with exit code 1.
|
|
@@ -163,7 +194,8 @@ The command modules in `src/ibee_cli/commands/` and `COMMANDS.md` are generated
|
|
|
163
194
|
`scripts/generate_commands.py`; after updating the contract, run the script and commit
|
|
164
195
|
what it writes. The hand-written parts are the global options (`context.py`), output
|
|
165
196
|
and errors (`render.py`), the shared request helpers (`helpers.py`) and the VM
|
|
166
|
-
`billing_catalog` convenience (`billing_selection.py`).
|
|
197
|
+
`billing_catalog` convenience (`billing_selection.py`). `buckets objects upload` is
|
|
198
|
+
generated too; it calls the SDK's `upload_file`.
|
|
167
199
|
|
|
168
200
|
CI runs the tests on Python 3.10-3.12 with the ibee-python branch of the same name (or
|
|
169
201
|
ibee from PyPI), and the "SDK drift" check against ibee from PyPI (once a release in
|
|
@@ -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.11.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.11.0,<0.12",
|
|
22
22
|
"httpx>=0.27",
|
|
23
23
|
"typer>=0.12",
|
|
24
24
|
"click>=8.1",
|
|
@@ -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.15.1).
|
|
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
|
|
|
@@ -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.15.1).
|
|
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.15.1).
|
|
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.15.1).
|
|
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
|
|
|
@@ -8,7 +8,7 @@ from typing import List, Optional
|
|
|
8
8
|
|
|
9
9
|
import typer
|
|
10
10
|
|
|
11
|
-
from ..helpers import compact, confirm, json_arg, sdk, workspace
|
|
11
|
+
from ..helpers import compact, confirm, json_arg, sdk, workspace, read_file
|
|
12
12
|
from ..render import emit, handle_api_errors
|
|
13
13
|
|
|
14
14
|
app = typer.Typer(help='Object Storage buckets, bucket settings and S3 credentials', no_args_is_help=True)
|
|
@@ -22,11 +22,13 @@ notifications_app = typer.Typer(help='Bucket event notifications', no_args_is_he
|
|
|
22
22
|
app.add_typer(notifications_app, name='notifications')
|
|
23
23
|
domains_app = typer.Typer(help='Bucket custom domains', no_args_is_help=True)
|
|
24
24
|
app.add_typer(domains_app, name='domains')
|
|
25
|
+
objects_app = typer.Typer(help='One object: upload a file, upload and download links, metadata', no_args_is_help=True)
|
|
26
|
+
app.add_typer(objects_app, name='objects')
|
|
25
27
|
credentials_app = typer.Typer(help='S3 access credentials', no_args_is_help=True)
|
|
26
28
|
app.add_typer(credentials_app, name='credentials')
|
|
27
29
|
|
|
28
30
|
|
|
29
|
-
@app.command('list', help='List buckets.\n\
|
|
31
|
+
@app.command('list', help='List buckets.\n\nLists object storage buckets in a workspace. Requires scope: object-storage.read.\n\nAPI: GET /object-storage/buckets (listBuckets).', short_help='List buckets')
|
|
30
32
|
@handle_api_errors
|
|
31
33
|
def list_buckets(
|
|
32
34
|
ctx: typer.Context,
|
|
@@ -44,7 +46,7 @@ def list_buckets(
|
|
|
44
46
|
emit(result, collection='buckets', id_field='name')
|
|
45
47
|
|
|
46
48
|
|
|
47
|
-
@app.command('create', help='Create bucket.\n\
|
|
49
|
+
@app.command('create', help='Create bucket.\n\nCreates an object storage bucket. `region` is required and must match an Object Storage region identifier configured for the target environment. Do not send a compute `site_id`. Requires scope: object-storage.write.\n\nAPI: POST /object-storage/buckets (createBucket).', short_help='Create bucket')
|
|
48
50
|
@handle_api_errors
|
|
49
51
|
def create_bucket(
|
|
50
52
|
ctx: typer.Context,
|
|
@@ -70,7 +72,7 @@ def create_bucket(
|
|
|
70
72
|
emit(result)
|
|
71
73
|
|
|
72
74
|
|
|
73
|
-
@app.command('get', help='Get bucket.\n\
|
|
75
|
+
@app.command('get', help='Get bucket.\n\nReturns bucket configuration and usage statistics. Requires scope: object-storage.read.\n\nAPI: GET /object-storage/buckets/{bucket_name} (getBucket).', short_help='Get bucket')
|
|
74
76
|
@handle_api_errors
|
|
75
77
|
def get_bucket(
|
|
76
78
|
ctx: typer.Context,
|
|
@@ -81,7 +83,7 @@ def get_bucket(
|
|
|
81
83
|
emit(result)
|
|
82
84
|
|
|
83
85
|
|
|
84
|
-
@app.command('update', help='Update bucket settings.\n\
|
|
86
|
+
@app.command('update', help='Update bucket settings.\n\nUpdates mutable bucket settings. Requires scope: object-storage.write.\n\nAPI: PATCH /object-storage/buckets/{bucket_name} (updateBucket).', short_help='Update bucket settings')
|
|
85
87
|
@handle_api_errors
|
|
86
88
|
def update_bucket(
|
|
87
89
|
ctx: typer.Context,
|
|
@@ -99,7 +101,7 @@ def update_bucket(
|
|
|
99
101
|
emit(result)
|
|
100
102
|
|
|
101
103
|
|
|
102
|
-
@app.command('delete', help='Delete bucket.\n\
|
|
104
|
+
@app.command('delete', help='Delete bucket.\n\nDeletes an empty bucket. A bucket that still holds files is refused with 409: delete its files first with an S3 tool. Files are managed over the S3 API at `<workspace>.blob.ibeestorage.com`, not through this API. Requires scope: object-storage.delete.\n\nAPI: DELETE /object-storage/buckets/{bucket_name} (deleteBucket).', short_help='Delete bucket')
|
|
103
105
|
@handle_api_errors
|
|
104
106
|
def delete_bucket(
|
|
105
107
|
ctx: typer.Context,
|
|
@@ -112,7 +114,7 @@ def delete_bucket(
|
|
|
112
114
|
emit(result)
|
|
113
115
|
|
|
114
116
|
|
|
115
|
-
@lifecycle_app.command('get', help="Get bucket lifecycle rules.\n\
|
|
117
|
+
@lifecycle_app.command('get', help="Get bucket lifecycle rules.\n\nReturns the bucket's lifecycle rules, as the portal's Settings › Lifecycle tab shows them. Requires scope: object-storage.read.\n\nAPI: GET /object-storage/buckets/{bucket_name}/lifecycle (getBucketLifecycle).", short_help='Get bucket lifecycle rules')
|
|
116
118
|
@handle_api_errors
|
|
117
119
|
def get_bucket_lifecycle(
|
|
118
120
|
ctx: typer.Context,
|
|
@@ -123,7 +125,7 @@ def get_bucket_lifecycle(
|
|
|
123
125
|
emit(result)
|
|
124
126
|
|
|
125
127
|
|
|
126
|
-
@lifecycle_app.command('set', help='Set bucket lifecycle rules.\n\
|
|
128
|
+
@lifecycle_app.command('set', help='Set bucket lifecycle rules.\n\nReplaces every lifecycle rule of the bucket. Each rule expires objects after a number of days or on a date, optionally only under a prefix. Requires scope: object-storage.write.\n\nAPI: PUT /object-storage/buckets/{bucket_name}/lifecycle (setBucketLifecycle).', short_help='Set bucket lifecycle rules')
|
|
127
129
|
@handle_api_errors
|
|
128
130
|
def set_bucket_lifecycle(
|
|
129
131
|
ctx: typer.Context,
|
|
@@ -141,7 +143,7 @@ def set_bucket_lifecycle(
|
|
|
141
143
|
emit(result)
|
|
142
144
|
|
|
143
145
|
|
|
144
|
-
@lifecycle_app.command('delete', help='Delete bucket lifecycle rules.\n\
|
|
146
|
+
@lifecycle_app.command('delete', help='Delete bucket lifecycle rules.\n\nRemoves 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
147
|
@handle_api_errors
|
|
146
148
|
def delete_bucket_lifecycle(
|
|
147
149
|
ctx: typer.Context,
|
|
@@ -154,7 +156,7 @@ def delete_bucket_lifecycle(
|
|
|
154
156
|
emit(result)
|
|
155
157
|
|
|
156
158
|
|
|
157
|
-
@cors_app.command('get', help="Get bucket CORS rules.\n\
|
|
159
|
+
@cors_app.command('get', help="Get bucket CORS rules.\n\nReturns the bucket's CORS rules, as the portal's Settings › CORS tab shows them. Requires scope: object-storage.read.\n\nAPI: GET /object-storage/buckets/{bucket_name}/cors (getBucketCors).", short_help='Get bucket CORS rules')
|
|
158
160
|
@handle_api_errors
|
|
159
161
|
def get_bucket_cors(
|
|
160
162
|
ctx: typer.Context,
|
|
@@ -165,7 +167,7 @@ def get_bucket_cors(
|
|
|
165
167
|
emit(result)
|
|
166
168
|
|
|
167
169
|
|
|
168
|
-
@cors_app.command('set', help='Set bucket CORS rules.\n\
|
|
170
|
+
@cors_app.command('set', help='Set bucket CORS rules.\n\nReplaces every CORS rule of the bucket. Requires scope: object-storage.write.\n\nAPI: PUT /object-storage/buckets/{bucket_name}/cors (setBucketCors).', short_help='Set bucket CORS rules')
|
|
169
171
|
@handle_api_errors
|
|
170
172
|
def set_bucket_cors(
|
|
171
173
|
ctx: typer.Context,
|
|
@@ -183,7 +185,7 @@ def set_bucket_cors(
|
|
|
183
185
|
emit(result)
|
|
184
186
|
|
|
185
187
|
|
|
186
|
-
@cors_app.command('delete', help='Delete bucket CORS rules.\n\
|
|
188
|
+
@cors_app.command('delete', help='Delete bucket CORS rules.\n\nRemoves 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
189
|
@handle_api_errors
|
|
188
190
|
def delete_bucket_cors(
|
|
189
191
|
ctx: typer.Context,
|
|
@@ -196,7 +198,7 @@ def delete_bucket_cors(
|
|
|
196
198
|
emit(result)
|
|
197
199
|
|
|
198
200
|
|
|
199
|
-
@object_lock_app.command('get', help="Get bucket object lock configuration.\n\
|
|
201
|
+
@object_lock_app.command('get', help="Get bucket object lock configuration.\n\nReturns the default retention of a bucket created with object lock, as the portal's Settings › Lock tab shows it. Answers 404 when the bucket has no object lock. Requires scope: object-storage.read.\n\nAPI: GET /object-storage/buckets/{bucket_name}/object-lock (getBucketObjectLock).", short_help='Get bucket object lock configuration')
|
|
200
202
|
@handle_api_errors
|
|
201
203
|
def get_bucket_object_lock(
|
|
202
204
|
ctx: typer.Context,
|
|
@@ -207,7 +209,7 @@ def get_bucket_object_lock(
|
|
|
207
209
|
emit(result)
|
|
208
210
|
|
|
209
211
|
|
|
210
|
-
@object_lock_app.command('set', help='Set bucket default retention.\n\
|
|
212
|
+
@object_lock_app.command('set', help='Set bucket default retention.\n\nChanges the default retention applied to new objects in a bucket that has object lock. Send `rule: null` to remove the default. Requires scope: object-storage.write.\n\nAPI: PUT /object-storage/buckets/{bucket_name}/object-lock (setBucketObjectLock).', short_help='Set bucket default retention')
|
|
211
213
|
@handle_api_errors
|
|
212
214
|
def set_bucket_object_lock(
|
|
213
215
|
ctx: typer.Context,
|
|
@@ -225,7 +227,7 @@ def set_bucket_object_lock(
|
|
|
225
227
|
emit(result)
|
|
226
228
|
|
|
227
229
|
|
|
228
|
-
@notifications_app.command('get', help="Get bucket event notifications.\n\
|
|
230
|
+
@notifications_app.command('get', help="Get bucket event notifications.\n\nReturns the webhook notification rules of the bucket, as the portal's Settings › Event notifications tab shows them. Requires scope: object-storage.read.\n\nAPI: GET /object-storage/buckets/{bucket_name}/notifications (getBucketNotifications).", short_help='Get bucket event notifications')
|
|
229
231
|
@handle_api_errors
|
|
230
232
|
def get_bucket_notifications(
|
|
231
233
|
ctx: typer.Context,
|
|
@@ -236,7 +238,7 @@ def get_bucket_notifications(
|
|
|
236
238
|
emit(result)
|
|
237
239
|
|
|
238
240
|
|
|
239
|
-
@notifications_app.command('set', help='Set bucket event notifications.\n\
|
|
241
|
+
@notifications_app.command('set', help='Set bucket event notifications.\n\nReplaces every notification rule of the bucket. Each rule posts `upload` or `delete` events, optionally filtered by prefix or suffix, to a webhook URL. Requires scope: object-storage.write.\n\nAPI: PUT /object-storage/buckets/{bucket_name}/notifications (setBucketNotifications).', short_help='Set bucket event notifications')
|
|
240
242
|
@handle_api_errors
|
|
241
243
|
def set_bucket_notifications(
|
|
242
244
|
ctx: typer.Context,
|
|
@@ -254,7 +256,7 @@ def set_bucket_notifications(
|
|
|
254
256
|
emit(result)
|
|
255
257
|
|
|
256
258
|
|
|
257
|
-
@notifications_app.command('delete', help='Delete bucket event notifications.\n\
|
|
259
|
+
@notifications_app.command('delete', help='Delete bucket event notifications.\n\nRemoves 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
260
|
@handle_api_errors
|
|
259
261
|
def delete_bucket_notifications(
|
|
260
262
|
ctx: typer.Context,
|
|
@@ -272,7 +274,7 @@ def delete_bucket_notifications(
|
|
|
272
274
|
emit(result)
|
|
273
275
|
|
|
274
276
|
|
|
275
|
-
@domains_app.command('get', help="Get bucket custom domains.\n\
|
|
277
|
+
@domains_app.command('get', help="Get bucket custom domains.\n\nReturns the bucket's custom domains with their status and the CNAME target to point them at, as the portal's Settings › Custom domains tab shows. Read `cname_target` here before adding the first domain: `custom_domains` is empty until then. Requires scope: object-storage.read.\n\nAPI: GET /object-storage/buckets/{bucket_name}/custom-domains (getBucketCustomDomains).", short_help='Get bucket custom domains')
|
|
276
278
|
@handle_api_errors
|
|
277
279
|
def get_bucket_custom_domains(
|
|
278
280
|
ctx: typer.Context,
|
|
@@ -283,7 +285,7 @@ def get_bucket_custom_domains(
|
|
|
283
285
|
emit(result)
|
|
284
286
|
|
|
285
287
|
|
|
286
|
-
@domains_app.command('add', help='Add a bucket custom domain.\n\
|
|
288
|
+
@domains_app.command('add', help='Add a bucket custom domain.\n\nAdds a custom hostname that serves the bucket. Do it in this order: read `cname_target` from the list, create a CNAME record from your hostname to it at your DNS provider, then add the domain. The add is refused with 400 (`CNAME verification failed: …`, naming the target) until the record resolves, and the bucket must be public. Then check `status` on the list. Requires scope: object-storage.write.\n\nAPI: POST /object-storage/buckets/{bucket_name}/custom-domains (addBucketCustomDomain).', short_help='Add a bucket custom domain')
|
|
287
289
|
@handle_api_errors
|
|
288
290
|
def add_bucket_custom_domain(
|
|
289
291
|
ctx: typer.Context,
|
|
@@ -301,7 +303,7 @@ def add_bucket_custom_domain(
|
|
|
301
303
|
emit(result)
|
|
302
304
|
|
|
303
305
|
|
|
304
|
-
@domains_app.command('remove', help='Remove a bucket custom domain.\n\
|
|
306
|
+
@domains_app.command('remove', help='Remove a bucket custom domain.\n\nRemoves 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
307
|
@handle_api_errors
|
|
306
308
|
def remove_bucket_custom_domain(
|
|
307
309
|
ctx: typer.Context,
|
|
@@ -321,7 +323,7 @@ def remove_bucket_custom_domain(
|
|
|
321
323
|
emit(result)
|
|
322
324
|
|
|
323
325
|
|
|
324
|
-
@app.command('metrics', help="Get bucket metrics.\n\
|
|
326
|
+
@app.command('metrics', help="Get bucket metrics.\n\nReturns request and storage metrics of the bucket for the last 24 hours or 7 days, as the portal's Metrics tab shows them. Requires scope: object-storage.read.\n\nAPI: GET /object-storage/buckets/{bucket_name}/metrics (getBucketMetrics).", short_help='Get bucket metrics')
|
|
325
327
|
@handle_api_errors
|
|
326
328
|
def get_bucket_metrics(
|
|
327
329
|
ctx: typer.Context,
|
|
@@ -339,7 +341,88 @@ def get_bucket_metrics(
|
|
|
339
341
|
emit(result)
|
|
340
342
|
|
|
341
343
|
|
|
342
|
-
@
|
|
344
|
+
@objects_app.command('upload-link', help='Create an upload link.\n\nReturns a temporary link that uploads exactly one file to this key through the S3 gateway: the file whose size and SHA-256 you send. Send the file with a single HTTP `PUT` to `url`, with exactly the `headers` in the answer; the file never passes through this API. The link carries at most 80,000,000 bytes (larger files: an S3 tool, which uploads in parts) and replaces an object with the same key. It works for `expires_in` seconds (60 to 1,800; 900 when not given), and anyone holding it can use it until then, so treat it like a password. When the file arrives, an organization verified only by the Rs 1 payment that has used its free storage is refused with 403 `free_storage_limit_reached`, and 503 with `Retry-After` means the storage allowance could not be checked: retry later. Check the result with Get object metadata. Requires scope: object-storage.write.\n\nAPI: POST /object-storage/buckets/{bucket_name}/objects/{object_path}/upload-link (createObjectUploadLink).', short_help='Create an upload link')
|
|
345
|
+
@handle_api_errors
|
|
346
|
+
def create_object_upload_link(
|
|
347
|
+
ctx: typer.Context,
|
|
348
|
+
bucket_name: str = typer.Argument(..., metavar='BUCKET_NAME', show_default=False, help='Logical bucket name.'),
|
|
349
|
+
object_path: str = typer.Argument(..., metavar='OBJECT_PATH', show_default=False, help="The object's key, such as `photos/2026/cat.jpg`, sent with plain `/` between segments; percent-encode other reserved characters in a segment (a space as `%20`). At most 1,024 bytes. A key with an empty, `.` or `..` segment, or with `?`, `#`, `%`, `\\` or a control character, is refused with 400."),
|
|
350
|
+
size_bytes: int = typer.Option(..., '--size-bytes', show_default=False, help="The file's exact size in bytes; at most 80,000,000."),
|
|
351
|
+
checksum_sha256: str = typer.Option(..., '--checksum-sha256', show_default=False, help="The file's SHA-256, base64-encoded (44 characters), as `openssl dgst -sha256 -binary FILE | base64` prints it."),
|
|
352
|
+
content_type: Optional[str] = typer.Option(None, '--content-type', show_default=False, help="The file's media type, such as `application/pdf`. Sent with the upload when given."),
|
|
353
|
+
expires: Optional[int] = typer.Option(None, '--expires', show_default=False, help='Seconds the link works.'),
|
|
354
|
+
) -> None:
|
|
355
|
+
client = sdk(ctx)
|
|
356
|
+
result = client.object_storage.create_object_upload_link(
|
|
357
|
+
bucket_name,
|
|
358
|
+
object_path,
|
|
359
|
+
**compact(
|
|
360
|
+
workspace_id=workspace(ctx),
|
|
361
|
+
size_bytes=size_bytes,
|
|
362
|
+
checksum_sha256=checksum_sha256,
|
|
363
|
+
content_type=content_type,
|
|
364
|
+
expires=expires,
|
|
365
|
+
),
|
|
366
|
+
)
|
|
367
|
+
emit(result)
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
@objects_app.command('upload', help="Upload one file with an upload link: computes the file's size and SHA-256, asks for the link (createObjectUploadLink) and PUTs the file to it on the workspace's S3 host (the API token is not sent there). One link carries one whole file; the server refuses what it does not accept. Prints the key, size, SHA-256 and ETag; check them with `buckets objects metadata`.", short_help='Upload one file with an upload link')
|
|
371
|
+
@handle_api_errors
|
|
372
|
+
def upload_file(
|
|
373
|
+
ctx: typer.Context,
|
|
374
|
+
bucket_name: str = typer.Argument(..., metavar='BUCKET_NAME', show_default=False, help='Logical bucket name.'),
|
|
375
|
+
object_path: str = typer.Argument(..., metavar='OBJECT_PATH', show_default=False, help="The object's key, such as `photos/2026/cat.jpg`, sent with plain `/` between segments; percent-encode other reserved characters in a segment (a space as `%20`). At most 1,024 bytes. A key with an empty, `.` or `..` segment, or with `?`, `#`, `%`, `\\` or a control character, is refused with 400."),
|
|
376
|
+
file: str = typer.Argument(..., metavar='FILE', show_default=False, help='The file to upload; - reads stdin.'),
|
|
377
|
+
content_type: Optional[str] = typer.Option(None, '--content-type', show_default=False, help="The file's media type, such as `application/pdf`. Sent with the upload when given."),
|
|
378
|
+
expires: Optional[int] = typer.Option(None, '--expires', show_default=False, help='Seconds the link works.'),
|
|
379
|
+
) -> None:
|
|
380
|
+
client = sdk(ctx)
|
|
381
|
+
result = client.upload_file(bucket_name, object_path, read_file(file), **compact(workspace_id=workspace(ctx), content_type=content_type, expires=expires))
|
|
382
|
+
emit(result)
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
@objects_app.command('download-link', help='Create a download link.\n\nReturns a temporary link that downloads one object through the S3 gateway with an HTTP `GET`. Anyone holding the link can download the object until it expires, so share it only with whom it is meant for. It works for `expires_in` seconds (60 to 1,800; 900 when not given). `disposition: attachment` makes a browser save the file instead of showing it. The link is made even when no object has this key; the download then answers 404. Requires scope: object-storage.read.\n\nAPI: POST /object-storage/buckets/{bucket_name}/objects/{object_path}/download-link (createObjectDownloadLink).', short_help='Create a download link')
|
|
386
|
+
@handle_api_errors
|
|
387
|
+
def create_object_download_link(
|
|
388
|
+
ctx: typer.Context,
|
|
389
|
+
bucket_name: str = typer.Argument(..., metavar='BUCKET_NAME', show_default=False, help='Logical bucket name.'),
|
|
390
|
+
object_path: str = typer.Argument(..., metavar='OBJECT_PATH', show_default=False, help="The object's key, such as `photos/2026/cat.jpg`, sent with plain `/` between segments; percent-encode other reserved characters in a segment (a space as `%20`). At most 1,024 bytes. A key with an empty, `.` or `..` segment, or with `?`, `#`, `%`, `\\` or a control character, is refused with 400."),
|
|
391
|
+
expires: Optional[int] = typer.Option(None, '--expires', show_default=False, help='Seconds the link works.'),
|
|
392
|
+
disposition: Optional[str] = typer.Option(None, '--disposition', show_default=False, help='`attachment` makes a browser save the file under its name; `inline` lets it show the file. Not set: the browser decides.'),
|
|
393
|
+
) -> None:
|
|
394
|
+
client = sdk(ctx)
|
|
395
|
+
result = client.object_storage.create_object_download_link(
|
|
396
|
+
bucket_name,
|
|
397
|
+
object_path,
|
|
398
|
+
**compact(
|
|
399
|
+
workspace_id=workspace(ctx),
|
|
400
|
+
expires=expires,
|
|
401
|
+
disposition=disposition,
|
|
402
|
+
),
|
|
403
|
+
)
|
|
404
|
+
emit(result)
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
@objects_app.command('metadata', help="Get object metadata.\n\nReturns one object's size, SHA-256 (for a file uploaded whole with a checksum, as upload links always do), ETag, content type, last change and custom metadata without downloading it. Use it to confirm an upload made with a link: compare `size_bytes` and `checksum_sha256` with the file you sent. 404 when no object has this key. Requires scope: object-storage.read.\n\nAPI: GET /object-storage/buckets/{bucket_name}/objects/{object_path}/metadata (getObjectMetadata).", short_help='Get object metadata')
|
|
408
|
+
@handle_api_errors
|
|
409
|
+
def get_object_metadata(
|
|
410
|
+
ctx: typer.Context,
|
|
411
|
+
bucket_name: str = typer.Argument(..., metavar='BUCKET_NAME', show_default=False, help='Logical bucket name.'),
|
|
412
|
+
object_path: str = typer.Argument(..., metavar='OBJECT_PATH', show_default=False, help="The object's key, such as `photos/2026/cat.jpg`, sent with plain `/` between segments; percent-encode other reserved characters in a segment (a space as `%20`). At most 1,024 bytes. A key with an empty, `.` or `..` segment, or with `?`, `#`, `%`, `\\` or a control character, is refused with 400."),
|
|
413
|
+
) -> None:
|
|
414
|
+
client = sdk(ctx)
|
|
415
|
+
result = client.object_storage.get_object_metadata(
|
|
416
|
+
bucket_name,
|
|
417
|
+
object_path,
|
|
418
|
+
**compact(
|
|
419
|
+
workspace_id=workspace(ctx),
|
|
420
|
+
),
|
|
421
|
+
)
|
|
422
|
+
emit(result)
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
@credentials_app.command('list', help='List S3 credentials.\n\nLists S3-compatible credentials without secret keys. Requires scope: object-storage.read.\n\nAPI: GET /object-storage/credentials (listS3Credentials).', short_help='List S3 credentials')
|
|
343
426
|
@handle_api_errors
|
|
344
427
|
def list_s3credentials(
|
|
345
428
|
ctx: typer.Context,
|
|
@@ -349,7 +432,7 @@ def list_s3credentials(
|
|
|
349
432
|
emit(result, collection='credentials', id_field='access_key_id')
|
|
350
433
|
|
|
351
434
|
|
|
352
|
-
@credentials_app.command('create', help='Create S3 credential.\n\
|
|
435
|
+
@credentials_app.command('create', help='Create S3 credential.\n\nCreates an access key pair. The secret is returned only once. Requires scope: object-storage.write.\n\nAPI: POST /object-storage/credentials (createS3Credential).', short_help='Create S3 credential')
|
|
353
436
|
@handle_api_errors
|
|
354
437
|
def create_s3credential(
|
|
355
438
|
ctx: typer.Context,
|
|
@@ -371,7 +454,7 @@ def create_s3credential(
|
|
|
371
454
|
emit(result)
|
|
372
455
|
|
|
373
456
|
|
|
374
|
-
@credentials_app.command('get', help='Get S3 credential.\n\
|
|
457
|
+
@credentials_app.command('get', help='Get S3 credential.\n\nReturns credential metadata without the secret key. Requires scope: object-storage.read.\n\nAPI: GET /object-storage/credentials/{access_key_id} (getS3Credential).', short_help='Get S3 credential')
|
|
375
458
|
@handle_api_errors
|
|
376
459
|
def get_s3credential(
|
|
377
460
|
ctx: typer.Context,
|
|
@@ -382,7 +465,7 @@ def get_s3credential(
|
|
|
382
465
|
emit(result)
|
|
383
466
|
|
|
384
467
|
|
|
385
|
-
@credentials_app.command('delete', help='Delete S3 credential.\n\
|
|
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; the portal deletes revoked credentials only. Requires scope: object-storage.write.\n\nAPI: DELETE /object-storage/credentials/{access_key_id} (deleteS3Credential).', short_help='Delete S3 credential')
|
|
386
469
|
@handle_api_errors
|
|
387
470
|
def delete_s3credential(
|
|
388
471
|
ctx: typer.Context,
|
|
@@ -395,7 +478,7 @@ def delete_s3credential(
|
|
|
395
478
|
emit(result)
|
|
396
479
|
|
|
397
480
|
|
|
398
|
-
@credentials_app.command('revoke', help='Revoke S3 credential.\n\
|
|
481
|
+
@credentials_app.command('revoke', help='Revoke S3 credential.\n\nRevokes a credential so it can no longer authenticate S3 requests. The record stays listed as revoked, as in the portal; delete it afterwards with DELETE /object-storage/credentials/{access_key_id}. Requires scope: object-storage.write.\n\nAPI: POST /object-storage/credentials/{access_key_id}/revoke (revokeS3Credential).', short_help='Revoke S3 credential')
|
|
399
482
|
@handle_api_errors
|
|
400
483
|
def revoke_s3credential(
|
|
401
484
|
ctx: typer.Context,
|