Skip to content

Commit

Permalink
feat(marketplace/v2): display type field in local-image list cli comm…
Browse files Browse the repository at this point in the history
…and (#3961)

Co-authored-by: Jules Casteran <[email protected]>
  • Loading branch information
scaleway-bot and Codelax authored Jul 5, 2024
1 parent e3cc3ba commit 620fe1d
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 23 deletions.
8 changes: 4 additions & 4 deletions cmd/scw/testdata/test-all-usage-dedibox-os-get-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ USAGE:
scw dedibox os get [arg=value ...]

ARGS:
os-id ID of the OS
[server-id] ID of the server
[project-id=<retrieved from config>] Project ID
[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)
os-id ID of the OS
[server-id] ID of the server
[project-id] Project ID
[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)

FLAGS:
-h, --help help for get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ USAGE:
scw marketplace local-image list [arg=value ...]

ARGS:
[image-id]
[version-id]
[order-by] (created_at_asc | created_at_desc)
[image-label]
[zone]
[type] (unknown_type | instance_local | instance_sbs)
[order-by] Ordering to use (type_asc | type_desc | created_at_asc | created_at_desc)
[zone] Filter local images available on this Availability Zone
[image-id] Filter by image id
[version-id] Filter by version id
[image-label] Filter by image label
[type] Filter by type (unknown_type | instance_local | instance_sbs)

FLAGS:
-h, --help help for list
Expand Down
15 changes: 15 additions & 0 deletions cmd/scw/testdata/test-all-usage-vpc-route-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Custom routes.

USAGE:
scw vpc route

FLAGS:
-h, --help help for route

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
2 changes: 1 addition & 1 deletion docs/commands/dedibox.md
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ scw dedibox os get [arg=value ...]
|------|---|-------------|
| os-id | Required | ID of the OS |
| server-id | | ID of the server |
| project-id | Default: `<retrieved from config>` | Project ID |
| project-id | | Project ID |
| 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 |


Expand Down
12 changes: 6 additions & 6 deletions docs/commands/marketplace.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ scw marketplace local-image list [arg=value ...]

| Name | | Description |
|------|---|-------------|
| image-id | | |
| version-id | | |
| order-by | One of: `created_at_asc`, `created_at_desc` | |
| image-label | | |
| zone | | |
| type | One of: `unknown_type`, `instance_local`, `instance_sbs` | |
| order-by | One of: `type_asc`, `type_desc`, `created_at_asc`, `created_at_desc` | Ordering to use |
| zone | | Filter local images available on this Availability Zone |
| image-id | | Filter by image id |
| version-id | | Filter by version id |
| image-label | | Filter by image label |
| type | One of: `unknown_type`, `instance_local`, `instance_sbs` | Filter by type |



Expand Down
21 changes: 15 additions & 6 deletions internal/namespaces/marketplace/v2/marketplace_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,38 +277,44 @@ func marketplaceLocalImageList() *core.Command {
ArgsType: reflect.TypeOf(marketplace.ListLocalImagesRequest{}),
ArgSpecs: core.ArgSpecs{
{
Name: "image-id",
Name: "order-by",
Short: `Ordering to use`,
Required: false,
Deprecated: false,
Positional: false,
EnumValues: []string{"type_asc", "type_desc", "created_at_asc", "created_at_desc"},
},
{
Name: "version-id",
Name: "zone",
Short: `Filter local images available on this Availability Zone`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "order-by",
Name: "image-id",
Short: `Filter by image id`,
Required: false,
Deprecated: false,
Positional: false,
EnumValues: []string{"created_at_asc", "created_at_desc"},
},
{
Name: "image-label",
Name: "version-id",
Short: `Filter by version id`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "zone",
Name: "image-label",
Short: `Filter by image label`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "type",
Short: `Filter by type`,
Required: false,
Deprecated: false,
Positional: false,
Expand Down Expand Up @@ -338,6 +344,9 @@ func marketplaceLocalImageList() *core.Command {
{
FieldName: "Arch",
},
{
FieldName: "Type",
},
{
FieldName: "Zone",
},
Expand Down

0 comments on commit 620fe1d

Please sign in to comment.