2020-02-23 13:07:37 +00:00
|
|
|
from django.shortcuts import render
|
|
|
|
|
|
|
|
from django.contrib.auth.models import User
|
|
|
|
from django.shortcuts import get_object_or_404
|
2020-02-25 19:53:12 +00:00
|
|
|
|
|
|
|
from rest_framework import viewsets, permissions
|
2020-02-23 13:07:37 +00:00
|
|
|
from rest_framework.response import Response
|
|
|
|
|
|
|
|
|
2020-02-25 19:53:12 +00:00
|
|
|
from opennebula.models import VM as OpenNebulaVM
|
2020-02-23 13:07:37 +00:00
|
|
|
|
2020-02-25 19:53:12 +00:00
|
|
|
from .models import VMHost
|
|
|
|
from .serializers import VMHostSerializer
|
2020-02-23 13:07:37 +00:00
|
|
|
|
2020-02-25 19:53:12 +00:00
|
|
|
class VMHostViewSet(viewsets.ModelViewSet):
|
|
|
|
serializer_class = VMHostSerializer
|
|
|
|
queryset = VMHost.objects.all()
|
|
|
|
permission_classes = [permissions.IsAdminUser]
|