Skip to content

Commit 63e198d

Browse files
scaleway-botyfodil
andauthored
feat(file): add new Filesystem Types (#5451)
Co-authored-by: Yacine Fodil <105779815+yfodil@users.noreply.github.com>
1 parent cf943f0 commit 63e198d

File tree

6 files changed

+62
-2
lines changed

6 files changed

+62
-2
lines changed

cmd/scw/testdata/test-all-usage-file-filesystem-create-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ARGS:
99
name Name of the filesystem
1010
[project-id] Project ID to use. If none is passed the default project ID will be used
1111
size Filesystem size in bytes, with a granularity of 100 GB (10^11 bytes).
12+
[type] Type of the filesystem
1213
[tags.{index}] List of tags assigned to the filesystem
1314
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
1415

cmd/scw/testdata/test-all-usage-file-filesystem-list-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ARGS:
99
[order-by] Criteria to use when ordering the list (created_at_asc | created_at_desc | name_asc | name_desc)
1010
[project-id] Filter by project ID
1111
[name] Filter the returned filesystems by their names
12+
[filesystem-type] Type of the filesystem
1213
[tags.{index}] Filter by tags. Only filesystems with one or more matching tags will be returned
1314
[filesystem-ids.{index}] Filter by filesystem IDs. Only filesystems with one or more matching IDs will be returned
1415
[organization-id] Filter by organization ID
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Filesystem-type management.
4+
5+
USAGE:
6+
scw file filesystem-type
7+
8+
FLAGS:
9+
-h, --help help for filesystem-type
10+
--list-sub-commands List all subcommands
11+
12+
GLOBAL FLAGS:
13+
-c, --config string The path to the config file
14+
-D, --debug Enable debug mode
15+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
16+
-p, --profile string The config profile to use

cmd/scw/testdata/test-all-usage-file-usage.golden

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ USAGE:
66
scw file <command>
77

88
AVAILABLE COMMANDS:
9-
attachment Attachment management
10-
filesystem Filesystem management
9+
attachment Attachment management
10+
filesystem Filesystem management
11+
filesystem-type Filesystem-type management
1112

1213
FLAGS:
1314
-h, --help help for file

docs/commands/file.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This API allows you to manage your File Storage resources.
1010
- [Get filesystem details](#get-filesystem-details)
1111
- [List all filesystems](#list-all-filesystems)
1212
- [Update filesystem properties](#update-filesystem-properties)
13+
- [Filesystem-type management](#filesystem-type-management)
1314

1415

1516
## Attachment management
@@ -64,6 +65,7 @@ scw file filesystem create [arg=value ...]
6465
| name | Required | Name of the filesystem |
6566
| project-id | | Project ID to use. If none is passed the default project ID will be used |
6667
| size | Required | Filesystem size in bytes, with a granularity of 100 GB (10^11 bytes). |
68+
| type | | Type of the filesystem |
6769
| tags.{index} | | List of tags assigned to the filesystem |
6870
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
6971

@@ -127,6 +129,7 @@ scw file filesystem list [arg=value ...]
127129
| order-by | One of: `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc` | Criteria to use when ordering the list |
128130
| project-id | | Filter by project ID |
129131
| name | | Filter the returned filesystems by their names |
132+
| filesystem-type | | Type of the filesystem |
130133
| tags.{index} | | Filter by tags. Only filesystems with one or more matching tags will be returned |
131134
| filesystem-ids.{index} | | Filter by filesystem IDs. Only filesystems with one or more matching IDs will be returned |
132135
| organization-id | | Filter by organization ID |
@@ -157,3 +160,17 @@ scw file filesystem update [arg=value ...]
157160

158161

159162

163+
## Filesystem-type management
164+
165+
Filesystem-type management.
166+
167+
Filesystem-type management.
168+
169+
**Usage:**
170+
171+
```
172+
scw file filesystem-type
173+
```
174+
175+
176+

internal/namespaces/file/v1alpha1/file_cli.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ func GetGeneratedCommands() *core.Commands {
2222
fileRoot(),
2323
fileFilesystem(),
2424
fileAttachment(),
25+
fileFilesystemType(),
2526
fileFilesystemGet(),
2627
fileFilesystemList(),
2728
fileAttachmentList(),
@@ -57,6 +58,15 @@ func fileAttachment() *core.Command {
5758
}
5859
}
5960

61+
func fileFilesystemType() *core.Command {
62+
return &core.Command{
63+
Short: `Filesystem-type management`,
64+
Long: `Filesystem-type management.`,
65+
Namespace: "file",
66+
Resource: "filesystem-type",
67+
}
68+
}
69+
6070
func fileFilesystemGet() *core.Command {
6171
return &core.Command{
6272
Short: `Get filesystem details`,
@@ -124,6 +134,13 @@ func fileFilesystemList() *core.Command {
124134
Deprecated: false,
125135
Positional: false,
126136
},
137+
{
138+
Name: "filesystem-type",
139+
Short: `Type of the filesystem`,
140+
Required: false,
141+
Deprecated: false,
142+
Positional: false,
143+
},
127144
{
128145
Name: "tags.{index}",
129146
Short: `Filter by tags. Only filesystems with one or more matching tags will be returned`,
@@ -263,6 +280,13 @@ func fileFilesystemCreate() *core.Command {
263280
Deprecated: false,
264281
Positional: false,
265282
},
283+
{
284+
Name: "type",
285+
Short: `Type of the filesystem`,
286+
Required: false,
287+
Deprecated: false,
288+
Positional: false,
289+
},
266290
{
267291
Name: "tags.{index}",
268292
Short: `List of tags assigned to the filesystem`,

0 commit comments

Comments
 (0)