Skip to content
Snippets Groups Projects
Commit 7f46e9ea authored by Nikolay Stanchev's avatar Nikolay Stanchev
Browse files

Simplifies the URL routing of the CLMC service

parent 5066f12d
No related branches found
No related tags found
No related merge requests found
......@@ -41,15 +41,8 @@ def main(global_config, **settings):
config = Configurator(settings=settings)
config.add_route('aggregator_config', '/aggregator/config')
config.add_view('clmcservice.aggregationapi.views.AggregatorConfig', attr='get', request_method='GET')
config.add_view('clmcservice.aggregationapi.views.AggregatorConfig', attr='put', request_method='PUT')
config.add_route('aggregator_controller', '/aggregator/control')
config.add_view('clmcservice.aggregationapi.views.AggregatorController', attr='get', request_method='GET')
config.add_view('clmcservice.aggregationapi.views.AggregatorController', attr='put', request_method='PUT')
config.add_route('round_trip_time_query', '/query/round-trip-time')
config.add_view('clmcservice.aggregationapi.views.RoundTripTimeQuery', attr='get', request_method='GET')
config.scan()
config.scan() # This method scans the packages and finds any views related to the routes added in the app configuration
return config.make_wsgi_app()
......@@ -22,7 +22,7 @@
// Created for Project : FLAME
"""
from pyramid.view import view_defaults
from pyramid.view import view_defaults, view_config
from pyramid.httpexceptions import HTTPBadRequest, HTTPInternalServerError
from influxdb import InfluxDBClient
from urllib.parse import urlparse
......@@ -54,6 +54,7 @@ class AggregatorConfig(object):
self.request = request
@view_config(request_method="GET")
def get(self):
"""
A GET API call for the configuration of the aggregator.
......@@ -70,6 +71,7 @@ class AggregatorConfig(object):
return config
@view_config(request_method="PUT")
def put(self):
"""
A PUT API call for the status of the aggregator.
......@@ -141,6 +143,7 @@ class AggregatorController(object):
self.request = request
@view_config(request_method="GET")
def get(self):
"""
A GET API call for the status of the aggregator - running or not.
......@@ -160,6 +163,7 @@ class AggregatorController(object):
return config
@view_config(request_method="PUT")
def put(self):
"""
A PUT API call for the status of the aggregator.
......@@ -268,6 +272,7 @@ class RoundTripTimeQuery(object):
self.request = request
@view_config(request_method="GET")
def get(self):
"""
A GET API call for the averaged round trip time of a specific media service over a given time range.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment