Boavizta / boaviztapi

🛠 Giving access to BOAVIZTA reference data and methodologies trough a RESTful API
GNU Affero General Public License v3.0
66 stars 23 forks source link

Mapping cloud region to usage_location code #144

Open da-ekchajzer opened 1 year ago

da-ekchajzer commented 1 year ago

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