Skip to content

Commit 48e3541

Browse files
feat(bucket): add alpha bucket commands for object storage data plane
Adds the 'stackit alpha bucket' command group (ls, cp, mv, mb, rb, rm, presign) with a hand-rolled SigV4-signed S3 data-plane client, s3:// and STACKIT URL reference parsing, and object_storage_* config keys.
1 parent 7893da2 commit 48e3541

39 files changed

Lines changed: 5066 additions & 16 deletions

‎docs/stackit_alpha.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ stackit alpha [flags]
4141
### SEE ALSO
4242

4343
* [stackit](./stackit.md) - Manage STACKIT resources using the command line
44+
* [stackit alpha bucket](./stackit_alpha_bucket.md) - Manages objects in STACKIT Object Storage buckets (data plane)
4445
* [stackit alpha vpc](./stackit_alpha_vpc.md) - Manages vpcs
4546

‎docs/stackit_alpha_bucket.md‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
## stackit alpha bucket
2+
3+
Manages objects in STACKIT Object Storage buckets (data plane)
4+
5+
### Synopsis
6+
7+
Manages objects in STACKIT Object Storage buckets.
8+
9+
Buckets and objects can be addressed with s3 URIs (s3://BUCKET[/KEY]) or
10+
STACKIT Object Storage URLs in virtual hosted style
11+
(https://BUCKET.object.storage.REGION.onstackit.cloud[/KEY]) or path style
12+
(https://object.storage.REGION.onstackit.cloud/BUCKET[/KEY]).
13+
14+
Credentials (access key ID / secret access key) are required and can be provided
15+
with the --access-key-id and --secret-access-key flags, the STACKIT_OBJECT_STORAGE_ACCESS_KEY_ID
16+
and STACKIT_OBJECT_STORAGE_SECRET_ACCESS_KEY environment variables, or the config file.
17+
Create credentials with 'stackit object-storage credentials create'.
18+
19+
```
20+
stackit alpha bucket [flags]
21+
```
22+
23+
### Examples
24+
25+
```
26+
List all buckets
27+
$ stackit alpha bucket ls
28+
29+
Upload a file to a bucket
30+
$ stackit alpha bucket cp local/file.txt s3://my-bucket/file.txt
31+
```
32+
33+
### Options
34+
35+
```
36+
-h, --help[=true|false] Help for "stackit alpha bucket"
37+
```
38+
39+
### Options inherited from parent commands
40+
41+
```
42+
-y, --assume-yes[=true|false] If set, skips all confirmation prompts
43+
--async[=true|false] If set, runs the command asynchronously
44+
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
45+
-p, --project-id string Project ID
46+
--region string Target region for region-specific requests
47+
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
48+
```
49+
50+
### SEE ALSO
51+
52+
* [stackit alpha](./stackit_alpha.md) - Contains alpha STACKIT CLI commands
53+
* [stackit alpha bucket cp](./stackit_alpha_bucket_cp.md) - Copies objects between local and Object Storage
54+
* [stackit alpha bucket ls](./stackit_alpha_bucket_ls.md) - Lists buckets and objects
55+
* [stackit alpha bucket mb](./stackit_alpha_bucket_mb.md) - Creates a bucket
56+
* [stackit alpha bucket mv](./stackit_alpha_bucket_mv.md) - Moves objects between local and Object Storage
57+
* [stackit alpha bucket presign](./stackit_alpha_bucket_presign.md) - Generates a presigned URL for an object
58+
* [stackit alpha bucket rb](./stackit_alpha_bucket_rb.md) - Deletes a bucket
59+
* [stackit alpha bucket rm](./stackit_alpha_bucket_rm.md) - Deletes objects
60+

‎docs/stackit_alpha_bucket_cp.md‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
## stackit alpha bucket cp
2+
3+
Copies objects between local and Object Storage
4+
5+
### Synopsis
6+
7+
Copies a single object or a directory tree between local storage and Object Storage.
8+
9+
One of SRC and DESTINATION must be a bucket URI (s3://BUCKET[/KEY]) or a STACKIT
10+
Object Storage URL (https://BUCKET.object.storage.REGION.onstackit.cloud[/KEY])
11+
and the other a local path.
12+
Without --recursive, a single object is transferred.
13+
With --recursive, all objects under the prefix (download) or all files under the
14+
local directory (upload) are transferred.
15+
16+
```
17+
stackit alpha bucket cp SRC DESTINATION [flags]
18+
```
19+
20+
### Examples
21+
22+
```
23+
Upload a file to a bucket
24+
$ stackit alpha bucket cp local/file.txt s3://my-bucket/file.txt
25+
26+
Download a single object
27+
$ stackit alpha bucket cp s3://my-bucket/file.txt local/file.txt
28+
29+
Upload a directory recursively
30+
$ stackit alpha bucket cp ./local/dir s3://my-bucket/prefix/ --recursive
31+
32+
Download a prefix recursively
33+
$ stackit alpha bucket cp s3://my-bucket/prefix/ ./local/dir --recursive
34+
```
35+
36+
### Options
37+
38+
```
39+
--access-key-id string Object Storage access key ID. Can also be set with the object_storage_access_key_id config key or the STACKIT_OBJECT_STORAGE_ACCESS_KEY_ID environment variable.
40+
--endpoint string Object Storage API endpoint. Defaults to https://object.storage.<region>.onstackit.cloud. Can also be set with the object_storage_data_plane_custom_endpoint config key or the STACKIT_OBJECT_STORAGE_DATA_PLANE_CUSTOM_ENDPOINT environment variable.
41+
-h, --help[=true|false] Help for "stackit alpha bucket cp"
42+
--recursive[=true|false] Transfer a directory tree or all objects under a prefix
43+
--secret-access-key string Object Storage secret access key. Can also be set with the object_storage_secret_access_key config key or the STACKIT_OBJECT_STORAGE_SECRET_ACCESS_KEY environment variable.
44+
```
45+
46+
### Options inherited from parent commands
47+
48+
```
49+
-y, --assume-yes[=true|false] If set, skips all confirmation prompts
50+
--async[=true|false] If set, runs the command asynchronously
51+
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
52+
-p, --project-id string Project ID
53+
--region string Target region for region-specific requests
54+
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
55+
```
56+
57+
### SEE ALSO
58+
59+
* [stackit alpha bucket](./stackit_alpha_bucket.md) - Manages objects in STACKIT Object Storage buckets (data plane)
60+

‎docs/stackit_alpha_bucket_ls.md‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
## stackit alpha bucket ls
2+
3+
Lists buckets and objects
4+
5+
### Synopsis
6+
7+
Lists all buckets, or the contents of a bucket.
8+
9+
Without an argument, lists all buckets.
10+
With a bucket URI (s3://BUCKET), lists the "directories" and objects at the bucket root.
11+
With an object URI (s3://BUCKET/PREFIX), lists the "directories" and objects under the prefix.
12+
With --recursive, lists all objects under the prefix flat, including all nested keys.
13+
14+
```
15+
stackit alpha bucket ls [BUCKET_URI] [flags]
16+
```
17+
18+
### Examples
19+
20+
```
21+
List all buckets
22+
$ stackit alpha bucket ls
23+
24+
List the contents of a bucket
25+
$ stackit alpha bucket ls s3://my-bucket
26+
27+
Recursively list all objects under a prefix
28+
$ stackit alpha bucket ls s3://my-bucket/path/to/ --recursive
29+
```
30+
31+
### Options
32+
33+
```
34+
--access-key-id string Object Storage access key ID. Can also be set with the object_storage_access_key_id config key or the STACKIT_OBJECT_STORAGE_ACCESS_KEY_ID environment variable.
35+
--endpoint string Object Storage API endpoint. Defaults to https://object.storage.<region>.onstackit.cloud. Can also be set with the object_storage_data_plane_custom_endpoint config key or the STACKIT_OBJECT_STORAGE_DATA_PLANE_CUSTOM_ENDPOINT environment variable.
36+
-h, --help[=true|false] Help for "stackit alpha bucket ls"
37+
--recursive[=true|false] List all objects under the prefix recursively, including nested keys
38+
--secret-access-key string Object Storage secret access key. Can also be set with the object_storage_secret_access_key config key or the STACKIT_OBJECT_STORAGE_SECRET_ACCESS_KEY environment variable.
39+
```
40+
41+
### Options inherited from parent commands
42+
43+
```
44+
-y, --assume-yes[=true|false] If set, skips all confirmation prompts
45+
--async[=true|false] If set, runs the command asynchronously
46+
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
47+
-p, --project-id string Project ID
48+
--region string Target region for region-specific requests
49+
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
50+
```
51+
52+
### SEE ALSO
53+
54+
* [stackit alpha bucket](./stackit_alpha_bucket.md) - Manages objects in STACKIT Object Storage buckets (data plane)
55+

‎docs/stackit_alpha_bucket_mb.md‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## stackit alpha bucket mb
2+
3+
Creates a bucket
4+
5+
### Synopsis
6+
7+
Creates a bucket in STACKIT Object Storage.
8+
9+
```
10+
stackit alpha bucket mb BUCKET_URI [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Create a bucket
17+
$ stackit alpha bucket mb s3://my-bucket
18+
```
19+
20+
### Options
21+
22+
```
23+
--access-key-id string Object Storage access key ID. Can also be set with the object_storage_access_key_id config key or the STACKIT_OBJECT_STORAGE_ACCESS_KEY_ID environment variable.
24+
--endpoint string Object Storage API endpoint. Defaults to https://object.storage.<region>.onstackit.cloud. Can also be set with the object_storage_data_plane_custom_endpoint config key or the STACKIT_OBJECT_STORAGE_DATA_PLANE_CUSTOM_ENDPOINT environment variable.
25+
-h, --help[=true|false] Help for "stackit alpha bucket mb"
26+
--secret-access-key string Object Storage secret access key. Can also be set with the object_storage_secret_access_key config key or the STACKIT_OBJECT_STORAGE_SECRET_ACCESS_KEY environment variable.
27+
```
28+
29+
### Options inherited from parent commands
30+
31+
```
32+
-y, --assume-yes[=true|false] If set, skips all confirmation prompts
33+
--async[=true|false] If set, runs the command asynchronously
34+
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
35+
-p, --project-id string Project ID
36+
--region string Target region for region-specific requests
37+
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
38+
```
39+
40+
### SEE ALSO
41+
42+
* [stackit alpha bucket](./stackit_alpha_bucket.md) - Manages objects in STACKIT Object Storage buckets (data plane)
43+

‎docs/stackit_alpha_bucket_mv.md‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
## stackit alpha bucket mv
2+
3+
Moves objects between local and Object Storage
4+
5+
### Synopsis
6+
7+
Moves a single object or a directory tree, then deletes the source.
8+
9+
One of SRC and DESTINATION must be a bucket URI (s3://BUCKET[/KEY]) or a STACKIT
10+
Object Storage URL (https://BUCKET.object.storage.REGION.onstackit.cloud[/KEY])
11+
and the other a local path.
12+
Bucket-to-bucket moves use a server-side copy.
13+
Without --recursive, a single object is moved.
14+
With --recursive, all objects under the prefix (or all files under the local directory) are moved.
15+
16+
```
17+
stackit alpha bucket mv SRC DESTINATION [flags]
18+
```
19+
20+
### Examples
21+
22+
```
23+
Move a file to a bucket
24+
$ stackit alpha bucket mv local/file.txt s3://my-bucket/file.txt
25+
26+
Move an object to a new key
27+
$ stackit alpha bucket mv s3://my-bucket/old/file.txt s3://my-bucket/new/file.txt
28+
29+
Move a prefix to another bucket recursively
30+
$ stackit alpha bucket mv s3://src-bucket/prefix/ s3://dst-bucket/prefix/ --recursive
31+
```
32+
33+
### Options
34+
35+
```
36+
--access-key-id string Object Storage access key ID. Can also be set with the object_storage_access_key_id config key or the STACKIT_OBJECT_STORAGE_ACCESS_KEY_ID environment variable.
37+
--endpoint string Object Storage API endpoint. Defaults to https://object.storage.<region>.onstackit.cloud. Can also be set with the object_storage_data_plane_custom_endpoint config key or the STACKIT_OBJECT_STORAGE_DATA_PLANE_CUSTOM_ENDPOINT environment variable.
38+
-h, --help[=true|false] Help for "stackit alpha bucket mv"
39+
--recursive[=true|false] Move a directory tree or all objects under a prefix
40+
--secret-access-key string Object Storage secret access key. Can also be set with the object_storage_secret_access_key config key or the STACKIT_OBJECT_STORAGE_SECRET_ACCESS_KEY environment variable.
41+
```
42+
43+
### Options inherited from parent commands
44+
45+
```
46+
-y, --assume-yes[=true|false] If set, skips all confirmation prompts
47+
--async[=true|false] If set, runs the command asynchronously
48+
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
49+
-p, --project-id string Project ID
50+
--region string Target region for region-specific requests
51+
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
52+
```
53+
54+
### SEE ALSO
55+
56+
* [stackit alpha bucket](./stackit_alpha_bucket.md) - Manages objects in STACKIT Object Storage buckets (data plane)
57+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## stackit alpha bucket presign
2+
3+
Generates a presigned URL for an object
4+
5+
### Synopsis
6+
7+
Generates a presigned URL that grants time-limited read access to an object
8+
without exposing the Object Storage credentials.
9+
10+
```
11+
stackit alpha bucket presign BUCKET_URI [flags]
12+
```
13+
14+
### Examples
15+
16+
```
17+
Generate a presigned URL valid for 1 hour (default)
18+
$ stackit alpha bucket presign s3://my-bucket/file.txt
19+
20+
Generate a presigned URL valid for 15 minutes
21+
$ stackit alpha bucket presign s3://my-bucket/file.txt --expires 15m
22+
```
23+
24+
### Options
25+
26+
```
27+
--access-key-id string Object Storage access key ID. Can also be set with the object_storage_access_key_id config key or the STACKIT_OBJECT_STORAGE_ACCESS_KEY_ID environment variable.
28+
--endpoint string Object Storage API endpoint. Defaults to https://object.storage.<region>.onstackit.cloud. Can also be set with the object_storage_data_plane_custom_endpoint config key or the STACKIT_OBJECT_STORAGE_DATA_PLANE_CUSTOM_ENDPOINT environment variable.
29+
--expires duration Expiration of the presigned URL (e.g. 15m, 1h, 72h). Maximum: 7 days (default 1h0m0s)
30+
-h, --help[=true|false] Help for "stackit alpha bucket presign"
31+
--secret-access-key string Object Storage secret access key. Can also be set with the object_storage_secret_access_key config key or the STACKIT_OBJECT_STORAGE_SECRET_ACCESS_KEY environment variable.
32+
```
33+
34+
### Options inherited from parent commands
35+
36+
```
37+
-y, --assume-yes[=true|false] If set, skips all confirmation prompts
38+
--async[=true|false] If set, runs the command asynchronously
39+
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
40+
-p, --project-id string Project ID
41+
--region string Target region for region-specific requests
42+
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
43+
```
44+
45+
### SEE ALSO
46+
47+
* [stackit alpha bucket](./stackit_alpha_bucket.md) - Manages objects in STACKIT Object Storage buckets (data plane)
48+

‎docs/stackit_alpha_bucket_rb.md‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## stackit alpha bucket rb
2+
3+
Deletes a bucket
4+
5+
### Synopsis
6+
7+
Deletes a bucket in STACKIT Object Storage. The bucket must be empty.
8+
9+
```
10+
stackit alpha bucket rb BUCKET_URI [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Delete an empty bucket
17+
$ stackit alpha bucket rb s3://my-bucket
18+
```
19+
20+
### Options
21+
22+
```
23+
--access-key-id string Object Storage access key ID. Can also be set with the object_storage_access_key_id config key or the STACKIT_OBJECT_STORAGE_ACCESS_KEY_ID environment variable.
24+
--endpoint string Object Storage API endpoint. Defaults to https://object.storage.<region>.onstackit.cloud. Can also be set with the object_storage_data_plane_custom_endpoint config key or the STACKIT_OBJECT_STORAGE_DATA_PLANE_CUSTOM_ENDPOINT environment variable.
25+
-h, --help[=true|false] Help for "stackit alpha bucket rb"
26+
--secret-access-key string Object Storage secret access key. Can also be set with the object_storage_secret_access_key config key or the STACKIT_OBJECT_STORAGE_SECRET_ACCESS_KEY environment variable.
27+
```
28+
29+
### Options inherited from parent commands
30+
31+
```
32+
-y, --assume-yes[=true|false] If set, skips all confirmation prompts
33+
--async[=true|false] If set, runs the command asynchronously
34+
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
35+
-p, --project-id string Project ID
36+
--region string Target region for region-specific requests
37+
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
38+
```
39+
40+
### SEE ALSO
41+
42+
* [stackit alpha bucket](./stackit_alpha_bucket.md) - Manages objects in STACKIT Object Storage buckets (data plane)
43+

0 commit comments

Comments
 (0)