This commit is contained in:
Mickael BOURNEUF 2024-12-01 13:13:27 +01:00
parent 9f32505843
commit d8a0ebcfe0
2 changed files with 16 additions and 9 deletions

View File

@ -9,14 +9,16 @@ class lsp(BaseModel):
model_config = ConfigDict(from_attributes=True)
id:UUID4 = Field()
mac_addr:str = Field()
mac_addr:Optional[str] = Field(default=None)
ipv4_addr:Optional[IPv4Address] = Field(default=None)
ipv6_addr:Optional[IPv6Address] = Field(default=None)
class lspCreate(BaseModel):
switch_id:UUID4 = Field(default=None)
id:Optional[UUID4]
mac_addr:Optional[str] = Field()
class lspCreate(lsp):
id:Optional[UUID4] = Field(default_factory=uuid4)
mac_addr:Optional[str] = Field(default=None)
class lspAttached(BaseModel):
id:UUID4 = Field()
class ls(BaseModel):
model_config = ConfigDict(from_attributes=True)
@ -27,5 +29,4 @@ class ls(BaseModel):
network_switch_port:Optional[List[lsp]] = Field(default=[])
class lsCreate(ls):
id:Optional[UUID4] = Field(default_factory=uuid4)
id:Optional[UUID4] = Field(default_factory=uuid4)

View File

@ -33,6 +33,13 @@ class Storage(BaseModel):
name:str = Field()
pool: Optional[List[StoragePool]] = Field(default=[], alias='storage_pool')
class StorageBlockCreate(BaseModel):
size:int = Field()
class StorageBlockAttached(BaseModel):
id:UUID4 = Field()
order:int = Field()
"""class DiskDriver(configDom.DevicesDiskDriver):
name:str = Field(default="qemu")
type:configDom.DevicesDiskDriver.typeEnum = Field(default=configDom.DevicesDiskDriver.typeEnum.raw)
@ -69,6 +76,5 @@ class DiskCreate(Disk):
class DiskAttached(BaseModel):
order:int = Field()"""
class BlockCreate(BaseModel):
size:int = Field()