diff --git a/src/clmc-webservice/clmcservice/__init__.py b/src/clmc-webservice/clmcservice/__init__.py index 0dea774a58d72dcb7a7ede5404f4fb158a2de0c8..dde9f133937bf7021834459e3c01aa5ee0385b7d 100644 --- a/src/clmc-webservice/clmcservice/__init__.py +++ b/src/clmc-webservice/clmcservice/__init__.py @@ -42,10 +42,10 @@ def main(global_config, **settings): config.add_route('aggregator_config', '/aggregator/config') config.add_view(AggregatorConfig, attr='get', request_method='GET') - config.add_view(AggregatorConfig, attr='post', request_method='POST') + config.add_view(AggregatorConfig, attr='put', request_method='PUT') - config.add_route('aggregator_starter', '/aggregator/status') - config.add_view(aggregator_starter, request_method='POST') + config.add_route('aggregator_starter', '/aggregator/status', request_method='PUT') + config.add_view(aggregator_starter) config.scan() return config.make_wsgi_app() diff --git a/src/clmc-webservice/clmcservice/tests.py b/src/clmc-webservice/clmcservice/tests.py index 00aa9e2df5005b7511c9b5ef9981f4da6c1875f0..22ccf9402b03618b56e08dae0baeaabe7fc7e47a 100644 --- a/src/clmc-webservice/clmcservice/tests.py +++ b/src/clmc-webservice/clmcservice/tests.py @@ -92,9 +92,9 @@ class TestAggregator(object): ("{}", None), ("{aggregator_running: true}", None), ]) - def test_POST(self, input_body, output_value): + def test_PUT(self, input_body, output_value): """ - Tests the POST method for the configuration of the aggregator + Tests the PUT method for the configuration of the aggregator :param input_body: the input form parameter :param output_value: the expected output value, None for expecting an Exception """ @@ -111,15 +111,15 @@ class TestAggregator(object): request.body = input_body.encode(request.charset) if output_value is not None: - response = AggregatorConfig(request).post() - assert response == output_value, "Response of POST request must include the new status of the aggregator" + response = AggregatorConfig(request).put() + assert response == output_value, "Response of PUT request must include the new status of the aggregator" for attribute in CONFIG_ATTRIBUTES: assert self.config.get_settings().get(attribute) == output_value.get(attribute), "Aggregator settings configuration is not updated." else: error_raised = False try: - AggregatorConfig(request).post() + AggregatorConfig(request).put() except HTTPBadRequest: error_raised = True diff --git a/src/clmc-webservice/clmcservice/views.py b/src/clmc-webservice/clmcservice/views.py index 4fc47ffdad5014c935cb8be8b2dddd5e42b8ab07..b47380c54fbb9e9fe615c45986a19f022884f090 100644 --- a/src/clmc-webservice/clmcservice/views.py +++ b/src/clmc-webservice/clmcservice/views.py @@ -91,11 +91,11 @@ class AggregatorConfig(object): return config - def post(self): + def put(self): """ - A POST API call for the status of the aggregator. + A PUT API call for the status of the aggregator. - :return: A JSON response to the POST call (success or fail). + :return: A JSON response to the PUT call (success or fail). :raises HTTPBadRequest: if form argument cannot be converted to boolean """