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
Commit
b55fc6db
authored
Apr 08, 2019
by
adamtorok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
models became serializable
parent
cc456c5e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
0 deletions
+36
-0
interface/image/Image.py
+12
-0
interface/storage/Snapshot.py
+12
-0
interface/storage/Volume.py
+12
-0
No files found.
interface/image/Image.py
View file @
b55fc6db
import
json
class
Image
:
def
__init__
(
self
,
id
,
name
,
format
)
->
None
:
super
()
.
__init__
()
...
...
@@ -5,3 +8,12 @@ class Image:
self
.
id
=
id
self
.
name
=
name
self
.
format
=
format
def
to_json
(
self
):
return
json
.
dumps
(
self
.
__dict__
)
def
__repr__
(
self
):
return
self
.
to_json
()
def
__str__
(
self
)
->
str
:
return
self
.
to_json
()
interface/storage/Snapshot.py
View file @
b55fc6db
import
json
class
Snapshot
:
def
__init__
(
self
,
id
,
size
)
->
None
:
super
()
.
__init__
()
self
.
id
=
id
self
.
size
=
size
def
to_json
(
self
):
return
json
.
dumps
(
self
.
__dict__
)
def
__repr__
(
self
):
return
self
.
to_json
()
def
__str__
(
self
)
->
str
:
return
self
.
to_json
()
interface/storage/Volume.py
View file @
b55fc6db
import
json
class
Volume
:
def
__init__
(
self
,
id
,
size
,
bootable
)
->
None
:
super
()
.
__init__
()
...
...
@@ -5,3 +8,12 @@ class Volume:
self
.
id
=
id
self
.
size
=
size
self
.
bootable
=
bootable
def
to_json
(
self
):
return
json
.
dumps
(
self
.
__dict__
)
def
__repr__
(
self
):
return
self
.
to_json
()
def
__str__
(
self
)
->
str
:
return
self
.
to_json
()
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