This commit is contained in:
Mickael BOURNEUF 2024-10-16 10:38:53 +02:00
parent 83385dbabc
commit a2386b94d2
1 changed files with 19 additions and 31 deletions

View File

@ -37,19 +37,11 @@ class OSFirmwareFeature(BaseXmlModel, search_mode='ordered'):
enrolled_keys = "enrolled-keys" enrolled_keys = "enrolled-keys"
secure_boot = "secure-boot" secure_boot = "secure-boot"
enabled:YesNoEnum = attr(default=YesNoEnum.YES) enabled:YesNoEnum = attr(default=YesNoEnum.NO)
name:nameEnum = attr() name:nameEnum = attr()
class OSFirmware(BaseXmlModel, search_mode='ordered'): class OSFirmware(BaseXmlModel, search_mode='ordered'):
feature:List[OSFirmwareFeature] = element(default=[ feature:Optional[List[OSFirmwareFeature]] = element(default=None)
OSFirmwareFeature(
name=OSFirmwareFeature.nameEnum.enrolled_keys
),
OSFirmwareFeature(
name=OSFirmwareFeature.nameEnum.secure_boot
)
]
)
class OSLoader(BaseXmlModel, search_mode='ordered'): class OSLoader(BaseXmlModel, search_mode='ordered'):
class typeEnum(str, Enum): class typeEnum(str, Enum):
@ -84,17 +76,13 @@ class OS(BaseXmlModel, search_mode='ordered'):
bios = "bios" bios = "bios"
efi = "efi" efi = "efi"
firmware:Optional[firmwareEnum] = attr(default=firmwareEnum.efi) firmware:Optional[firmwareEnum] = attr(default=firmwareEnum.bios)
type:OSType = element(default=OSType()) type:OSType = element(default=OSType())
firmware_options:OSFirmware = element(tag="firmware", default=OSFirmware()) firmware_options:Optional[OSFirmware] = element(tag="firmware", default=None)
loader:OSLoader = element(default=OSLoader()) loader:Optional[OSLoader] = element(default=None)
nvram:Optional[str] = element(default="") nvram:Optional[str] = element(default=None)
boot:List[OSBoot] = element(default=[ boot:Optional[List[OSBoot]] = element(default=None)
OSBoot(dev="hd"), bootmenu:Optional[OSBootMenu] = element(default=None)
OSBoot(dev="cdrom"),
OSBoot(dev="network")
])
bootmenu:OSBootMenu = element(default=OSBootMenu())
smbios:OSSmbios = element(default=OSSmbios()) smbios:OSSmbios = element(default=OSSmbios())
class SysinfoEntry(BaseXmlModel, search_mode='ordered'): class SysinfoEntry(BaseXmlModel, search_mode='ordered'):
@ -134,11 +122,11 @@ class SysinfoOEMStrings(BaseXmlModel, search_mode='ordered'):
entry:List[SysinfoEntry] = element(default=None) entry:List[SysinfoEntry] = element(default=None)
class Sysinfo(BaseXmlModel, search_mode='ordered'): class Sysinfo(BaseXmlModel, search_mode='ordered'):
bios:SysinfoBIOS = element(default=SysinfoBIOS()) bios:Optional[SysinfoBIOS] = element(default=None)
system:Optional[SysinfoSystem] = element(default=SysinfoSystem()) system:Optional[SysinfoSystem] = element(default=SysinfoSystem())
baseBoard:Optional[SysinfoBaseBoard] = element(default=SysinfoBaseBoard()) baseBoard:Optional[SysinfoBaseBoard] = element(default=None)
chassis:Optional[SysinfoChassis] = element(default=SysinfoChassis()) chassis:Optional[SysinfoChassis] = element(default=None)
oemStrings:Optional[SysinfoOEMStrings] = element(default=SysinfoOEMStrings()) oemStrings:Optional[SysinfoOEMStrings] = element(default=None)
class VCPU(BaseXmlModel, search_mode='ordered'): class VCPU(BaseXmlModel, search_mode='ordered'):
class placementEnum(str, Enum): class placementEnum(str, Enum):
@ -336,8 +324,8 @@ class FeaturesKVM(BaseXmlModel, search_mode='ordered'):
class Features(BaseXmlModel, search_mode='ordered'): class Features(BaseXmlModel, search_mode='ordered'):
pae:str = element(default=None) pae:str = element(default=None)
acpi:str = element(default="enable") acpi:str = element(default="")
apic:str = element(default="enable") apic:str = element(default="")
hap:str = element(default=None) hap:str = element(default=None)
privnet:str = element(default=None) privnet:str = element(default=None)
kvm:FeaturesKVM = element(default=None) kvm:FeaturesKVM = element(default=None)
@ -375,8 +363,8 @@ class Clock(BaseXmlModel, search_mode='ordered'):
variable = "variable" variable = "variable"
absolute = "absolute" absolute = "absolute"
offset:offsetEnum = attr(default=offsetEnum.localtime) offset:Optional[offsetEnum] = attr(default=offsetEnum.utc)
timer:ClockTimer = element(default=None) timer:Optional[ClockTimer] = element(default=None)
class Perf(BaseXmlModel, search_mode='ordered'): class Perf(BaseXmlModel, search_mode='ordered'):
"""Not implemented""" """Not implemented"""
@ -402,10 +390,10 @@ class DevicesDiskAuthSecret(BaseXmlModel, search_mode='ordered'):
ceph = "ceph" ceph = "ceph"
type:typeEnum = attr(default=typeEnum.ceph) type:typeEnum = attr(default=typeEnum.ceph)
uuid:str = attr(default="1") uuid:UUID4 = attr(default=None)
class DevicesDiskAuth(BaseXmlModel, search_mode='ordered'): class DevicesDiskAuth(BaseXmlModel, search_mode='ordered'):
username:str = attr(default="1") username:str = attr()
secret:DevicesDiskAuthSecret = element(default=DevicesDiskAuthSecret()) secret:DevicesDiskAuthSecret = element(default=DevicesDiskAuthSecret())
class DevicesDiskSourceHost(BaseXmlModel, search_mode='ordered'): class DevicesDiskSourceHost(BaseXmlModel, search_mode='ordered'):
@ -687,7 +675,7 @@ class Dom(BaseXmlModel, tag='domain', search_mode='ordered'):
features:Features = element(default=Features()) features:Features = element(default=Features())
# Time keeping # Time keeping
clock:Clock = element(default=Clock()) clock:Optional[Clock] = element(default=None)
# Events configuration # Events configuration
on_poweroff:on_poweroffEnum = element(default=on_poweroffEnum.destroy) on_poweroff:on_poweroffEnum = element(default=on_poweroffEnum.destroy)