Skip to content

feat: add support for scw account project list-resources#5640

Open
remyleone wants to merge 1 commit into
mainfrom
resources
Open

feat: add support for scw account project list-resources#5640
remyleone wants to merge 1 commit into
mainfrom
resources

Conversation

@remyleone

@remyleone remyleone commented Jun 4, 2026

Copy link
Copy Markdown
Member
  • scw account project list-resources -> helpful if you context is a given project and you would like to understand what is inside

@codecov-commenter

codecov-commenter commented Jun 4, 2026

Copy link
Copy Markdown

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
2483 2 2481 17
View the top 2 failed test(s) by shortest run time
github.com/scaleway/scaleway-cli/v2/cmd/scw::Test_AllUsage/account_project_list-resources_usage
Stack Traces | 0.01s run time
=== RUN   Test_AllUsage/account_project_list-resources_usage
=== PAUSE Test_AllUsage/account_project_list-resources_usage
=== CONT  Test_AllUsage/account_project_list-resources_usage
    main_test.go:37: 
        	Error Trace:	.../scaleway-cli/core/testing.go:780
        	            				.../scaleway-cli/core/testing.go:693
        	            				.../scaleway-cli/core/testing.go:523
        	Error:      	Not equal: 
        	            	expected: "🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲\n🟩🟩🟩 STDOUT️ 🟩🟩🟩️\nList all resources across all zones and products. Results are grouped by locality and product. Errors are aggregated and not fail-fast.\n\nUSAGE:\n  scw account project list-resources <project-id ...> [arg=value ...]\n\nARGS:\n  project-id=11111111-1111-1111-1111-111111111111   Filter by project ID. If none is passed the default project ID will be used\n  [zones]                                           Filter by zones (comma-separated, e.g. fr-par-1,nl-ams-1). If empty, all zones are queried\n  [products]                                        Filter by products (comma-separated: instances,instance-ips,instance-volumes,instance-snapshots,ipam,block-volumes,block-snapshots,buckets,rdb,redis,lb,k8s,containers,functions,flexibleip,secrets,vpc,file,webhosting,registry,searchdb). If empty, all products are queried\n\nFLAGS:\n  -h, --help                help for list-resources\n      --list-sub-commands   List all subcommands\n\nGLOBAL FLAGS:\n  -c, --config string    The path to the config file\n  -D, --debug            Enable debug mode\n  -o, --output string    Output format: json or human, see 'scw help output' for more info (default \"human\")\n  -p, --profile string   The config profile to use\n"
        	            	actual  : "🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲\n🟩🟩🟩 STDOUT️ 🟩🟩🟩️\nList all resources across all zones and products. Results are grouped by locality and product. Errors are aggregated and not fail-fast.\n\nUSAGE:\n  scw account project list-resources <project-id ...> [arg=value ...]\n\nARGS:\n  project-id=11111111-1111-1111-1111-111111111111   Filter by project ID. If none is passed the default project ID will be used\n  [zones]                                           Filter by zones (comma-separated, e.g. fr-par-1,nl-ams-1). If empty, all zones are queried\n  [products]                                        Filter by products (comma-separated: instances,instance-ips,instance-volumes,instance-snapshots,ipam,block-volumes,block-snapshots,buckets,rdb,redis,lb,k8s,containers,functions,flexibleip,secrets,vpc,file,webhosting,registry,searchdb,s2s-vpn-vpn-gateway). If empty, all products are queried\n\nFLAGS:\n  -h, --help                help for list-resources\n      --list-sub-commands   List all subcommands\n\nGLOBAL FLAGS:\n  -c, --config string    The path to the config file\n  -D, --debug            Enable debug mode\n  -o, --output string    Output format: json or human, see 'scw help output' for more info (default \"human\")\n  -p, --profile string   The config profile to use\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -10,3 +10,3 @@
        	            	   [zones]                                           Filter by zones (comma-separated, e.g. fr-par-1,nl-ams-1). If empty, all zones are queried
        	            	-  [products]                                        Filter by products (comma-separated: instances,instance-ips,instance-volumes,instance-snapshots,ipam,block-volumes,block-snapshots,buckets,rdb,redis,lb,k8s,containers,functions,flexibleip,secrets,vpc,file,webhosting,registry,searchdb). If empty, all products are queried
        	            	+  [products]                                        Filter by products (comma-separated: instances,instance-ips,instance-volumes,instance-snapshots,ipam,block-volumes,block-snapshots,buckets,rdb,redis,lb,k8s,containers,functions,flexibleip,secrets,vpc,file,webhosting,registry,searchdb,s2s-vpn-vpn-gateway). If empty, all products are queried
        	            	 
        	Test:       	Test_AllUsage/account_project_list-resources_usage
--- FAIL: Test_AllUsage/account_project_list-resources_usage (0.01s)
github.com/scaleway/scaleway-cli/v2/cmd/scw::Test_AllUsage
Stack Traces | 4.07s run time
=== RUN   Test_AllUsage
--- FAIL: Test_AllUsage (4.07s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@github-actions github-actions Bot added rdb Managed MySQL and PostgreSQL issues, bugs and feature requests load-balancer Load-balancer issues, bugs and feature requests instance Instance issues, bugs and feature requests k8s Kubernetes Kapsule issues, bugs and feature requests container Container issues, bugs and feature requests function Serverless function issues, bugs and feature requests redis Managed Redis issues, bugs and feature requests secret Managed Secret Manager issues, bugs and feature requests flexible-ip Flexible IP issues, bugs and feature requests registry Managed Container Registry issues, bugs and feature requests vpc Virtual Private Cloud (VPC) issues, bugs and feature requests apple-silicon Apple Silicon issues, bugs and feature requests webhosting Webhosting issues, bugs and feature requests baremetal vpcgw labels Jun 5, 2026
@remyleone remyleone changed the title feat: add support for scw resources list feat: add support for scw account project list-resources Jun 11, 2026
@github-actions github-actions Bot added the account Account issues, bugs and feature requests label Jun 11, 2026
@remyleone
remyleone marked this pull request as ready for review July 2, 2026 15:45
@remyleone
remyleone requested a review from a team as a code owner July 2, 2026 15:45
Copilot AI review requested due to automatic review settings July 2, 2026 15:45
@remyleone
remyleone requested review from a team as code owners July 2, 2026 15:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new CLI command, scw account project list-resources, intended to list a project’s resources across zones/regions by calling multiple product APIs and aggregating the results into a unified fetch.ResourceResult view.

Changes:

  • Added account project list-resources command implementation (zone/region de-duplication, concurrency limiting, sorting, and output view).
  • Introduced a new internal/fetch abstraction plus many per-product “custom fetcher” implementations to list resources per service.
  • Added documentation and usage golden test fixtures for the new command.

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
internal/namespaces/account/v3/custom.go Registers the new list-resources command under account project.
internal/namespaces/account/v3/custom_list_resources.go Implements the new command, including fetcher registry, concurrency, de-duplication, and sorting.
internal/namespaces/account/v3/custom_list_resources_test.go Adds unit tests for helper functions (query key building, resolvers, sorting).
internal/fetch/fetch.go Adds generic/non-generic fetcher abstractions, result type, and error-ignoring helper.
internal/namespaces/instance/v1/custom_fetcher.go Adds instance resource fetchers (servers, IPs, volumes, snapshots).
internal/namespaces/baremetal/v1/custom_fetcher.go Adds baremetal server fetcher.
internal/namespaces/applesilicon/v1alpha1/custom_fetcher.go Adds Apple Silicon server fetcher.
internal/namespaces/block/v1alpha1/custom_fetcher.go Adds block volumes and snapshots fetchers.
internal/namespaces/object/v1/custom_fetcher.go Adds S3-based bucket listing fetcher for Object Storage.
internal/namespaces/ipam/v1/custom_fetcher.go Adds IPAM IP listing fetcher.
internal/namespaces/vpc/v2/custom_fetcher.go Adds VPC listing fetcher.
internal/namespaces/vpcgw/v2/custom_fetcher.go Adds VPC Gateway and Gateway IPs fetchers.
internal/namespaces/lb/v1/custom_fetcher.go Adds load balancer listing fetcher.
internal/namespaces/k8s/v1/custom_fetcher.go Adds Kubernetes cluster listing fetcher.
internal/namespaces/redis/v1/custom_fetcher.go Adds Redis cluster listing fetcher.
internal/namespaces/rdb/v1/custom_fetcher.go Adds RDB instance listing fetcher.
internal/namespaces/mongodb/v1alpha1/custom_fetcher.go Adds MongoDB instance and snapshot listing fetchers.
internal/namespaces/registry/v1/custom_fetcher.go Adds registry namespace listing fetcher.
internal/namespaces/container/v1/custom_fetcher.go Adds container namespace listing fetcher.
internal/namespaces/function/v1beta1/custom_fetcher.go Adds function namespace listing fetcher.
internal/namespaces/secret/v1beta1/custom_fetcher.go Adds secret listing fetcher.
internal/namespaces/key_manager/v1alpha1/custom_fetcher.go Adds key manager key listing fetcher.
internal/namespaces/file/v1alpha1/custom_fetcher.go Adds file system listing fetcher.
internal/namespaces/webhosting/v1/custom_fetcher.go Adds webhosting hosting listing fetcher.
internal/namespaces/inference/v1/custom_fetcher.go Adds inference deployment listing fetcher.
internal/namespaces/cockpit/v1/custom_fetcher.go Adds cockpit token and datasource listing fetchers.
internal/namespaces/flexibleip/v1alpha1/custom_fetcher.go Adds flexible IP listing fetcher.
internal/namespaces/searchdb/v1alpha1/custom_fetcher.go Adds SearchDB deployment listing fetcher.
docs/commands/account.md Documents the new account project list-resources command.
cmd/scw/testdata/test-all-usage-account-project-usage.golden Updates account project usage listing to include list-resources.
cmd/scw/testdata/test-all-usage-account-project-list-resources-usage.golden Adds the usage golden file for account project list-resources.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/namespaces/account/v3/custom_list_resources.go
Comment thread internal/namespaces/account/v3/custom_list_resources.go
Comment thread internal/namespaces/account/v3/custom_list_resources.go
Comment thread internal/namespaces/account/v3/custom_list_resources.go Outdated
Comment thread internal/fetch/fetch.go
Comment thread internal/namespaces/baremetal/v1/custom_fetcher.go Outdated
Comment thread internal/namespaces/applesilicon/v1alpha1/custom_fetcher.go Outdated
Comment thread internal/namespaces/function/v1beta1/custom_fetcher.go Outdated
Comment thread docs/commands/account.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

account Account issues, bugs and feature requests apple-silicon Apple Silicon issues, bugs and feature requests baremetal container Container issues, bugs and feature requests flexible-ip Flexible IP issues, bugs and feature requests function Serverless function issues, bugs and feature requests instance Instance issues, bugs and feature requests k8s Kubernetes Kapsule issues, bugs and feature requests load-balancer Load-balancer issues, bugs and feature requests rdb Managed MySQL and PostgreSQL issues, bugs and feature requests redis Managed Redis issues, bugs and feature requests registry Managed Container Registry issues, bugs and feature requests secret Managed Secret Manager issues, bugs and feature requests vpc Virtual Private Cloud (VPC) issues, bugs and feature requests vpcgw webhosting Webhosting issues, bugs and feature requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants