diff --git a/deevirt_schema/api/datacenter.py b/deevirt_schema/api/datacenter.py index 400a5f1..a8b32e5 100644 --- a/deevirt_schema/api/datacenter.py +++ b/deevirt_schema/api/datacenter.py @@ -13,7 +13,7 @@ class Datacenter(BaseModel): model_config = ConfigDict(from_attributes=True) company_id:UUID4 - id:UUID4 + id:Optional[UUID4] = Field(default_factory=uuid.uuid4) name:str cluster_id:UUID4 storage_pool_id:Optional[UUID4] diff --git a/deevirt_schema/api/network.py b/deevirt_schema/api/network.py index 33209f1..48bbb1a 100644 --- a/deevirt_schema/api/network.py +++ b/deevirt_schema/api/network.py @@ -1,5 +1,6 @@ from ipaddress import IPv4Address, IPv6Address from typing import List, Optional +from uuid import uuid4 from pydantic_xml import element, attr from pydantic import UUID4, BaseModel, ConfigDict, Field from pydantic_extra_types.mac_address import MacAddress @@ -12,14 +13,19 @@ class lsp(BaseModel): 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 ls(BaseModel): model_config = ConfigDict(from_attributes=True) + datacenter_id:Optional[UUID4] = Field(default=None) id:UUID4 = Field() name:str = Field() network_switch_port:Optional[List[lsp]] = Field(default=[]) -class lspCreate(BaseModel): - switch_id:UUID4 = Field(default=None) - id:Optional[UUID4] - mac_addr:Optional[str] = Field() \ No newline at end of file +class lsCreate(ls): + id:Optional[UUID4] = Field(default_factory=uuid4) + diff --git a/setup.py b/setup.py index cd49f2b..5fb2a6f 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import find_packages, setup setup( name='deevirt_schema', - version='0.1.30', + version='0.1.31', description='Deevirt Schema', url='https://git.celeonet.fr/Deevirt/deevirt_schema.git', author='Celeonet',