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

add admin API endpoints to set specfic scenario states #1721

Closed
wants to merge 1 commit into from

Conversation

willKo
Copy link

@willKo willKo commented Dec 2, 2021

description

This PR adds two admin endpoints:

get the current state of a scenario:

GET __admin/scenario/state?stateName=scenario-name

set the current state of a scenario

POST __admin/scenario/state
Body:

{ 
"scenarioName": "scenario-name",
"scenarioState": "scenario-state"
}

further notes

This allows setting a scenario to any state without knowing the current state.
The workaround discussed in PR #1079 and issue #847 only allows resetting the scenario if you know the current state.
Also, I do not think that it is the ideal usage to create additional "control mappings" to achieve __admin functionality, therefore here is an alternative proposal.
In contrast to PR #1079 this PR not just allows resetting a scenario, you can also switch to an intermediate or final state of a scenario.

Would also enable PR:
#1079
and also fix issue
#847
(when setting scenario state in POST-Request to "Started")

Discussion

If this PR is correct according to the Contribution Rules, please let me know, so I can fix it.
If the API changes are not desirable (e.g. a path parameter would be nicer for the "state-name" in the GET request), please let me know.

Adds two endpoints to the admin api:
- GET /__admin/scenario/state?stateName=somestate
- POST /__admin/scenario/state
  With JsonBody-Attributes "scenarioName" and "scenarioState"
@willKo willKo changed the title add admin API endpoints to set specfic scenario states. add admin API endpoints to set specfic scenario states Dec 2, 2021
@willKo
Copy link
Author

willKo commented Dec 14, 2021

pretty similar to #1046

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.

None yet

1 participant