update
This commit is contained in:
parent
9b9617540c
commit
bb7b58e072
|
@ -4,8 +4,6 @@ from pydantic_xml import element, attr
|
||||||
from pydantic import UUID4, BaseModel, ConfigDict, Field
|
from pydantic import UUID4, BaseModel, ConfigDict, Field
|
||||||
from pydantic_extra_types.mac_address import MacAddress
|
from pydantic_extra_types.mac_address import MacAddress
|
||||||
|
|
||||||
from deevirt_common.lib.virt import vm as vmVirt
|
|
||||||
|
|
||||||
class lsp(BaseModel):
|
class lsp(BaseModel):
|
||||||
model_config = ConfigDict(from_attributes=True)
|
model_config = ConfigDict(from_attributes=True)
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
from typing import List
|
from typing import List
|
||||||
from pydantic_xml import element, attr
|
|
||||||
from pydantic import UUID4, BaseModel, ConfigDict, Field
|
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):
|
class VMHardDisk(BaseModel):
|
||||||
model_config = ConfigDict(from_attributes=True)
|
model_config = ConfigDict(from_attributes=True)
|
||||||
|
@ -30,27 +29,27 @@ class StorageBlock(BaseModel):
|
||||||
size:int = Field()
|
size:int = Field()
|
||||||
vm_hard_disk:List[VMHardDisk] = Field()
|
vm_hard_disk:List[VMHardDisk] = Field()
|
||||||
|
|
||||||
class DiskDriver(vmVirt.DiskDriver):
|
class DiskDriver(configDom.DevicesDiskDriver):
|
||||||
name:str = Field(default="qemu")
|
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):
|
class DiskAuthSecret(configDom.DevicesDiskAuthSecret):
|
||||||
type:vmVirt.DiskAuthSecret.enumType = Field(default=vmVirt.DiskAuthSecret.enumType.ceph)
|
type:configDom.DevicesDiskAuthSecret.enumType = Field(default=configDom.DevicesDiskAuthSecret.enumType.ceph)
|
||||||
|
|
||||||
class DiskAuth(vmVirt.DiskAuth):
|
class DiskAuth(configDom.DevicesDiskAuth):
|
||||||
secret:DiskAuthSecret = Field(default=DiskAuthSecret())
|
secret:DiskAuthSecret = Field(default=DiskAuthSecret())
|
||||||
|
|
||||||
class DiskSourceHost(vmVirt.DiskSourceHost):
|
class DiskSourceHost(configDom.DevicesDiskSourceHost):
|
||||||
port:int = Field(default=6689)
|
port:int = Field(default=6689)
|
||||||
|
|
||||||
class DiskSource(vmVirt.DiskSource):
|
class DiskSource(configDom.DevicesDiskSource):
|
||||||
protocol:vmVirt.DiskSource.enumProtocol = Field(default=vmVirt.DiskSource.enumProtocol.rbd)
|
protocol:configDom.DevicesDiskSource.enumProtocol = Field(default=configDom.DevicesDiskSource.enumProtocol.rbd)
|
||||||
|
|
||||||
class DiskTarget(vmVirt.DiskTarget):
|
class DiskTarget(configDom.DevicesDiskTarget):
|
||||||
bus:str = Field(default="virtio")
|
bus:str = Field(default="virtio")
|
||||||
|
|
||||||
class Disk(vmVirt.Disk):
|
class Disk(configDom.DevicesDisk):
|
||||||
type:vmVirt.Disk.enumType = Field(default=vmVirt.Disk.enumType.network)
|
type:configDom.DevicesDisk.enumType = Field(default=configDom.DevicesDisk.enumType.network)
|
||||||
device:str = Field(default="disk")
|
device:str = Field(default="disk")
|
||||||
driver:DiskDriver = Field(default=DiskDriver())
|
driver:DiskDriver = Field(default=DiskDriver())
|
||||||
source:DiskSource = Field(default=DiskSource())
|
source:DiskSource = Field(default=DiskSource())
|
||||||
|
|
Loading…
Reference in New Issue