diff --git a/documentation/changelog.rst b/documentation/changelog.rst index 61b6568a6..5f67b3abe 100644 --- a/documentation/changelog.rst +++ b/documentation/changelog.rst @@ -3,6 +3,14 @@ FlexMeasures Changelog ********************** +v0.2.4 | March XX, 2021 +=========================== + +Bugfixes +-------- +* Documentation listed 2.0 API endpoints twice [see `PR #59 `_] + + v0.2.3 | February 27, 2021 =========================== diff --git a/flexmeasures/api/v1/routes.py b/flexmeasures/api/v1/routes.py index 6dbd5b65b..ea1448694 100644 --- a/flexmeasures/api/v1/routes.py +++ b/flexmeasures/api/v1/routes.py @@ -34,7 +34,7 @@ def get_meter_data(): """API endpoint to get meter data. - .. :quickref: User; Download meter data from the platform + .. :quickref: Data; Download meter data from the platform **Optional parameters** @@ -99,7 +99,7 @@ def get_meter_data(): def post_meter_data(): """API endpoint to post meter data. - .. :quickref: User; Upload meter data to the platform + .. :quickref: Data; Upload meter data to the platform **Optional parameters** diff --git a/flexmeasures/api/v1_1/routes.py b/flexmeasures/api/v1_1/routes.py index 33f43bcc5..08deb11a5 100644 --- a/flexmeasures/api/v1_1/routes.py +++ b/flexmeasures/api/v1_1/routes.py @@ -62,7 +62,7 @@ def get_connection(): """API endpoint to get the user's connections as entity addresses ordered from newest to oldest. - .. :quickref: User; Retrieve entity addresses of connections + .. :quickref: Asset; Retrieve entity addresses of connections **Example request** @@ -115,7 +115,7 @@ def get_connection(): def post_price_data(): """API endpoint to post price data. - .. :quickref: User; Upload price data to the platform + .. :quickref: Data; Upload price data to the platform **Optional parameters** @@ -203,7 +203,7 @@ def post_weather_data(): The sensor type is part of the unique entity address for each sensor, together with the sensor's latitude and longitude. - .. :quickref: User; Upload weather data to the platform + .. :quickref: Data; Upload weather data to the platform **Optional parameters** @@ -271,7 +271,7 @@ def post_weather_data(): def get_prognosis(): """API endpoint to get prognosis. - .. :quickref: User; Download prognosis from the platform + .. :quickref: Data; Download prognosis from the platform **Optional parameters** @@ -339,7 +339,7 @@ def get_prognosis(): def post_prognosis(): """API endpoint to post prognoses about meter data. - .. :quickref: User; Upload prognosis to the platform + .. :quickref: Data; Upload prognosis to the platform **Optional parameters** diff --git a/flexmeasures/api/v1_2/routes.py b/flexmeasures/api/v1_2/routes.py index 7098f7061..c94034274 100644 --- a/flexmeasures/api/v1_2/routes.py +++ b/flexmeasures/api/v1_2/routes.py @@ -43,7 +43,7 @@ def get_device_message(): """API endpoint to get device message. - .. :quickref: User; Download control signal from the platform + .. :quickref: Control; Download control signal from the platform **Optional parameters** @@ -101,7 +101,7 @@ def get_device_message(): def post_udi_event(): """API endpoint to post UDI event. - .. :quickref: User; Upload flexibility constraints to the platform + .. :quickref: Control; Upload flexibility constraints to the platform **Example request** diff --git a/flexmeasures/api/v1_3/routes.py b/flexmeasures/api/v1_3/routes.py index 9505ae0a2..4df887e5d 100644 --- a/flexmeasures/api/v1_3/routes.py +++ b/flexmeasures/api/v1_3/routes.py @@ -25,7 +25,7 @@ def get_device_message(): """API endpoint to get device message. - .. :quickref: User; Download control signal from the platform + .. :quickref: Control; Download control signal from the platform **Optional parameters** @@ -82,7 +82,7 @@ def get_device_message(): def post_udi_event(): """API endpoint to post UDI event. - .. :quickref: User; Upload flexibility constraints to the platform + .. :quickref: Control; Upload flexibility constraints to the platform **Example request A** diff --git a/flexmeasures/ui/__init__.py b/flexmeasures/ui/__init__.py index 098dea01c..ecf09204d 100644 --- a/flexmeasures/ui/__init__.py +++ b/flexmeasures/ui/__init__.py @@ -1,6 +1,7 @@ import os from flask import current_app, Flask, Blueprint +from flask.blueprints import BlueprintSetupState from flask import send_from_directory from flask_security import login_required, roles_accepted import numpy as np @@ -58,10 +59,20 @@ def favicon(): add_jinja_filters(app) add_jinja_variables(app) - # re-register api blueprint so it'll register the chart views (the ones in views.charts) - app.register_blueprint( - flexmeasures_api_v2_0, url_prefix="/api/v2_0", first_registration=False + # Add our chart endpoint to the Api 2.0 blueprint. + # This lets it show up in the API list twice, but that seems to be the best way for now (see below). + # Also, we'll reconsider where these charts endpoints should really live when we make more. + from flexmeasures.ui.views.charts import get_power_chart + + # We cannot call this directly on the blueprint, as that only defers to registration. + # Re-registering the blueprint leads to all endpoints being listed twice. + blueprint_state = BlueprintSetupState( + flexmeasures_api_v2_0, + app, + {"url_prefix": "/api/v2_0"}, + first_registration=False, ) + blueprint_state.add_url_rule("/charts/power", None, get_power_chart) def register_rq_dashboard(app):