From 620fe1d2e21c7b5676f4ba43ab3f78cb4235fb1d Mon Sep 17 00:00:00 2001 From: Scaleway Bot Date: Fri, 5 Jul 2024 17:17:24 +0200 Subject: [PATCH] feat(marketplace/v2): display type field in local-image list cli command (#3961) Co-authored-by: Jules Casteran --- ...test-all-usage-dedibox-os-get-usage.golden | 8 +++---- ...-marketplace-local-image-list-usage.golden | 12 +++++------ .../test-all-usage-vpc-route-usage.golden | 15 +++++++++++++ docs/commands/dedibox.md | 2 +- docs/commands/marketplace.md | 12 +++++------ .../marketplace/v2/marketplace_cli.go | 21 +++++++++++++------ 6 files changed, 47 insertions(+), 23 deletions(-) create mode 100644 cmd/scw/testdata/test-all-usage-vpc-route-usage.golden diff --git a/cmd/scw/testdata/test-all-usage-dedibox-os-get-usage.golden b/cmd/scw/testdata/test-all-usage-dedibox-os-get-usage.golden index 4890d3729d..21f1f393ba 100644 --- a/cmd/scw/testdata/test-all-usage-dedibox-os-get-usage.golden +++ b/cmd/scw/testdata/test-all-usage-dedibox-os-get-usage.golden @@ -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=] 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 diff --git a/cmd/scw/testdata/test-all-usage-marketplace-local-image-list-usage.golden b/cmd/scw/testdata/test-all-usage-marketplace-local-image-list-usage.golden index 3e1b13566b..5c57078f8b 100644 --- a/cmd/scw/testdata/test-all-usage-marketplace-local-image-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-marketplace-local-image-list-usage.golden @@ -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 diff --git a/cmd/scw/testdata/test-all-usage-vpc-route-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-route-usage.golden new file mode 100644 index 0000000000..073c5497ef --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-route-usage.golden @@ -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 diff --git a/docs/commands/dedibox.md b/docs/commands/dedibox.md index 2f83fdbf2c..5775f188fb 100644 --- a/docs/commands/dedibox.md +++ b/docs/commands/dedibox.md @@ -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: `` | Project ID | +| project-id | | Project ID | | zone | Default: `fr-par-1`
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 | diff --git a/docs/commands/marketplace.md b/docs/commands/marketplace.md index 3400e94a23..42d5f4bf1d 100644 --- a/docs/commands/marketplace.md +++ b/docs/commands/marketplace.md @@ -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 | diff --git a/internal/namespaces/marketplace/v2/marketplace_cli.go b/internal/namespaces/marketplace/v2/marketplace_cli.go index 997370f65e..53b24f1e44 100644 --- a/internal/namespaces/marketplace/v2/marketplace_cli.go +++ b/internal/namespaces/marketplace/v2/marketplace_cli.go @@ -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, @@ -338,6 +344,9 @@ func marketplaceLocalImageList() *core.Command { { FieldName: "Arch", }, + { + FieldName: "Type", + }, { FieldName: "Zone", },