Skip to content

Commit ff59081

Browse files
feat(environmental_footprint): add environmental_footprint to cmds, add doc
1 parent 8b4d658 commit ff59081

10 files changed

+287
-53
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: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,89 +4,90 @@ 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™
10+
datalab Data Lab API for Apache Spark™
11+
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.
1112

1213
BAREMETAL COMMANDS:
13-
apple-silicon Apple silicon API
14-
baremetal Elastic Metal API
15-
fip This API allows you to manage your Elastic Metal servers' flexible public IP addresses
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
1617

1718
COMPUTE COMMANDS:
18-
instance This API allows you to manage your CPU and GPU Instances
19-
marketplace This API allows you to find available images for use when launching a Scaleway Instance
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
2021

2122
CONFIGURATION COMMANDS:
22-
alias Alias related commands
23-
config Config file management
24-
info Get info about current settings
25-
init Initialize the config
26-
login Login to scaleway
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
2728

2829
CONTAINER COMMANDS:
29-
k8s This API allows you to manage Kubernetes Kapsule and Kosmos clusters
30-
registry This API allows you to manage your Container Registry resources
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
3132

3233
COST COMMANDS:
33-
billing This API allows you to manage and query your Scaleway billing and consumption
34+
billing This API allows you to manage and query your Scaleway billing and consumption
3435

3536
DATABASE COMMANDS:
36-
datawarehouse This API allows you to manage your Data Warehouse
37-
mongodb This API allows you to manage your Managed Databases for MongoDB®
38-
rdb This API allows you to manage your Managed Databases for PostgreSQL and MySQL
39-
redis This API allows you to manage your Managed Databases for Redis™
40-
sdb-sql This API allows you to manage your Serverless SQL Databases
41-
searchdb Cloud Essentials for Opensearch API
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
4243

4344
DOMAIN & WEBHOSTING COMMANDS:
44-
dns This API allows you to manage your domains, DNS zones and records
45-
tem This API allows you to manage your Transactional Email services
46-
webhosting This API allows you to list and restore backups for your cPanel and WordPress Web Hosting service.
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.
4748

4849
INTEGRATION COMMANDS:
49-
iot This API allows you to manage your IoT hubs and devices
50-
mnq These APIs allow you to manage your Messaging and Queuing NATS, Queues and Topics and Events services
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
5152

5253
MONITORING COMMANDS:
53-
audit-trail This API allows you to ensure accountability and security by recording events and changes performed within your Scaleway Organization.
54-
cockpit This API allows you to manage your Scaleway Cockpit, for storing and visualizing metrics and logs
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
5556

5657
NETWORK COMMANDS:
57-
edge-services Edge Services API
58-
interlink This API allows you to manage your InterLink services
59-
ipam This API allows you to manage your Scaleway IP addresses with our IP Address Management tool
60-
lb This API allows you to manage your Scaleway Load Balancer services
61-
s2s-vpn This API allows you to manage your Site-to-Site VPN
62-
vpc This API allows you to manage your Virtual Private Clouds (VPCs) and Private Networks
63-
vpc-gw This API allows you to manage your Public Gateways
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
6465

6566
SECURITY COMMANDS:
66-
account This API allows you to manage your Scaleway Projects
67-
audit-trail This API allows you to ensure accountability and security by recording events and changes performed within your Scaleway Organization.
68-
iam This API allows you to manage Identity and Access Management (IAM) across your Scaleway Organizations, Projects and resources
69-
keymanager Key Manager API
70-
partner Scaleway Partner API ( for partner only )
71-
secret Secret Manager API
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
7273

7374
SERVERLESS COMMANDS:
74-
container This API allows you to manage your Serverless Containers
75-
function Function as a Service API
76-
jobs This API allows you to manage your Serverless Jobs
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
7778

7879
STORAGE COMMANDS:
79-
block This API allows you to manage your Block Storage volumes
80-
file This API allows you to manage your File Storage resources
81-
object Object-storage utils
82-
registry This API allows you to manage your Container Registry resources
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
8384

8485
UTILITY COMMANDS:
85-
autocomplete Autocomplete related commands
86-
feedback Send feedback to the Scaleway CLI Team!
87-
help Get help about how specific topics inside the CLI work
88-
shell Start shell mode
89-
version Display cli version
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
9091

9192
FLAGS:
9293
-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 {
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<!-- DO NOT EDIT: this file is automatically generated using scw-doc-gen -->
2+
# Documentation for `scw environmental-footprint`
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+
- [Environmental impact data management commands](#environmental-impact-data-management-commands)
6+
- [Retrieve detailed impact data](#retrieve-detailed-impact-data)
7+
- [Environmental impact report management commands](#environmental-impact-report-management-commands)
8+
- [Download PDF impact report](#download-pdf-impact-report)
9+
- [Get available impact reports](#get-available-impact-reports)
10+
11+
12+
## Environmental impact data management commands
13+
14+
Environmental impact data management commands.
15+
16+
17+
### Retrieve detailed impact data
18+
19+
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.
20+
21+
**Usage:**
22+
23+
```
24+
scw environmental-footprint data get [arg=value ...]
25+
```
26+
27+
28+
**Args:**
29+
30+
| Name | | Description |
31+
|------|---|-------------|
32+
| start-date | Required | Start date (inclusive) of the period for which you want to retrieve impact data (ISO 8601 format, e.g. 2025-05-01T00:00:00Z). |
33+
| 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. |
34+
| regions.{index} | | List of regions to filter by (e.g. `fr-par`). Defaults to all regions. |
35+
| zones.{index} | | List of zones to filter by (e.g. `fr-par-1`). Defaults to all zones. |
36+
| project-ids.{index} | | List of Project IDs to filter by. Defaults to all Projects in the Organization. |
37+
| service-categories.{index} | One of: `unknown_service_category`, `baremetal`, `compute`, `storage`, `network`, `containers`, `databases` | List of service categories to filter by. Defaults to all service categories. |
38+
| product-categories.{index} | One of: `unknown_product_category`, `apple_silicon`, `block_storage`, `dedibox`, `elastic_metal`, `instances`, `object_storage`, `load_balancer`, `kubernetes`, `managed_relational_databases`, `managed_mongodb`, `managed_redis` | List of product categories to filter by. Defaults to all product categories. |
39+
| organization-id | | Organization ID to use. If none is passed the default organization ID will be used |
40+
41+
42+
43+
## Environmental impact report management commands
44+
45+
Environmental impact report management commands.
46+
47+
48+
### Download PDF impact report
49+
50+
Download a Scaleway impact PDF report with detailed impact data for your Scaleway projects.
51+
52+
**Usage:**
53+
54+
```
55+
scw environmental-footprint report get [arg=value ...]
56+
```
57+
58+
59+
**Args:**
60+
61+
| Name | | Description |
62+
|------|---|-------------|
63+
| date | Required | The start date of the period for which you want to download a report (ISO 8601 format, e.g. 2025-05-01T00:00:00Z). |
64+
| type | One of: `unknown_report_type`, `monthly`, `yearly` | Type of report to download (e.g. `monthly`). |
65+
| organization-id | | Organization ID to use. If none is passed the default organization ID will be used |
66+
67+
68+
69+
### Get available impact reports
70+
71+
Returns a list of dates of available impact reports.
72+
73+
**Usage:**
74+
75+
```
76+
scw environmental-footprint report list [arg=value ...]
77+
```
78+
79+
80+
**Args:**
81+
82+
| Name | | Description |
83+
|------|---|-------------|
84+
| start-date | Required | Start date of the search period (ISO 8601 format, with time in UTC, `YYYY-MM-DDTHH:MM:SSZ`). The date is inclusive. |
85+
| 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. |
86+
| organization-id | | Organization ID to use. If none is passed the default organization ID will be used |
87+
88+
89+

0 commit comments

Comments
 (0)