Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 2.1 KB

File metadata and controls

59 lines (43 loc) · 2.1 KB

🌱Camunda Carbon Reductor - Carbon Aware API

Module to wrap the Carbon Aware API which could be used to collect the information to calculate the delay.

Table of Contents

🗒️Notes

We are planning to support multiple APIs to get the information needed to calculate the delay.

🚀Getting Started

Create a WattTime Account

The Account can be created with a POST request (watttime.org/api-documentation). With the visitor plan you are allowed to query information for the CAISO_NORTH (California) region.

curl -X POST --location "https://api.watttime.org/register" \
    -H "Content-Type: application/json" \
    -d "{\"username\": \"<myWattTimeUsername>\",
          \"password\": \"<myWattTimePassword>\",
          \"email\": \"<myEmailAddress>\"}"

Run Carbon Aware SDK Web API locally

Start the carbon aware SDK locally which acts as a proxy to the WattTime-API:

Run Docker image:

Note: Replace <myWattTimeUsername> and <myWattTimePassword> with your individual credentials in the following command.

docker run -it --rm -p 8090:80 \
    -e DataSources__EmissionsDataSource="WattTime" \
    -e DataSources__ForecastDataSource="WattTime" \
    -e DataSources__Configurations__WattTime__Type="WattTime" \
    -e DataSources__Configurations__WattTime__Username="<myWattTimeUsername>" \
    -e DataSources__Configurations__WattTime__Password="<myWattTimePassword>" \
  ghcr.io/green-software-foundation/carbon-aware-sdk

Test the API with curl -s "http://localhost:8090/emissions/forecasts/current?location=westus". This should return a lengthy JSON response.

Congratulations 🎉 - the API is now running locally.

Download openapi specification

Run the container locally and open

  http://localhost:8090/api/v1/swagger.yaml