summaryrefslogtreecommitdiff
path: root/opendc/api/v2/traces
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-06-25 17:11:03 +0200
committerGeorgios Andreadis <info@gandreadis.com>2020-06-25 17:11:03 +0200
commitc0bf71322e4fd510046588e388ada0a81f54631d (patch)
tree7f0af5b0657558a4730b62298534cd6a1d829765 /opendc/api/v2/traces
parentcae7ee8ab4639963d3da7fef6f078a6078340a0b (diff)
Implement and test path
Diffstat (limited to 'opendc/api/v2/traces')
-rw-r--r--opendc/api/v2/traces/traceId/jobs/__init__.py0
-rw-r--r--opendc/api/v2/traces/traceId/jobs/endpoint.py29
2 files changed, 0 insertions, 29 deletions
diff --git a/opendc/api/v2/traces/traceId/jobs/__init__.py b/opendc/api/v2/traces/traceId/jobs/__init__.py
deleted file mode 100644
index e69de29b..00000000
--- a/opendc/api/v2/traces/traceId/jobs/__init__.py
+++ /dev/null
diff --git a/opendc/api/v2/traces/traceId/jobs/endpoint.py b/opendc/api/v2/traces/traceId/jobs/endpoint.py
deleted file mode 100644
index af681b70..00000000
--- a/opendc/api/v2/traces/traceId/jobs/endpoint.py
+++ /dev/null
@@ -1,29 +0,0 @@
-from opendc.models_old.job import Job
-from opendc.models_old.trace import Trace
-from opendc.util import exceptions
-from opendc.util.rest import Response
-
-
-def GET(request):
- """Get this Trace's Jobs."""
-
- # Make sure required parameters are there
-
- try:
- request.check_required_parameters(path={'traceId': 'int'})
-
- except exceptions.ParameterError as e:
- return Response(400, str(e))
-
- # Instantiate a Trace and make sure it exists
-
- trace = Trace.from_primary_key((request.params_path['traceId'], ))
-
- if not trace.exists():
- return Response(404, '{} not found.'.format(trace))
-
- # Get and return the Jobs
-
- jobs = Job.query('trace_id', request.params_path['traceId'])
-
- return Response(200, 'Successfully retrieved Jobs for {}.'.format(trace), [x.to_JSON() for x in jobs])