From 8379dee5c71c5796428b62ac51f4ff348e9d3026 Mon Sep 17 00:00:00 2001 From: manuel83 Date: Mon, 21 Jan 2019 22:37:00 +0100 Subject: [PATCH] swagger doc for system controller added --- .idea/workspace.xml | 192 ++++++++++++++++----------- cbpi/controller/system_controller.py | 48 ++++++- 2 files changed, 157 insertions(+), 83 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index b5bc4e0..2466e55 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,18 +2,7 @@ - - - - - - - - - - - - + @@ -329,6 +325,21 @@ + + + + + + + + + + + + + + + @@ -342,6 +353,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -625,7 +657,7 @@ - + 1541288846149 @@ -677,7 +709,7 @@ - @@ -697,10 +729,10 @@ - + - + @@ -918,16 +950,6 @@ - - - - - - - - - - @@ -993,16 +1015,6 @@ - - - - - - - - - - @@ -1023,16 +1035,6 @@ - - - - - - - - - - @@ -1153,7 +1155,7 @@ - + @@ -1161,5 +1163,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cbpi/controller/system_controller.py b/cbpi/controller/system_controller.py index 51ce995..bc2aea6 100644 --- a/cbpi/controller/system_controller.py +++ b/cbpi/controller/system_controller.py @@ -16,7 +16,15 @@ class SystemController(): @request_mapping("/", method="GET", auth_required=False) async def state(self, request): - # TODO implement restart + """ + --- + description: Get complete system state + tags: + - System + responses: + "200": + description: successful operation + """ return web.json_response(data=dict( actor=self.cbpi.actor.get_state(), sensor=self.cbpi.sensor.get_state(), @@ -29,16 +37,41 @@ class SystemController(): @request_mapping("/restart", method="POST", name="RestartServer", auth_required=False) def restart(self, request): - # TODO implement restart + """ + --- + description: Restart System - Not implemented + tags: + - System + responses: + "200": + description: successful operation + """ return web.Response(text="NOT IMPLEMENTED") @request_mapping("/shutdown", method="POST", name="ShutdownSerer", auth_required=False) def restart(self, request): - # TODO implement restart + """ + --- + description: Shutdown System - Not implemented + tags: + - System + responses: + "200": + description: successful operation + """ return web.Response(text="NOT IMPLEMENTED") @request_mapping("/jobs", method="GET", name="get_jobs", auth_required=False) def get_all_jobs(self, request): + """ + --- + description: Get all running Jobs + tags: + - System + responses: + "200": + description: successful operation + """ scheduler = get_scheduler_from_app(self.cbpi.app) result = [] for j in scheduler: @@ -50,5 +83,14 @@ class SystemController(): @request_mapping("/events", method="GET", name="get_all_events", auth_required=False) def get_all_events(self, request): + """ + --- + description: Get list of all registered events + tags: + - System + responses: + "200": + description: successful operation + """ return web.json_response(data=self.cbpi.bus.dump())