use the 202 status consistently in triggering endpoints #2224
Open
nhoening wants to merge 16 commits into
Open
use the 202 status consistently in triggering endpoints #2224nhoening wants to merge 16 commits into
nhoening wants to merge 16 commits into
Conversation
… scheduling) and provide follow-up URLs in the response Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…ished (just like get_forecast) - for now only use this (over the old 400 code) if API_SUNSET is being used Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…ering-and-fetching-endpoints Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…ering-and-fetching-endpoints Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Documentation build overview
48 files changed ·
|
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…ering-and-fetching-endpoints
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Flix6x
requested changes
Jul 14, 2026
…camel-case - even in existing job status endpoitn fields (using the new field-deprecation logic) Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…ering-and-fetching-endpoints Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…other review comments dealing with docs Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…etching-endpoints' of github.com:FlexMeasures/flexmeasures into feat/api/use-202-status-consistenly-in-triggering-and-fetching-endpoints
…ering-and-fetching-endpoints Signed-off-by: Nicolas Höning <nicolas@seita.nl>
… the FlexMeasures-Deprecated-Response-Fields header Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…etching-endpoints' of github.com:FlexMeasures/flexmeasures into feat/api/use-202-status-consistenly-in-triggering-and-fetching-endpoints
…ering-and-fetching-endpoints Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Member
Author
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Use 202 in triggering endpoints (forecasting, scheduling) and provide follow-up URLs in the response.
Closes #2171
GET /api/v3_0/jobs/<uuid>to return 202 while the job is queued/running, 422 if it failed, and 200 only once it is finished (previously always 200), for consistency with the endpoints above.jobas the canonical response field (kebab-case, no_idsuffix per API policy) while keeping legacyschedule/forecastfields for backward compatibility; also addsjob-urland (where applicable)results-url.Deprecation,Link,FlexMeasures-Deprecated-Response-Fields) to mark deprecated response fields such asschedule/forecast, pointing to migration guidance.request_accepted_for_processing(...)so accepted job responses can include legacy keys and result URLs.Known follow-up (out of scope for this PR): the deprecation date used for the headers above is currently a single hardcoded constant (
JOB_RESPONSE_FIELDS_DEPRECATION_DATEinflexmeasures/api/v3_0/deprecations.py), not tied to when a given host actually deploys the change. AFLEXMEASURES_DEPRECATION_AND_SUNSEThost-configurable mechanism is planned in a follow-up PR/branch.Look & Feel
Mainly Sphinx and Swaggerdocs.
How to test
The only new test is
test_get_schedule_unfinished_job_returns_202_when_sunset_active.A bunch of tests simply check for 202 now instead of 200.