-
Notifications
You must be signed in to change notification settings - Fork 106
Watt Time v3 Support #532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Watt Time v3 Support #532
Changes from 26 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
b9490e4
First draft of the ADR for watt time v3 changes
vaughanknight b991bac
Moved ADR to correct location
vaughanknight f4bbf52
Further updates for the watt time v2 to v3 upgrade
vaughanknight d6ad67c
Further updates for the watt time v2 to v3 upgrade
vaughanknight 15a6f9c
Merge branch 'wattime-v3-support' of https://github.com/Green-Softwar…
vaughanknight cb46877
Update 0016-watt-time-v3.md
vaughanknight e324f36
First draft of the ADR for watt time v3 changes
vaughanknight be6663c
Moved ADR to correct location
vaughanknight 17210ed
Further updates for the watt time v2 to v3 upgrade
vaughanknight 7920786
Update 0016-watt-time-v3.md
vaughanknight e4f1494
Create 0016-watt-time-v3.md
vaughanknight b443e9e
Added base url to the configuration with validation
vaughanknight ab1205d
Updated start and end configuration
vaughanknight 7c115fa
Balancing Authority Parameter Renamed to Region
vaughanknight e047c9a
Updates for historical data API
vaughanknight aa81382
Removed accidental file
vaughanknight 8640c8c
Lots of test updates
vaughanknight 880fcf7
Historical forecasts updated
vaughanknight 92f8dbc
DCO Remediation Commit for Vaughan Knight <[email protected]>
vaughanknight 39e45a6
Many tests reworked, a few to go
vaughanknight fbfcac1
Further test updates
vaughanknight 0080ae8
Merge branch 'wattime-v3-support' of https://github.com/Green-Softwar…
vaughanknight f3fd570
Merge branch 'wattime-v3-support' of https://github.com/Green-Softwar…
vaughanknight 9aabd27
Further updates, just 1 test left to remediate
vaughanknight 8127a92
Updated to add authentication client to the service builder for the t…
vaughanknight 4ff0151
Renaming of Balancing Authority to Region
vaughanknight d93320f
Fixed spelling error in latitude
vaughanknight 91799f7
Fixed a bug where location sources were loading twice
vaughanknight 4665813
Fixed typo for method name
vaughanknight b228cf7
DCO Remediation Commit for Vaughan Knight <[email protected]>
vaughanknight 8137659
Updates based on code review for WattTime Tests
vaughanknight f64ec8e
Cleaned up a lot of the string literals
vaughanknight daa4503
More cleanup of some of the strings
vaughanknight 903a58f
Updates to documentation and changelog
vaughanknight File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
casdk-docs/docs/architecture/decisions/0016-watt-time-v3.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
|
||
# 0015. WattTime v3 Changes | ||
|
||
## Status | ||
|
||
Proposed | ||
|
||
## Context | ||
As part of the update to Watt Time v3 we are proposing the changes to the underlying API calls. This needs to be tracked so we understand the impacts, and if multiple options are available, which option was selected and why. | ||
|
||
This wll impact the `CarbonAware.DataSources.WattTime` project primarily. | ||
|
||
## Decision | ||
|
||
The proposal is for the outlined WattTime API mapping and changes. | ||
|
||
## WattTime v2, v3 Mapping | ||
|
||
The following document and guidelines was used to understand the impact to the Carbon Aware SDK for the WattTime v3 updates. https://docs.watttime.org/#tag/Transitioning-from-APIv2-to-APIv3 | ||
|
||
### Base URL | ||
The base URL will need to change. | ||
> TODO: Add where this is configured | ||
|
||
|Base URL (v2) | Based URL (v3) | | ||
|---|---| | ||
| /v2 | /v3 | | ||
|
||
|
||
### Paths | ||
The paths will also need to change. | ||
|
||
The following is configured at `CarbonAware.DataSources.WattTime/src/Constants/Paths.cs` | ||
|
||
| API Endpoint | Description | Path (v2) | Path (v3) | Notes | | ||
|--------------|-------------|-----------|-----------|---| | ||
| Data | Get data | /data | /historical | _Request_ <li> `starttime` is now `start` and mandatory <li> `endtime` is now `end` and mandatory <li> `ba` is now `region` <li> `signal_type` added <br> _Response_ <li> `signal_type` added | ||
| Forecast | Get forecast| /forecast | /forecast | **TODO: CHECK IMPACT** <br> No longer be used for historical data <br> _Request_ <li> `ba` is now `region` <li> `extended_forecast` removed <li> `horizon_hours` added <li> `signal_type` added <li> Historical forecasts are now at `/forecast/historical` <br> _Response_ <li> `signal_type` added | ||
| Historical | Get historical forecast data | /historical (?) | /forecast/historical (?) | **We need to validate why historical was being used for the API, and what historical used to be, and whether this should be the new /forecast/historical or not.** | ||
| Balancing Authority From Location | Get balancing authority from location | /ba-from-loc | /region-from-loc | Check if the CA SDK uses BA at all <br><br> _Request_ <li> `name` is now `region_full_name` <li> `abbrev` is now `region` <li> `signal_type` added <br> _Response_ <li> `id` removed <li> `signal_type` added | | ||
| Login | User login | https://api2.watttime.org/v2/login | https://api.watttime.org/login | Path has changed from being version specific to being no longer related to the API version. <br><br> NOTE: Updated in wattTime client to now have 2 HTTP clients to decouple versions from the login. | ||
|
||
### Query Strings | ||
|
||
#### Signal Type | ||
Everything call takes an optional `signal_type` parameter that defaults to `co2_moer`. | ||
|
||
The following comes from `CarbonAware.DataSources.WattTime/src/Constants/QueryStrings.cs` and the changes are consistent with the discussion above. | ||
|
||
| Query String (v2) | Query String if Changed (v3) | Description | | ||
|------------------------------------|----------------------------------|------------------------------| | ||
| `ba` | `region` | Balancing Authority / Region | | ||
| `starttime` | `start` | Start Time | | ||
| `endtime` | `end` | End Time | | ||
| `latitude` | - | Latitude | | ||
| `longitude` | - | Longitude | | ||
| `username` | - | Username | | ||
|
||
## Green Impact | ||
|
||
Neutral | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.