Commit 4a38ccee by Chif Gergő

Create class for Instance data, move vm.py

parent bc84cb1a
......@@ -49,7 +49,7 @@ class InstanceInterface:
def get_status(self, name_or_id):
raise NotImplementedError
def list_all_vm(self, name_or_id):
def list_all_vm(self):
raise NotImplementedError
def install_ssh_key(self, name_or_id, key):
......
import json
class Instance:
''' The releveant data of the virtual machine instances
This data would be sent by the interface to the portal,
when it requests a virtual machine instance and vica versa
'''
ssh_keys = None
console_access_url = None
def __init__(self, id, name, resource, image_id, interfaces,
status, addresses, disks=None):
self.id = id
self.name = name
self.resource = resource
self.image = image_id
self.disks = disks
self.interfaces = interfaces
self.status = status
self.addresses = addresses
def JSON(self):
return json.dump(self)
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