Skip to content

Commit 95555ea

Browse files
committed
Update enablement.md
Signed-off-by: Yasumasa Suenaga <[email protected]>
1 parent d7a95d8 commit 95555ea

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

casdk-docs/docs/overview/enablement.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ parameters and short explanations.
155155
To get a list of all locations supported, you can use the Locations API,
156156
referenced in `src/CarbonAware.CLI/src/Commands/Location`
157157
and the command `.\caw locations`.
158+
Note that you have to configure `LocationDataSourcesConfiguration`
159+
into `appsettings.json` before running the command.
158160

159161
Expected output:
160162

@@ -452,6 +454,9 @@ endpoints, full endpoint description can be found [here](https://github.com/Gree
452454
To get a list of all locations supported, you can use the Locations API endpoint
453455
`/locations` referenced in
454456
`src/CarbonAware.WebApi/src/Controllers/LocationsController.cs`.
457+
Note that you have to configure `LocationDataSourcesConfiguration`
458+
into `appsettings.json` before launching WebAPI, otherwise WebAPI returns
459+
HTTP 204 (No Content).
455460

456461
Expected Output:
457462

@@ -474,12 +479,16 @@ Expected Output:
474479
##### Calling the `/emissions/bylocation` endpoint
475480

476481
In console, we can run the below command, to request data for a single location
477-
(currently Azure region names supported) in a particular timeframe:
482+
in a particular timeframe:
478483

479484
```bash
480485
curl "http://localhost:5073/emissions/bylocation?location=westus&time=2022-08-23T14%3A00&toTime=2022-08-23T14%3A30" | jq
481486
```
482487

488+
Note that region names in this example (e.g. `westus`) are defined in
489+
[azure-regions.json](https://github.com/Green-Software-Foundation/carbon-aware-sdk/blob/dev/src/data/location-sources/azure-regions.json).
490+
AWS region is also available in [aws-regions.json](https://github.com/Green-Software-Foundation/carbon-aware-sdk/blob/dev/src/data/data-files/aws-regions.json).
491+
483492
You can omit the `| jq` to get the JSON data raw and unparsed. This is a request
484493
for data in the `westus` region from the date `2022-08-23 at 14:00` to
485494
`2022-08-23 at 14:30`. (Note: semicolons `:` are encoded as `%3A` in URLs).

0 commit comments

Comments
 (0)