-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose the Progress interface through the HTTP/JSON API (#1092)
Trello: https://trello.com/c/2RvcZBFR/3564-5-expose-the-progress-api-over-http This PR exposes the `Progress` API for the Manager and Software services through the HTTP/JSON interface. It is implemented as a pair of functions that can be reused in all services that want to implement such an interface. ## A `/SERVICE/progress` endpoint The `progress_router` function allows to add a `/SERVICE/progress` route that exposes the current progress: ```json { "current_step": 4, "max_steps": 4, "current_title": "Calculating the software proposal", "finished": false } ``` ## The events stream The `progress_stream` builds an events stream that emits a new event when the `current_step` changes: ```json { "type": "Progress", "service": "org.opensuse.Agama.Software1", "current_step": 4, "max_steps": 4, "current_title": "Calculating the software proposal", "finished": false } ``` ## Enabling `ServiceStatus` and `Progress` for the Software service Additionally, the PR enables the `ServiceStatus` (implemented #1089) and the `Progress` for the Software service too.
- Loading branch information
Showing
9 changed files
with
289 additions
and
122 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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.