boaviztapi
boaviztapi copied to clipboard
Mapping cloud region to usage_location code
Problem
usage_location
can only be given in the NATO trigram (see: https://github.com/Boavizta/boaviztapi/blob/main/boaviztapi/data/electricity/electricity_impact_factors.csv). When the API is used to retrieve the impacts of cloud instances it could be easier for users to use cloud regions instead.
Solution
{
"provider": "aws",
"instance_type": "a1.small",
"usage":{
"region": "eu-west-3"
} }
Implementation
We should have a CSV with the following format :
provider | region | NATO code |
---|---|---|
aws | eu-west-3 | FRA |
And add a step in the completion process to complete usage_location
from the provider and the region given by the user. We should have a utility router to GET all available regions for each provider.
Some cloud regions can be found here: https://www.cloudcarbonfootprint.org/docs/methodology#appendix-v-grid-emissions-factors