Commit e77cbe27 by Belákovics Ádám

Add network fix and vnc console

parent b7d22c8a
Pipeline #1381 failed with stages
in 42 seconds
......@@ -282,6 +282,9 @@ class Instance(BaseMachineDescriptor):
self.description = new_description
self.save()
def get_vnc_console(self):
return interface.get_vnc_console(self.remote_id)
def destroy(self):
self.deleted = True
self.save()
......@@ -122,7 +122,7 @@ class InstanceViewSet(AuthorizationMixin, ViewSet):
instance.destroy()
return Response(status=status.HTTP_204_NO_CONTENT)
@action(detail=True, methods=["post"])
@action(detail=True, methods=["POST"])
def template(self, request, pk):
instance = self.get_object(pk)
if not self.has_perms_for_model(request.user, 'template'):
......@@ -166,6 +166,11 @@ class InstanceViewSet(AuthorizationMixin, ViewSet):
else:
return Response(data="No new lease provided", status=status.HTTP_400_BAD_REQUEST)
@action(detail=True, methods=["GET"])
def get_vnc_console(self, request, pk):
instance = self.get_object(pk)
return Response(data=instance.get_vnc_console())
@action(detail=True, methods=["POST"])
def resize(self, request, pk):
pass
......
Subproject commit cc7bd247b4457b1020c6442a6c944e1c3ba0caff
Subproject commit 0b5dc350a10e6f6805815acb5c91f98d307bad32
......@@ -29,5 +29,6 @@ class ImageTemplate(BaseMachineDescriptor):
access_protocol=instance.access_protocol,
lease=instance.lease,
flavor=instance.flavor,
network_id=instance.network_id,
type="INSTANCE")
return new_template
......@@ -27,6 +27,7 @@ class ImageTemplateViewSet(ModelViewSet):
image=data["image"],
lease=data["lease"],
flavor=data["flavor"],
network_id="7245c546-2f22-4ab2-abc9-9eb59c2e6627", # TODO: replace
type="IMAGE"
)
new_template.save()
......
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