summaryrefslogtreecommitdiff
path: root/opendc/api/v1/specifications/failure-models/endpoint.py
diff options
context:
space:
mode:
Diffstat (limited to 'opendc/api/v1/specifications/failure-models/endpoint.py')
-rw-r--r--opendc/api/v1/specifications/failure-models/endpoint.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/opendc/api/v1/specifications/failure-models/endpoint.py b/opendc/api/v1/specifications/failure-models/endpoint.py
new file mode 100644
index 00000000..2530d032
--- /dev/null
+++ b/opendc/api/v1/specifications/failure-models/endpoint.py
@@ -0,0 +1,17 @@
+from opendc.models.failure_model import FailureModel
+from opendc.util.rest import Response
+
+def GET(request):
+ """Get all Failure Models."""
+
+ # Get the FailureModels
+
+ failure_models = FailureModel.query()
+
+ # Return the FailureModels
+
+ return Response(
+ 200,
+ 'Successfully retrieved FailureModels.',
+ [x.to_JSON() for x in failure_models]
+ )