Skip to content

Commit 6c9fe96

Browse files
feat(environmental_footprint): add cli information (#5413)
Co-authored-by: Estelle Soulard <esoulard@scaleway.com>
1 parent 199bd93 commit 6c9fe96

11 files changed

+519
-54
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Retrieve detailed impact data for your Scaleway projects within a specified date range. Filter by project ID, region, zone, service category, and/or product category.
4+
5+
USAGE:
6+
scw environmental-footprint data get [arg=value ...]
7+
8+
ARGS:
9+
start-date Start date (inclusive) of the period for which you want to retrieve impact data (ISO 8601 format, e.g. 2025-05-01T00:00:00Z).
10+
[end-date] End date (exclusive) of the period for which you want to retrieve impact data (ISO 8601 format, with time in UTC, `YYYY-MM-DDTHH:MM:SSZ`). Defaults to today's date.
11+
[regions.{index}] List of regions to filter by (e.g. `fr-par`). Defaults to all regions.
12+
[zones.{index}] List of zones to filter by (e.g. `fr-par-1`). Defaults to all zones.
13+
[project-ids.{index}] List of Project IDs to filter by. Defaults to all Projects in the Organization.
14+
[service-categories.{index}] List of service categories to filter by. Defaults to all service categories. (unknown_service_category | baremetal | compute | storage | network | containers | databases)
15+
[product-categories.{index}] List of product categories to filter by. Defaults to all product categories. (unknown_product_category | apple_silicon | block_storage | dedibox | elastic_metal | instances | object_storage | load_balancer | kubernetes | managed_relational_databases | managed_mongodb | managed_redis)
16+
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
17+
18+
FLAGS:
19+
-h, --help help for get
20+
--list-sub-commands List all subcommands
21+
22+
GLOBAL FLAGS:
23+
-c, --config string The path to the config file
24+
-D, --debug Enable debug mode
25+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
26+
-p, --profile string The config profile to use
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Environmental impact data management commands.
4+
5+
USAGE:
6+
scw environmental-footprint data <command>
7+
8+
AVAILABLE COMMANDS:
9+
get Retrieve detailed impact data
10+
11+
FLAGS:
12+
-h, --help help for data
13+
--list-sub-commands List all subcommands
14+
15+
GLOBAL FLAGS:
16+
-c, --config string The path to the config file
17+
-D, --debug Enable debug mode
18+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
19+
-p, --profile string The config profile to use
20+
21+
Use "scw environmental-footprint data [command] --help" for more information about a command.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Download a Scaleway impact PDF report with detailed impact data for your Scaleway projects.
4+
5+
USAGE:
6+
scw environmental-footprint report get [arg=value ...]
7+
8+
ARGS:
9+
date The start date of the period for which you want to download a report (ISO 8601 format, e.g. 2025-05-01T00:00:00Z).
10+
[type] Type of report to download (e.g. `monthly`). (unknown_report_type | monthly | yearly)
11+
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
12+
13+
FLAGS:
14+
-h, --help help for get
15+
--list-sub-commands List all subcommands
16+
17+
GLOBAL FLAGS:
18+
-c, --config string The path to the config file
19+
-D, --debug Enable debug mode
20+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
21+
-p, --profile string The config profile to use
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Returns a list of dates of available impact reports.
4+
5+
USAGE:
6+
scw environmental-footprint report list [arg=value ...]
7+
8+
ARGS:
9+
start-date Start date of the search period (ISO 8601 format, with time in UTC, `YYYY-MM-DDTHH:MM:SSZ`). The date is inclusive.
10+
[end-date] End date of the search period (ISO 8601 format, with time in UTC, `YYYY-MM-DDTHH:MM:SSZ`). The date is inclusive. Defaults to today's date.
11+
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
12+
13+
FLAGS:
14+
-h, --help help for list
15+
--list-sub-commands List all subcommands
16+
17+
GLOBAL FLAGS:
18+
-c, --config string The path to the config file
19+
-D, --debug Enable debug mode
20+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
21+
-p, --profile string The config profile to use
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Environmental impact report management commands.
4+
5+
USAGE:
6+
scw environmental-footprint report <command>
7+
8+
AVAILABLE COMMANDS:
9+
get Download PDF impact report
10+
list Get available impact reports
11+
12+
FLAGS:
13+
-h, --help help for report
14+
--list-sub-commands List all subcommands
15+
16+
GLOBAL FLAGS:
17+
-c, --config string The path to the config file
18+
-D, --debug Enable debug mode
19+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
20+
-p, --profile string The config profile to use
21+
22+
Use "scw environmental-footprint report [command] --help" for more information about a command.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Access and download impact reports and impact data for your Scaleway projects. Our API provides key metrics such as estimated carbon emissions and water usage to help monitor your environmental footprint.
4+
5+
USAGE:
6+
scw environmental-footprint <command>
7+
8+
AVAILABLE COMMANDS:
9+
data Environmental impact data management commands
10+
report Environmental impact report management commands
11+
12+
FLAGS:
13+
-h, --help help for environmental-footprint
14+
--list-sub-commands List all subcommands
15+
16+
GLOBAL FLAGS:
17+
-c, --config string The path to the config file
18+
-D, --debug Enable debug mode
19+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
20+
-p, --profile string The config profile to use
21+
22+
Use "scw environmental-footprint [command] --help" for more information about a command.

cmd/scw/testdata/test-main-usage-usage.golden

Lines changed: 55 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4,90 +4,91 @@ USAGE:
44
scw <command>
55

66
AI COMMANDS:
7-
inference This API allows you to handle your Managed Inference services
7+
inference This API allows you to handle your Managed Inference services
88

99
AVAILABLE COMMANDS:
10-
datalab Data Lab API for Apache Spark™
11-
domain Domains and DNS - Registrar API
10+
datalab Data Lab API for Apache Spark™
11+
domain Domains and DNS - Registrar API
12+
environmental-footprint Access and download impact reports and impact data for your Scaleway projects. Our API provides key metrics such as estimated carbon emissions and water usage to help monitor your environmental footprint.
1213

1314
BAREMETAL COMMANDS:
14-
apple-silicon Apple silicon API
15-
baremetal Elastic Metal API
16-
fip This API allows you to manage your Elastic Metal servers' flexible public IP addresses
15+
apple-silicon Apple silicon API
16+
baremetal Elastic Metal API
17+
fip This API allows you to manage your Elastic Metal servers' flexible public IP addresses
1718

1819
COMPUTE COMMANDS:
19-
instance This API allows you to manage your CPU and GPU Instances
20-
marketplace This API allows you to find available images for use when launching a Scaleway Instance
20+
instance This API allows you to manage your CPU and GPU Instances
21+
marketplace This API allows you to find available images for use when launching a Scaleway Instance
2122

2223
CONFIGURATION COMMANDS:
23-
alias Alias related commands
24-
config Config file management
25-
info Get info about current settings
26-
init Initialize the config
27-
login Login to scaleway
24+
alias Alias related commands
25+
config Config file management
26+
info Get info about current settings
27+
init Initialize the config
28+
login Login to scaleway
2829

2930
CONTAINER COMMANDS:
30-
k8s This API allows you to manage Kubernetes Kapsule and Kosmos clusters
31-
registry This API allows you to manage your Container Registry resources
31+
k8s This API allows you to manage Kubernetes Kapsule and Kosmos clusters
32+
registry This API allows you to manage your Container Registry resources
3233

3334
COST COMMANDS:
34-
billing This API allows you to manage and query your Scaleway billing and consumption
35+
billing This API allows you to manage and query your Scaleway billing and consumption
3536

3637
DATABASE COMMANDS:
37-
datawarehouse This API allows you to manage your Data Warehouse
38-
mongodb This API allows you to manage your Managed Databases for MongoDB®
39-
rdb This API allows you to manage your Managed Databases for PostgreSQL and MySQL
40-
redis This API allows you to manage your Managed Databases for Redis™
41-
sdb-sql This API allows you to manage your Serverless SQL Databases
42-
searchdb Cloud Essentials for Opensearch API
38+
datawarehouse This API allows you to manage your Data Warehouse
39+
mongodb This API allows you to manage your Managed Databases for MongoDB®
40+
rdb This API allows you to manage your Managed Databases for PostgreSQL and MySQL
41+
redis This API allows you to manage your Managed Databases for Redis™
42+
sdb-sql This API allows you to manage your Serverless SQL Databases
43+
searchdb Cloud Essentials for Opensearch API
4344

4445
DOMAIN & WEBHOSTING COMMANDS:
45-
dns This API allows you to manage your domains, DNS zones and records
46-
tem This API allows you to manage your Transactional Email services
47-
webhosting This API allows you to list and restore backups for your cPanel and WordPress Web Hosting service.
46+
dns This API allows you to manage your domains, DNS zones and records
47+
tem This API allows you to manage your Transactional Email services
48+
webhosting This API allows you to list and restore backups for your cPanel and WordPress Web Hosting service.
4849

4950
INTEGRATION COMMANDS:
50-
iot This API allows you to manage your IoT hubs and devices
51-
mnq These APIs allow you to manage your Messaging and Queuing NATS, Queues and Topics and Events services
51+
iot This API allows you to manage your IoT hubs and devices
52+
mnq These APIs allow you to manage your Messaging and Queuing NATS, Queues and Topics and Events services
5253

5354
MONITORING COMMANDS:
54-
audit-trail This API allows you to ensure accountability and security by recording events and changes performed within your Scaleway Organization.
55-
cockpit This API allows you to manage your Scaleway Cockpit, for storing and visualizing metrics and logs
55+
audit-trail This API allows you to ensure accountability and security by recording events and changes performed within your Scaleway Organization.
56+
cockpit This API allows you to manage your Scaleway Cockpit, for storing and visualizing metrics and logs
5657

5758
NETWORK COMMANDS:
58-
edge-services Edge Services API
59-
interlink This API allows you to manage your InterLink services
60-
ipam This API allows you to manage your Scaleway IP addresses with our IP Address Management tool
61-
lb This API allows you to manage your Scaleway Load Balancer services
62-
s2s-vpn This API allows you to manage your Site-to-Site VPN
63-
vpc This API allows you to manage your Virtual Private Clouds (VPCs) and Private Networks
64-
vpc-gw This API allows you to manage your Public Gateways
59+
edge-services Edge Services API
60+
interlink This API allows you to manage your InterLink services
61+
ipam This API allows you to manage your Scaleway IP addresses with our IP Address Management tool
62+
lb This API allows you to manage your Scaleway Load Balancer services
63+
s2s-vpn This API allows you to manage your Site-to-Site VPN
64+
vpc This API allows you to manage your Virtual Private Clouds (VPCs) and Private Networks
65+
vpc-gw This API allows you to manage your Public Gateways
6566

6667
SECURITY COMMANDS:
67-
account This API allows you to manage your Scaleway Projects
68-
audit-trail This API allows you to ensure accountability and security by recording events and changes performed within your Scaleway Organization.
69-
iam This API allows you to manage Identity and Access Management (IAM) across your Scaleway Organizations, Projects and resources
70-
keymanager Key Manager API
71-
partner Scaleway Partner API ( for partner only )
72-
secret Secret Manager API
68+
account This API allows you to manage your Scaleway Projects
69+
audit-trail This API allows you to ensure accountability and security by recording events and changes performed within your Scaleway Organization.
70+
iam This API allows you to manage Identity and Access Management (IAM) across your Scaleway Organizations, Projects and resources
71+
keymanager Key Manager API
72+
partner Scaleway Partner API ( for partner only )
73+
secret Secret Manager API
7374

7475
SERVERLESS COMMANDS:
75-
container This API allows you to manage your Serverless Containers
76-
function Function as a Service API
77-
jobs This API allows you to manage your Serverless Jobs
76+
container This API allows you to manage your Serverless Containers
77+
function Function as a Service API
78+
jobs This API allows you to manage your Serverless Jobs
7879

7980
STORAGE COMMANDS:
80-
block This API allows you to manage your Block Storage volumes
81-
file This API allows you to manage your File Storage resources
82-
object Object-storage utils
83-
registry This API allows you to manage your Container Registry resources
81+
block This API allows you to manage your Block Storage volumes
82+
file This API allows you to manage your File Storage resources
83+
object Object-storage utils
84+
registry This API allows you to manage your Container Registry resources
8485

8586
UTILITY COMMANDS:
86-
autocomplete Autocomplete related commands
87-
feedback Send feedback to the Scaleway CLI Team!
88-
help Get help about how specific topics inside the CLI work
89-
shell Start shell mode
90-
version Display cli version
87+
autocomplete Autocomplete related commands
88+
feedback Send feedback to the Scaleway CLI Team!
89+
help Get help about how specific topics inside the CLI work
90+
shell Start shell mode
91+
version Display cli version
9192

9293
FLAGS:
9394
-c, --config string The path to the config file

commands/commands.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/dedibox/v1"
2121
domain "github.com/scaleway/scaleway-cli/v2/internal/namespaces/domain/v2beta1"
2222
edgeservices "github.com/scaleway/scaleway-cli/v2/internal/namespaces/edge_services/v1beta1"
23+
environmental_footprint "github.com/scaleway/scaleway-cli/v2/internal/namespaces/environmental_footprint/v1alpha1"
2324
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/feedback"
2425
file "github.com/scaleway/scaleway-cli/v2/internal/namespaces/file/v1alpha1"
2526
flexibleip "github.com/scaleway/scaleway-cli/v2/internal/namespaces/flexibleip/v1alpha1"
@@ -120,6 +121,7 @@ func GetCommands() *core.Commands {
120121
datalab.GetCommands(),
121122
datawarehouse.GetCommands(),
122123
partner.GetCommands(),
124+
environmental_footprint.GetCommands(),
123125
)
124126

125127
if beta {

0 commit comments

Comments
 (0)