uncloud/uncloud/uncloud_vm/views.py

19 lines
516 B
Python
Raw Normal View History

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]