diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-07-02 16:14:52 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-07-02 18:09:01 +0200 |
| commit | a2a5979bfb392565b55e489b6020aa391e782eb0 (patch) | |
| tree | 00278aaf5f8681a4d26029280fd24a605187839f /opendc-web/opendc-web-api/app.py | |
| parent | 45b73e4683cce35de79117c5b4a6919556d9644f (diff) | |
api: Add endpoint for simulation jobs
This change adds an API endpoint for simulation jobs which allows API
consumers to manage simulation jobs without needing direct database
access that is currently needed for the web runner.
Diffstat (limited to 'opendc-web/opendc-web-api/app.py')
| -rwxr-xr-x | opendc-web/opendc-web-api/app.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/opendc-web/opendc-web-api/app.py b/opendc-web/opendc-web-api/app.py index 96a1ca7a..36c80b7a 100755 --- a/opendc-web/opendc-web-api/app.py +++ b/opendc-web/opendc-web-api/app.py @@ -10,6 +10,7 @@ from flask_restful import Api from flask_swagger_ui import get_swaggerui_blueprint from marshmallow import ValidationError +from opendc.api.jobs import JobList, Job from opendc.api.portfolios import Portfolio, PortfolioScenarios from opendc.api.prefabs import Prefab, PrefabList from opendc.api.projects import ProjectList, Project, ProjectTopologies, ProjectPortfolios @@ -60,6 +61,8 @@ def setup_api(app): api.add_resource(TraceList, '/traces/') api.add_resource(Trace, '/traces/<string:trace_id>') api.add_resource(SchedulerList, '/schedulers/') + api.add_resource(JobList, '/jobs/') + api.add_resource(Job, '/jobs/<string:job_id>') @app.errorhandler(AuthError) def handle_auth_error(ex): |
