Commit 5aee63bd by edems

Snapshots & Storages controller added

parent c167610b
from aiohttp import web from aiohttp import web
from implementation.storage.OpenstackSnapshotsManager import OpenstackSnapshotManager
class SnapshotsController: class SnapshotsController:
snapshot_manager = None
@staticmethod
def init(app, openstack):
SnapshotsController.snapshot_manager = OpenstackSnapshotManager(openstack)
SnapshotsController.add_routes(app)
@staticmethod @staticmethod
def add_routes(app): def add_routes(app):
app.add_routes([ app.add_routes([
...@@ -18,6 +28,8 @@ class SnapshotsController: ...@@ -18,6 +28,8 @@ class SnapshotsController:
@staticmethod @staticmethod
async def list(request): async def list(request):
snapshots = SnapshotsController.snapshot_manager.list()
return web.Response(text='List') return web.Response(text='List')
@staticmethod @staticmethod
......
from aiohttp import web from aiohttp import web
from implementation.storage.OpenstackStorageManager import OpenstackStorageManager
class StoragesController: class StoragesController:
storage_manager = None
@staticmethod
def init(app, os):
StoragesController.storage_manager = OpenstackStorageManager(os)
StoragesController.add_routes(app)
@staticmethod @staticmethod
def add_routes(app): def add_routes(app):
app.add_routes([ app.add_routes([
...@@ -18,6 +28,10 @@ class StoragesController: ...@@ -18,6 +28,10 @@ class StoragesController:
@staticmethod @staticmethod
async def list(request): async def list(request):
volumes = StoragesController.storage_manager.list()
print(volumes)
return web.Response(text='List') return web.Response(text='List')
@staticmethod @staticmethod
......
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