Commit 729cb080 by edems

deleted unused controller

parent eeaec84f
import json
from aiohttp import web
from implementation.storage.OpenstackStorageManager import OpenstackStorageManager
class StoragesController:
storage_manager = None
@staticmethod
def init(app, os):
StoragesController.storage_manager = OpenstackStorageManager(os)
StoragesController.add_routes(app)
@staticmethod
def add_routes(app):
app.add_routes([
web.get('/storages', StoragesController.list),
web.post('/storages/create', StoragesController.create),
web.get('/storages/{volume}', StoragesController.show),
web.delete('/storages/{storage}/delete', StoragesController.delete)
])
@staticmethod
async def create(request):
return web.Response(text='Create')
@staticmethod
async def list(request):
volumes = StoragesController.storage_manager.list()
return web.Response(text=json.dumps(volumes[0]))
@staticmethod
async def show(request):
id = request.match_info.get('volume')
volume = StoragesController.storage_manager.get(id)
response = json.dumps(volume)
return web.Response(text=response)
@staticmethod
async def delete(request):
return web.Response(text='Delete')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment