uncloud-mravi/uncloud/opennebula/serializers.py

14 lines
406 B
Python

from rest_framework import serializers
from opennebula.models import VM
class VMSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = VM
fields = ['id', 'owner', 'data']
class OpenNebulaVMSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = VM
fields = ['id', 'owner', 'cores', 'ram_in_gb', 'disks', 'last_host', 'graphics']