Commit 503b5c02 by Belákovics Ádám

Create Flavor, BlockDeviceMaping resource

parent 43003cf9
Pipeline #709 failed with stage
in 38 seconds
......@@ -7,10 +7,13 @@ It should be implemented for using other providers e. g. OpenStack
class InstanceInterface:
def create_vm_from_template(self, template, resource):
def create_base_vm(self, name, flavor, networks, block_device_mapping):
raise NotImplementedError
def create_multiple_vm_from_template(self, template, resource, number):
def create_vm_from_template(self, name, image, flavor, networks):
raise NotImplementedError
def create_multiple_vm_from_template(self, image, flavor, networks, number):
raise NotImplementedError
def get_vm(self, name_or_id):
......@@ -40,9 +43,6 @@ class InstanceInterface:
def destroy_vm(self, name_or_id):
raise NotImplementedError
def migrate_vm(self, name_or_id, to):
raise NotImplementedError
def get_status(self, name_or_id):
raise NotImplementedError
......@@ -52,17 +52,14 @@ class InstanceInterface:
def install_ssh_key(self, name_or_id, key):
raise NotImplementedError
def save_as_template(self, name_or_id):
def get_vnc_console(self, name_or_id):
raise NotImplementedError
def get_vnc_console(self, name_or_id):
def change_password(self, name_or_id):
raise NotImplementedError
# def change_password(self, name_or_id):
# raise NotImplementedError
#
# def get_password(self, name_or_id):
# raise NotImplementedError
def get_password(self, name_or_id):
raise NotImplementedError
def resize_vm(self, name_or_id):
raise NotImplementedError
......
......@@ -10,11 +10,11 @@ class Instance:
ssh_keys = None
console_access_url = None
def __init__(self, id, name, resource, image_id,
status, addresses, launched_at, terminated_at, disks=None):
def __init__(self, id, name, flavor, image_id, status,
addresses, launched_at, terminated_at, disks=None):
self.id = id
self.name = name
self.resource = resource
self.flavor = flavor
self.image = image_id
self.disks = disks
self.status = status
......@@ -34,6 +34,20 @@ class Flavor:
self.vcpus = vcpus
self.initial_disk = disk
def JSON(self):
return json.dumps(self.__dict__)
class Volume:
pass
class BlockDeviceMapping:
def __init__(self, boot_index, uuid, source_type, volume_size,
destination_type, delete_on_termination, disk_bus):
self.boot_index = boot_index
self.uuid=uuid
self.source_type=source_type
self.volume_size=volume_size
self.destination_type=destination_type
self.delete_on_termination=delete_on_termination
self.disk_bus=disk_bus
def JSON(self):
return json.dumps(self.__dict__)
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