pyro-api

Alert Management API for wildfire prevention, detection & monitoring

APACHE-2.0 License

Downloads
192
Stars
21
Committers
10
pyro-api - v0.1.2: Stabilized API for production services Latest Release

Published by frgfm over 2 years ago

This patch release stabilizes the package environment & the tables for production.

Note: the backend mainly requires FastAPI 0.78.0, while the client only requires requests.

Highlights

⚙️ Package management

For development purposes, it is normal to have loose version specifiers. However for production, each version update needs to be inspected carefully. For this reason, we transitioned from loose requirements.txt version specifiers to Poetry (#198).

Poetry is a package management tool that will "lock" our dependencies to a fixed environment by resolving all parent packages. This produces a poetry.lock file that has fixed versions, which can be inspected by the Dependabot for security alerts.

🎨 Client documentation

For clarity, the previous documentation of the API client was changed from Read the Docs to Furo (#193).

image

This also comes with new features: dark mode, edit button, etc.

🎼 Code quality

Significant improvements to the codebase have been made in this release (#189, #193):

  • quality tools: added isort, mypy and black
  • test tools: switched from unittests to pytest
  • contribution tools: added Makefile
  • other: added header verification, and PR label verification

✨ New tables & routes

Routes

  • devices: get_my_device, update_device_hash (#151)
  • events: fetch_past_events (#116)
  • sites: create_noalert_site (#130)

Tables

  • alerts: added azimuth (#129)
  • devices: added angle_of_view (#134) software_hash (#137)
  • events: added is_acknowledged (#170)
  • groups: created (#137)
  • installation: added is_trustworth (#127)
  • sites: added "no_alert" as possible value of type (#130)
  • webhooks: created (#152)

Breaking changes

Deprecated routes

The following routes were deprecated:

  • alerts: update_alert, link_media (#208)
  • media: update_media (#208)

Table modifications

The following tables were modified:

  • alerts: removed type (#142), is_acknowledged (#170), made device_id & media_id mandatory and non-nullable (#208)
  • accesses: made group_id mandatory (#153)
  • devices: modified value range of yaw (#185)
  • installation: removed lat, lon, elevation, yaw, pitch (#143)

What's Changed

Breaking Changes 🛠

New Features 🚀

Bug Fixes 🐛

Improvements

Full Changelog: https://github.com/pyronear/pyro-api/compare/v0.1.1...v0.1.2

pyro-api - End-to-end API & client support

Published by frgfm almost 4 years ago

This release extends considerably the support of the API by the client, and introduces media upload and download efficiently from cloud storage.

Note: pyroapi 0.1.1 mainly requires fastapi, uvicorn and sqlalchemy, while the client only requires requests.

Highlights

Routers

Core API server implementation
New

  • Alerts: added alert acknowledgement route (#82)
  • Devices: added a route to register the user's own device (#80)

Improvements

  • Alerts: added media existence check (#77), and updated scopes (#99)
  • Events: updates scopes of existing routes (#59, #99)
  • Installations: changed method type of device listing route (#72), and updated scopes (#99)
  • Media: added proper exceptions when upload fails (#96), updated media naming (#98, #100), updated scopes (#99), added integrity check of content transfer (#102)
  • Sites: updated scopes of existing routes (#58), updated scopes (#99)

Fixes

  • Events: fixed scope checks in creation and update routes (#85)
  • Installations: fixed active devices listing route (#69, #81)
  • Devices: added access deletion (#76), checked login consistency with access table (#83)
  • Media: fixed upload route (#95)
  • Users: added access deletion (#76), checked login consistency with access table (#83)

Database

SQL server running to get persistence over API data
New

  • Added field for acknowledgement state of alerts (#82)

Improvements

  • Made access login unique (#76)

Tests

Unittests for the core API
New

  • Added end-to-end script CI job (#89)

Improvements

  • Added full postgre-SQL DB testing (#68, #70)

Services

Third-party services enabled in the API
New

  • Added Qarnot storage integration (#87)

Documentation

The documentation of the API server
Improvements

  • Added route summary and descriptions (#78)

Client

The python client package for easier usage of the API
New

  • Added integration of event creation, alert & media creation from device, media upload (#77), alert acknowledgement (#93)
  • Added unittests for client methods (#74)

Improvements

  • Added typing to all methods (#74)

Fixes

  • Fixed route mapping of devices (#86)

Others

  • Separated production and dev requirements (#73)
  • Added sentry integration (#71)
  • Added funding option
pyro-api - Alert management API & client

Published by frgfm almost 4 years ago

This first release introduces basic operations on the background database, as well as a python API client for easier usage.

Note: pyroclient 0.1.0 mainly requires fastapi, uvicorn and sqlalchemy, while the client only requires requests.

Highlights

Routers

Core API server implementation
New

  • Accesses: added basic CRUD (#9, #33, #42, #37)
  • Alerts: added basic CRUD (#2, #13, #33), media linking (#20), client routes (#62)
  • Devices: added basic CRUD (#2, #13, #10, #23, #33, #37), authentication (#8, #9, #42), ping & location update (#9, #25, #40), and scopes (#44)
  • Events: added basic CRUD (#2, #13, #33)
  • Installations: added basic CRUD (#2, #13, #33), on-site device listing (#56)
  • Login: added token-based login (#8, #10, #9, #33, #37)
  • Media: added basic CRUD (#2, #13, #33), alert linking (#20, #62)
  • Sites: added basic CRUD (#2, #13, #33), extended fields (#54)
  • Users: added basic CRUD (#2, #13, #10, #33, #42), authentication (#8), password update (#15), and scopes (#44)

Database

SQL server running to get persistence over API data
New

  • Added all SQL tables (#2, #36, #42, #54, #52)
  • Initialized DB with a superuser (#27, #47, #51 #60)

Tests

Unittests for the core API
New

  • Added low-level mocking testing system (#2, #20, #33, #37, #40, #42, #54, #57, #62)

Services

Third-party services enabled in the API
New

  • Added storage service connection (#20, #62)

Documentation

The documentation of the API server
New

  • Added OpenAPI automatic documentation build (#2, #19, #38, #41, #52)
  • Updated README & CONTRIBUTING (#2, #3, #12, #22)

Client

The python client package for easier usage of the API
New

  • Created a Python client for device interactions (#43), and web-platform interactions (#62)
  • Added sphinx-built documentation (#48)

Others

New

  • Added Docker build (#2, #7, #27)
  • Added automatic deployment on Heroku (#4)