summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-api/opendc
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-07-08 11:45:06 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-07-08 11:45:06 +0200
commit1157cc3c56c0f8d36be277bd1ea633f03dd7abbf (patch)
treee5e49c66ad15f35985329b919bec83d8f21c18a9 /opendc-web/opendc-web-api/opendc
parent5ec19973eb3d23046d874b097275857a58c23082 (diff)
api: Re-expose simulation results from scenario endpoint
This change updates the OpenDC API to re-expose the simulation results as they are necessary for the frontend to display the results.
Diffstat (limited to 'opendc-web/opendc-web-api/opendc')
-rw-r--r--opendc-web/opendc-web-api/opendc/models/scenario.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/opendc-web/opendc-web-api/opendc/models/scenario.py b/opendc-web/opendc-web-api/opendc/models/scenario.py
index 63160448..47771e06 100644
--- a/opendc-web/opendc-web-api/opendc/models/scenario.py
+++ b/opendc-web/opendc-web-api/opendc/models/scenario.py
@@ -8,6 +8,13 @@ from opendc.models.model import Model
from opendc.models.portfolio import Portfolio
+class SimulationSchema(Schema):
+ """
+ Simulation details.
+ """
+ state = fields.String()
+
+
class TraceSchema(Schema):
"""
Schema for specifying the trace of a scenario.
@@ -42,6 +49,8 @@ class ScenarioSchema(Schema):
trace = fields.Nested(TraceSchema)
topology = fields.Nested(TopologySchema)
operational = fields.Nested(OperationalSchema)
+ simulation = fields.Nested(SimulationSchema, dump_only=True)
+ results = fields.Dict(dump_only=True)
class Scenario(Model):