Skip to content
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

Pacific Power exclusion endpoint #315

Merged
merged 4 commits into from
May 7, 2024

Conversation

s-egge
Copy link
Member

@s-egge s-egge commented Apr 5, 2024

Added an endpoint to retrieve all Pacific Power Meters in the pacific_power_exclusion table of the database.

See also:
#313
OSU-Sustainability-Office/automated-jobs#47

Testing

  • Run backend locally (sam local start-api from backend directory)
  • Visit http://http://localhost:3000/ppexclude
  • There are only two meters in the database for now, one to be excluded and one to be included
    image

TODO

  • Update PacificPower scraper in automated-jobs repo to retrieve exclusion list and use it to decide whether or not to upload data for each meter
    • If a meter is not on the exclusion list, that means it's a new meter, update scraper to add meter with exclude field of new
  • Add endpoint for adding a new meter to the database with new in exclude field
  • Cloudwatch alert for any new meters added
  • Add all existing Pacific Power meters to the table (I am holding off on this for now to make sure we want the current table/naming structure)

@s-egge s-egge linked an issue Apr 5, 2024 that may be closed by this pull request
@s-egge
Copy link
Member Author

s-egge commented Apr 30, 2024

Changes

See this PR in automated jobs to test the endpoint. The new endpoint adds new meters to the table with a status of new, the provided pacific_power_meter_id, and today's date for date_added.

I altered the database structure to have status instead of exclude as the field name, and it now has the following options for values:

  • exclude
  • include
  • new

@s-egge s-egge marked this pull request as ready for review April 30, 2024 20:43
@s-egge s-egge requested a review from solderq35 April 30, 2024 20:46
Copy link
Contributor

@solderq35 solderq35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, most of my feedback was on the automated-jobs side. Tested the upload functionality with an early breakpoint.

upload-test-breakpoint-518.txt

As you can see by the RESPONSE... logs at the bottom of attached log file above, 2 uploads were made to pacific_power_exclusion table, as expected (2 new meters).

@solderq35
Copy link
Contributor

solderq35 commented May 4, 2024

Follow-up task (future PR): OSU-Sustainability-Office/automated-jobs#51

.env.development Outdated Show resolved Hide resolved
@solderq35 solderq35 self-requested a review May 5, 2024 23:09
@s-egge s-egge merged commit faf5b5a into master May 7, 2024
3 checks passed
@s-egge s-egge deleted the pacific-power-meter-exclusion-endpoint branch July 1, 2024 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pacific Power Blacklist backend API endpoint
2 participants