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
Issue 389 publish sensor data api documentation #390
Merged
Merged
Changes from all commits
Commits
Show all changes
99 commits
Select commit
Hold shift + click to select a range
f6f1b91
Move sensor data API from dev to v2 and use flask-classful
Flix6x f92d182
Publish dev API
Flix6x 84f4169
Add quickrefs
Flix6x 9eb7299
Add type annotations
Flix6x ea7a77d
Refactor use of auth_required in SensorAPI
Flix6x 9d2f329
Add type annotations
Flix6x 25ba2de
Add more quickrefs
Flix6x 0126169
Indentation
Flix6x 7ce3f14
valid JSON, rather than a python dict
Flix6x cb205ba
Move import to its preferred position
Flix6x 841f1d3
Rename and add type annotation
Flix6x f126561
Allow AssetIdField and SensorIdField to be used for API requests, too…
Flix6x 2e3bf11
Update tutorial for posting data
Flix6x e6db62f
Implement [GET] sensorData
Flix6x de46436
Add example GET request
Flix6x 2ab771b
Update docstring for unit conversion
Flix6x 1a7414e
Respect the passed horizon and prior fields
Flix6x 70e3793
Convert NaN to null (otherwise invalid JSON)
Flix6x 2ef234f
Pass event resolution to enable additional unit conversions
Flix6x bc5ffbe
Smarter unit conversion for BeliefsSeries
Flix6x 3e85a5e
Revert to auth_token_required instead of login_required
Flix6x 5738a29
Deserialize to BeliefsDataFrame using post_load decorator, and run th…
Flix6x 9cd8f9b
Move serialization logic to schema
Flix6x c76766e
Fix tutorial for posting data
Flix6x 271c435
Introduce util function to check for a valid price unit
Flix6x 56a5f25
Comment out tutorial sections on posting data for multiple connection…
Flix6x 8a14c64
Update tutorial for posting data: change connection to sensor and sto…
Flix6x e878f5c
Add validation based on POST message type
Flix6x dfa64b8
Publish documentation for SensorDataAPI
Flix6x 7de8b6f
Add validation based on GET message type
Flix6x c0f0bee
mypy
Flix6x 29d3381
Update getting-started.rst
Flix6x 852bee8
Undoc old endpoints
Flix6x eef5d42
Rename with_appcontext_if_needed
Flix6x 83b774e
refactor auth logic - separate checking access from the permission_re…
nhoening 52b3ba9
add modern auth for sensor data get & post, remove checking account r…
nhoening 9c0695e
more freedom to create inside accounts: allow all account members to …
nhoening bc9a100
use a user from the same account as the sensor for sensor data tests
nhoening 2f31a17
adapt asset tests w.r.t. to a change in dev api conftest
nhoening 352ae60
Remove unneeded import
Flix6x 210ecbc
GET endpoints work for logged-in users when tried in the browser with…
Flix6x b76ebdb
Add docstring
Flix6x 9b3f281
Make type a required field
Flix6x 7b67a1f
Move @route to top
Flix6x 2037394
SensorDataDescriptionSchema doesn't need the `type` field
Flix6x b17a9b8
Revert "Undoc old endpoints"
Flix6x 4e804ba
Move sensor data API documentation to v3
Flix6x 24ffc1a
Move sensor data API to v3
Flix6x 77ffdaf
Move user API to class for v3
Flix6x daa43c6
Move user UI to v3
Flix6x 3abb649
Update user API tests
Flix6x c4ea13b
Move user API tests to v3 module
Flix6x 41371c7
Separate view for user index
Flix6x d2a2e5f
Fix test
Flix6x 0c2d199
Update documentation tutorials to v3
Flix6x 482cde9
No trailing slash
Flix6x 820521e
Make `type` field in v3
Flix6x 0fc14b6
Add v3 to API index
Flix6x 70a9406
Update introduction
Flix6x 281af3b
Fix comment about where to request auth token
Flix6x d14d85e
flake8
Flix6x 89e8dff
black
Flix6x 2f2cee0
Revert some documentation changes that are ahead of code changes
Flix6x abfc41a
Use one common base route
Flix6x 3fec582
Prefer plural base route
Flix6x 80ed32d
different shade of black
Flix6x a26fad1
typos
Flix6x 6f34010
Transition SensorDataAPI:post to SensorAPI:post_data and SensorDataAP…
Flix6x 0f2a8f0
Rename module
Flix6x bf277b0
Update documentation for moving from SensorDataAPI:post to SensorAPI:…
Flix6x dcb46f3
Update introduction
Flix6x d392423
API changelog entry
Flix6x 64e1100
Implement /sensors [GET] to replace getConnection
Flix6x c06d768
Complete docstring
Flix6x 257b5b5
Add extra tips to API changelog on how to upgrade from v2 to v3
Flix6x b889992
Fix check for belief timing against message type
Flix6x 6037d60
No need to use implementations folder anymore
Flix6x 16130a1
Contain endpoint logic within SensorAPI class
Flix6x 1b6394f
Contain endpoint logic within UserAPI class
Flix6x c16a3bf
Fix mock email and type annotations
Flix6x d4e99db
Initialize schemas within SensorAPI and UserAPI class
Flix6x cdb7704
Typos
Flix6x 4c982bb
Fix 404 error message
Flix6x ea1e1b6
Remove unused variable declaration
Flix6x 38d3bc1
Clarify use of headers in test
Flix6x 9d98f71
Concerning patching user ids and user account ids, set dump_only for …
Flix6x ca3154f
Add test cases for unexpected fields
Flix6x 71add34
Also move patch endpoint logic into UserAPI class; this one was a bit…
Flix6x 1f07045
Move test utils from dev to v3_0
Flix6x d8b2790
Finish moving sensor data tests from dev to v3_0
Flix6x 0589009
Fix asset tests in dev API by moving back some conftest logic
Flix6x 3743032
Instantiate schemas outside of endpoint logic to minimize response time
Flix6x bf10bf3
Add mentions of http status to docstrings
Flix6x f159094
Undocument getService from the API introduction
Flix6x 8572b8f
Undocument USEF roles in introduction
Flix6x 1c013e9
Use "sensor" instead of "connection" in introduction
Flix6x dd7c59e
Undocument group notation in introduction
Flix6x c808fe3
Update API changelog for rewrite of introduction
Flix6x 0358dfa
Update API changelog entry date
Flix6x File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 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,22 @@ | ||
.. _dev: | ||
|
||
Developer API | ||
============= | ||
|
||
These endpoints are still under development and are subject to change in new releases. | ||
|
||
Summary | ||
------- | ||
|
||
.. qrefflask:: flexmeasures.app:create(env="documentation") | ||
:modules: flexmeasures.api.dev.assets, flexmeasures.api.dev.sensors | ||
:order: path | ||
:include-empty-docstring: | ||
|
||
API Details | ||
----------- | ||
|
||
.. autoflask:: flexmeasures.app:create(env="documentation") | ||
:modules: flexmeasures.api.dev.assets, flexmeasures.api.dev.sensors | ||
:order: path | ||
:include-empty-docstring: |
This file contains 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 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,20 @@ | ||
.. _v3_0: | ||
|
||
Version 3.0 | ||
=========== | ||
|
||
Summary | ||
------- | ||
|
||
.. qrefflask:: flexmeasures.app:create(env="documentation") | ||
:modules: flexmeasures.api.v3_0.implementations.sensors, flexmeasures.api.v3_0.implementations.users | ||
:order: path | ||
:include-empty-docstring: | ||
|
||
API Details | ||
----------- | ||
|
||
.. autoflask:: flexmeasures.app:create(env="documentation") | ||
:modules: flexmeasures.api.v3_0.implementations.sensors, flexmeasures.api.v3_0.implementations.users | ||
:order: path | ||
:include-empty-docstring: |
This file contains 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 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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gives the impression that this is something you have to know to use the API. But at this point, you don't have to know it. I suggest giving a bit more information about the context in which this info might be useful.
All in all, the whole "Notation" section in this API introduction could use a helicopter perspective on how to put the content into perspective, but that is maybe another PR.