Skip to content

Commit 79a63a9

Browse files
authored
Merge branch 'scaleway:master' into master
2 parents 0cf59b2 + d6c5314 commit 79a63a9

File tree

6 files changed

+200
-10
lines changed

6 files changed

+200
-10
lines changed

commands/commands.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
domain "github.com/scaleway/scaleway-cli/v2/internal/namespaces/domain/v2beta1"
2121
edgeservices "github.com/scaleway/scaleway-cli/v2/internal/namespaces/edge_services/v1beta1"
2222
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/feedback"
23+
file "github.com/scaleway/scaleway-cli/v2/internal/namespaces/file/v1alpha1"
2324
flexibleip "github.com/scaleway/scaleway-cli/v2/internal/namespaces/flexibleip/v1alpha1"
2425
function "github.com/scaleway/scaleway-cli/v2/internal/namespaces/function/v1beta1"
2526
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/help"
@@ -115,7 +116,10 @@ func GetCommands() *core.Commands {
115116
)
116117

117118
if beta {
118-
commands.Merge(dedibox.GetCommands())
119+
commands.MergeAll(
120+
dedibox.GetCommands(),
121+
file.GetCommands(),
122+
)
119123
}
120124

121125
return commands

core/command.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@ func (c *Commands) Merge(cmds *Commands) {
291291
}
292292
}
293293

294+
func (c *Commands) MergeAll(cmds ...*Commands) {
295+
for _, command := range cmds {
296+
c.Merge(command)
297+
}
298+
}
299+
294300
func (c *Commands) GetAll() []*Command {
295301
return c.commands
296302
}

docs/commands/file.md

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
<!-- DO NOT EDIT: this file is automatically generated using scw-doc-gen -->
2+
# Documentation for `scw file`
3+
This API allows you to manage your File Storage resources.
4+
5+
- [Attachment management](#attachment-management)
6+
- [List filesystems attachments](#list-filesystems-attachments)
7+
- [Filesystem management](#filesystem-management)
8+
- [Create a new filesystem](#create-a-new-filesystem)
9+
- [Delete a detached filesystem](#delete-a-detached-filesystem)
10+
- [Get filesystem details](#get-filesystem-details)
11+
- [List all filesystems](#list-all-filesystems)
12+
- [Update filesystem properties](#update-filesystem-properties)
13+
14+
15+
## Attachment management
16+
17+
Attachment management.
18+
19+
20+
### List filesystems attachments
21+
22+
List all existing attachments in a specified region.
23+
By default, the attachments listed are ordered by creation date in ascending order.
24+
This can be modified using the `order_by` field.
25+
26+
**Usage:**
27+
28+
```
29+
scw file attachment list [arg=value ...]
30+
```
31+
32+
33+
**Args:**
34+
35+
| Name | | Description |
36+
|------|---|-------------|
37+
| filesystem-id | | UUID of the File Storage volume |
38+
| resource-id | | Filter by resource ID |
39+
| resource-type | One of: `unknown_resource_type`, `instance_server` | Filter by resource type |
40+
| zone | | Filter by resource zone |
41+
| region | Default: `fr-par`<br />One of: `fr-par`, `all` | Region to target. If none is passed will use default region from the config |
42+
43+
44+
45+
## Filesystem management
46+
47+
Filesystem management.
48+
49+
50+
### Create a new filesystem
51+
52+
To create a new filesystem, you need to provide a name, a size, and a project ID.
53+
54+
**Usage:**
55+
56+
```
57+
scw file filesystem create [arg=value ...]
58+
```
59+
60+
61+
**Args:**
62+
63+
| Name | | Description |
64+
|------|---|-------------|
65+
| name | Required | Name of the filesystem |
66+
| project-id | | Project ID to use. If none is passed the default project ID will be used |
67+
| size | Required | Filesystem size in bytes, with a granularity of 100 GB (10^11 bytes). |
68+
| tags.{index} | | List of tags assigned to the filesystem |
69+
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
70+
71+
72+
73+
### Delete a detached filesystem
74+
75+
You must specify the `filesystem_id` of the filesystem you want to delete.
76+
77+
**Usage:**
78+
79+
```
80+
scw file filesystem delete <filesystem-id ...> [arg=value ...]
81+
```
82+
83+
84+
**Args:**
85+
86+
| Name | | Description |
87+
|------|---|-------------|
88+
| filesystem-id | Required | UUID of the filesystem |
89+
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
90+
91+
92+
93+
### Get filesystem details
94+
95+
Retrieve all properties and current status of a specific filesystem identified by its ID.
96+
97+
**Usage:**
98+
99+
```
100+
scw file filesystem get <filesystem-id ...> [arg=value ...]
101+
```
102+
103+
104+
**Args:**
105+
106+
| Name | | Description |
107+
|------|---|-------------|
108+
| filesystem-id | Required | UUID of the filesystem |
109+
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
110+
111+
112+
113+
### List all filesystems
114+
115+
Retrieve all filesystems in the specified region. Results are ordered by creation date in ascending order by default.
116+
Use the order_by parameter to modify the sorting behavior.
117+
118+
**Usage:**
119+
120+
```
121+
scw file filesystem list [arg=value ...]
122+
```
123+
124+
125+
**Args:**
126+
127+
| Name | | Description |
128+
|------|---|-------------|
129+
| order-by | One of: `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc` | Criteria to use when ordering the list |
130+
| project-id | | Filter by project ID |
131+
| name | | Filter the return filesystems by their names |
132+
| tags.{index} | | Filter by tags. Only filesystems with one or more matching tags will be returned |
133+
| region | Default: `fr-par`<br />One of: `fr-par`, `all` | Region to target. If none is passed will use default region from the config |
134+
135+
136+
137+
### Update filesystem properties
138+
139+
Update the technical details of a filesystem, such as its name, tags or its new size.
140+
You can only resize a filesystem to a larger size.
141+
142+
**Usage:**
143+
144+
```
145+
scw file filesystem update [arg=value ...]
146+
```
147+
148+
149+
**Args:**
150+
151+
| Name | | Description |
152+
|------|---|-------------|
153+
| filesystem-id | Required | UUID of the filesystem |
154+
| name | | When defined, is the new name of the filesystem |
155+
| size | | Optional field for increasing the size of the filesystem (must be larger than the current size) |
156+
| tags.{index} | | List of tags assigned to the filesystem |
157+
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
158+
159+
160+

go.mod

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/aws/aws-sdk-go-v2/service/s3 v1.79.3
88
github.com/buildpacks/pack v0.34.2
99
github.com/c-bata/go-prompt v0.2.6
10-
github.com/charmbracelet/bubbletea v1.3.4
10+
github.com/charmbracelet/bubbletea v1.3.5
1111
github.com/chzyer/readline v1.5.1
1212
github.com/containerd/console v1.0.4
1313
github.com/dnaeon/go-vcr v1.2.0
@@ -78,8 +78,10 @@ require (
7878
github.com/buildpacks/imgutil v0.0.0-20240605145725-186f89b2d168 // indirect
7979
github.com/buildpacks/lifecycle v0.19.6 // indirect
8080
github.com/cespare/xxhash/v2 v2.2.0 // indirect
81-
github.com/charmbracelet/lipgloss v1.0.0 // indirect
81+
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
82+
github.com/charmbracelet/lipgloss v1.1.0 // indirect
8283
github.com/charmbracelet/x/ansi v0.8.0 // indirect
84+
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
8385
github.com/charmbracelet/x/term v0.2.1 // indirect
8486
github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589 // indirect
8587
github.com/cloudflare/circl v1.3.7 // indirect
@@ -150,7 +152,7 @@ require (
150152
github.com/morikuni/aec v1.0.0 // indirect
151153
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
152154
github.com/muesli/cancelreader v0.2.2 // indirect
153-
github.com/muesli/termenv v0.15.2 // indirect
155+
github.com/muesli/termenv v0.16.0 // indirect
154156
github.com/opencontainers/image-spec v1.1.0 // indirect
155157
github.com/opencontainers/selinux v1.11.0 // indirect
156158
github.com/pjbgf/sha1cd v0.3.0 // indirect
@@ -177,6 +179,7 @@ require (
177179
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
178180
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
179181
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
182+
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
180183
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.50.0 // indirect
181184
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.50.0 // indirect
182185
go.opentelemetry.io/otel v1.25.0 // indirect

go.sum

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,16 @@ github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY
123123
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
124124
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
125125
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
126-
github.com/charmbracelet/bubbletea v1.3.4 h1:kCg7B+jSCFPLYRA52SDZjr51kG/fMUEoPoZrkaDHyoI=
127-
github.com/charmbracelet/bubbletea v1.3.4/go.mod h1:dtcUCyCGEX3g9tosuYiut3MXgY/Jsv9nKVdibKKRRXo=
128-
github.com/charmbracelet/lipgloss v1.0.0 h1:O7VkGDvqEdGi93X+DeqsQ7PKHDgtQfF8j8/O2qFMQNg=
129-
github.com/charmbracelet/lipgloss v1.0.0/go.mod h1:U5fy9Z+C38obMs+T+tJqst9VGzlOYGj4ri9reL3qUlo=
126+
github.com/charmbracelet/bubbletea v1.3.5 h1:JAMNLTbqMOhSwoELIr0qyP4VidFq72/6E9j7HHmRKQc=
127+
github.com/charmbracelet/bubbletea v1.3.5/go.mod h1:TkCnmH+aBd4LrXhXcqrKiYwRs7qyQx5rBgH5fVY3v54=
128+
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc h1:4pZI35227imm7yK2bGPcfpFEmuY1gc2YSTShr4iJBfs=
129+
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc/go.mod h1:X4/0JoqgTIPSFcRA/P6INZzIuyqdFY5rm8tb41s9okk=
130+
github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY=
131+
github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30=
130132
github.com/charmbracelet/x/ansi v0.8.0 h1:9GTq3xq9caJW8ZrBTe0LIe2fvfLR/bYXKTx2llXn7xE=
131133
github.com/charmbracelet/x/ansi v0.8.0/go.mod h1:wdYl/ONOLHLIVmQaxbIYEC/cRKOQyjTkowiI4blgS9Q=
134+
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd h1:vy0GVL4jeHEwG5YOXDmi86oYw2yuYUGqz6a8sLwg0X8=
135+
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs=
132136
github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
133137
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
134138
github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589 h1:krfRl01rzPzxSxyLyrChD+U+MzsBXbm0OwYYB67uF+4=
@@ -401,8 +405,8 @@ github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D
401405
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo=
402406
github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=
403407
github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
404-
github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo=
405-
github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8=
408+
github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc=
409+
github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
406410
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
407411
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
408412
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
@@ -529,6 +533,8 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo
529533
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
530534
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
531535
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
536+
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
537+
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
532538
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
533539
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
534540
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package file
2+
3+
import "github.com/scaleway/scaleway-cli/v2/core"
4+
5+
func GetCommands() *core.Commands {
6+
cmds := GetGeneratedCommands()
7+
8+
cmds.MustFind("file").Groups = []string{"storage"}
9+
10+
return cmds
11+
}

0 commit comments

Comments
 (0)