Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
RECIRCLE
/
interface-openstack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
4
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
5aee63bd
authored
Apr 08, 2019
by
edems
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Snapshots & Storages controller added
parent
c167610b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
controllers/SnapshotsController.py
+12
-0
controllers/StoragesController.py
+14
-0
No files found.
controllers/SnapshotsController.py
View file @
5aee63bd
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
...
...
controllers/StoragesController.py
View file @
5aee63bd
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment