Skip to content

Commit 620fe1d

Browse files
feat(marketplace/v2): display type field in local-image list cli command (#3961)
Co-authored-by: Jules Casteran <[email protected]>
1 parent e3cc3ba commit 620fe1d

File tree

6 files changed

+47
-23
lines changed

6 files changed

+47
-23
lines changed

cmd/scw/testdata/test-all-usage-dedibox-os-get-usage.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ USAGE:
66
scw dedibox os get [arg=value ...]
77

88
ARGS:
9-
os-id ID of the OS
10-
[server-id] ID of the server
11-
[project-id=<retrieved from config>] Project ID
12-
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1)
9+
os-id ID of the OS
10+
[server-id] ID of the server
11+
[project-id] Project ID
12+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1)
1313

1414
FLAGS:
1515
-h, --help help for get

cmd/scw/testdata/test-all-usage-marketplace-local-image-list-usage.golden

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ USAGE:
66
scw marketplace local-image list [arg=value ...]
77

88
ARGS:
9-
[image-id]
10-
[version-id]
11-
[order-by] (created_at_asc | created_at_desc)
12-
[image-label]
13-
[zone]
14-
[type] (unknown_type | instance_local | instance_sbs)
9+
[order-by] Ordering to use (type_asc | type_desc | created_at_asc | created_at_desc)
10+
[zone] Filter local images available on this Availability Zone
11+
[image-id] Filter by image id
12+
[version-id] Filter by version id
13+
[image-label] Filter by image label
14+
[type] Filter by type (unknown_type | instance_local | instance_sbs)
1515

1616
FLAGS:
1717
-h, --help help for list
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Custom routes.
4+
5+
USAGE:
6+
scw vpc route
7+
8+
FLAGS:
9+
-h, --help help for route
10+
11+
GLOBAL FLAGS:
12+
-c, --config string The path to the config file
13+
-D, --debug Enable debug mode
14+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
15+
-p, --profile string The config profile to use

docs/commands/dedibox.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ scw dedibox os get [arg=value ...]
804804
|------|---|-------------|
805805
| os-id | Required | ID of the OS |
806806
| server-id | | ID of the server |
807-
| project-id | Default: `<retrieved from config>` | Project ID |
807+
| project-id | | Project ID |
808808
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1` | Zone to target. If none is passed will use default zone from the config |
809809

810810

docs/commands/marketplace.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ scw marketplace local-image list [arg=value ...]
137137

138138
| Name | | Description |
139139
|------|---|-------------|
140-
| image-id | | |
141-
| version-id | | |
142-
| order-by | One of: `created_at_asc`, `created_at_desc` | |
143-
| image-label | | |
144-
| zone | | |
145-
| type | One of: `unknown_type`, `instance_local`, `instance_sbs` | |
140+
| order-by | One of: `type_asc`, `type_desc`, `created_at_asc`, `created_at_desc` | Ordering to use |
141+
| zone | | Filter local images available on this Availability Zone |
142+
| image-id | | Filter by image id |
143+
| version-id | | Filter by version id |
144+
| image-label | | Filter by image label |
145+
| type | One of: `unknown_type`, `instance_local`, `instance_sbs` | Filter by type |
146146

147147

148148

internal/namespaces/marketplace/v2/marketplace_cli.go

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,38 +277,44 @@ func marketplaceLocalImageList() *core.Command {
277277
ArgsType: reflect.TypeOf(marketplace.ListLocalImagesRequest{}),
278278
ArgSpecs: core.ArgSpecs{
279279
{
280-
Name: "image-id",
280+
Name: "order-by",
281+
Short: `Ordering to use`,
281282
Required: false,
282283
Deprecated: false,
283284
Positional: false,
285+
EnumValues: []string{"type_asc", "type_desc", "created_at_asc", "created_at_desc"},
284286
},
285287
{
286-
Name: "version-id",
288+
Name: "zone",
289+
Short: `Filter local images available on this Availability Zone`,
287290
Required: false,
288291
Deprecated: false,
289292
Positional: false,
290293
},
291294
{
292-
Name: "order-by",
295+
Name: "image-id",
296+
Short: `Filter by image id`,
293297
Required: false,
294298
Deprecated: false,
295299
Positional: false,
296-
EnumValues: []string{"created_at_asc", "created_at_desc"},
297300
},
298301
{
299-
Name: "image-label",
302+
Name: "version-id",
303+
Short: `Filter by version id`,
300304
Required: false,
301305
Deprecated: false,
302306
Positional: false,
303307
},
304308
{
305-
Name: "zone",
309+
Name: "image-label",
310+
Short: `Filter by image label`,
306311
Required: false,
307312
Deprecated: false,
308313
Positional: false,
309314
},
310315
{
311316
Name: "type",
317+
Short: `Filter by type`,
312318
Required: false,
313319
Deprecated: false,
314320
Positional: false,
@@ -338,6 +344,9 @@ func marketplaceLocalImageList() *core.Command {
338344
{
339345
FieldName: "Arch",
340346
},
347+
{
348+
FieldName: "Type",
349+
},
341350
{
342351
FieldName: "Zone",
343352
},

0 commit comments

Comments
 (0)