update schema
This commit is contained in:
parent
bb7b58e072
commit
b491e69fde
14
api/vm.py
14
api/vm.py
|
@ -3,7 +3,7 @@ from uuid import uuid4
|
|||
from pydantic import UUID4, Field, ConfigDict
|
||||
from pydantic import BaseModel as _BaseModel
|
||||
|
||||
from deevirt_schema.libvirt.dom import config as configDom
|
||||
from ..libvirt.dom import config as configDom
|
||||
|
||||
class BaseModel(_BaseModel):
|
||||
class Config:
|
||||
|
@ -64,8 +64,8 @@ class Event(BaseModel):
|
|||
class DevicesDisk(BaseModel):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
pool_id:UUID4 = Field()
|
||||
id:UUID4 = Field()
|
||||
pool_id:Optional[UUID4] = Field(default=None)
|
||||
id:UUID4 = Field(default_factory=uuid4)
|
||||
size:int = Field()
|
||||
unit:configDom.UnitEnum = Field(default=configDom.UnitEnum.GiB)
|
||||
bus:configDom.DevicesDiskTarget.busEnum = Field(default=configDom.DevicesDiskTarget.busEnum.scsi)
|
||||
|
@ -89,8 +89,8 @@ class DevicesInterface(BaseModel):
|
|||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
switch_id:UUID4
|
||||
id:UUID4
|
||||
mac_addr:str = Field()
|
||||
id:UUID4 = Field(default_factory=uuid4)
|
||||
mac_addr:str = Field(default=None)
|
||||
|
||||
class Graphics(BaseModel):
|
||||
port:int = Field(default=-1)
|
||||
|
@ -106,7 +106,7 @@ class Audio(BaseModel):
|
|||
class VideoModel(BaseModel):
|
||||
type:configDom.VideoModel.typeEnum = Field(default=configDom.VideoModel.typeEnum.cirrus)
|
||||
vram:int = Field(default=16384)
|
||||
primary:configDom.YesNoEnum = Field(default=configDom.YesNoEnum.YES)
|
||||
primary:bool = Field(default=True)
|
||||
|
||||
class Video(BaseModel):
|
||||
model:VideoModel = Field()
|
||||
|
@ -133,7 +133,7 @@ class VM(BaseModel):
|
|||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
# General metadata
|
||||
id:UUID4 = Field()
|
||||
id:UUID4 = Field(default_factory=uuid4)
|
||||
datacenter_id:Optional[UUID4] = Field(default=None)
|
||||
name:str = Field()
|
||||
description:Optional[str] = Field(default=None)
|
||||
|
|
Loading…
Reference in New Issue