This commit is contained in:
Mickael BOURNEUF 2024-10-09 12:47:06 +02:00
parent 9b9617540c
commit bb7b58e072
2 changed files with 12 additions and 15 deletions

View File

@ -4,8 +4,6 @@ from pydantic_xml import element, attr
from pydantic import UUID4, BaseModel, ConfigDict, Field
from pydantic_extra_types.mac_address import MacAddress
from deevirt_common.lib.virt import vm as vmVirt
class lsp(BaseModel):
model_config = ConfigDict(from_attributes=True)

View File

@ -1,8 +1,7 @@
from typing import List
from pydantic_xml import element, attr
from pydantic import UUID4, BaseModel, ConfigDict, Field
from deevirt_common.lib.virt import vm as vmVirt
from deevirt_schema.libvirt.dom import config as configDom
class VMHardDisk(BaseModel):
model_config = ConfigDict(from_attributes=True)
@ -30,27 +29,27 @@ class StorageBlock(BaseModel):
size:int = Field()
vm_hard_disk:List[VMHardDisk] = Field()
class DiskDriver(vmVirt.DiskDriver):
class DiskDriver(configDom.DevicesDiskDriver):
name:str = Field(default="qemu")
type:vmVirt.DiskDriver.enumType = Field(default=vmVirt.DiskDriver.enumType.raw)
type:configDom.DevicesDiskDriver.enumType = Field(default=configDom.DevicesDiskDriver.enumType.raw)
class DiskAuthSecret(vmVirt.DiskAuthSecret):
type:vmVirt.DiskAuthSecret.enumType = Field(default=vmVirt.DiskAuthSecret.enumType.ceph)
class DiskAuthSecret(configDom.DevicesDiskAuthSecret):
type:configDom.DevicesDiskAuthSecret.enumType = Field(default=configDom.DevicesDiskAuthSecret.enumType.ceph)
class DiskAuth(vmVirt.DiskAuth):
class DiskAuth(configDom.DevicesDiskAuth):
secret:DiskAuthSecret = Field(default=DiskAuthSecret())
class DiskSourceHost(vmVirt.DiskSourceHost):
class DiskSourceHost(configDom.DevicesDiskSourceHost):
port:int = Field(default=6689)
class DiskSource(vmVirt.DiskSource):
protocol:vmVirt.DiskSource.enumProtocol = Field(default=vmVirt.DiskSource.enumProtocol.rbd)
class DiskSource(configDom.DevicesDiskSource):
protocol:configDom.DevicesDiskSource.enumProtocol = Field(default=configDom.DevicesDiskSource.enumProtocol.rbd)
class DiskTarget(vmVirt.DiskTarget):
class DiskTarget(configDom.DevicesDiskTarget):
bus:str = Field(default="virtio")
class Disk(vmVirt.Disk):
type:vmVirt.Disk.enumType = Field(default=vmVirt.Disk.enumType.network)
class Disk(configDom.DevicesDisk):
type:configDom.DevicesDisk.enumType = Field(default=configDom.DevicesDisk.enumType.network)
device:str = Field(default="disk")
driver:DiskDriver = Field(default=DiskDriver())
source:DiskSource = Field(default=DiskSource())