uncloud-mravi/uncloud/uncloud_vm/views.py
Nico Schottelius d4b170f813 phase in vmhost
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-02-25 20:53:12 +01:00

18 lines
516 B
Python

from django.shortcuts import render
from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404
from rest_framework import viewsets, permissions
from rest_framework.response import Response
from opennebula.models import VM as OpenNebulaVM
from .models import VMHost
from .serializers import VMHostSerializer
class VMHostViewSet(viewsets.ModelViewSet):
serializer_class = VMHostSerializer
queryset = VMHost.objects.all()
permission_classes = [permissions.IsAdminUser]