diff --git a/deevirt_schema/api/cluster.py b/deevirt_schema/api/cluster.py index 2f68b1e..dc8f5c0 100644 --- a/deevirt_schema/api/cluster.py +++ b/deevirt_schema/api/cluster.py @@ -1,6 +1,6 @@ from typing import List, Optional import uuid -from pydantic import UUID4, BaseModel, ConfigDict, Field +from pydantic import UUID1, UUID4, BaseModel, ConfigDict, Field class Cluster(BaseModel): model_config = ConfigDict(from_attributes=True) @@ -8,5 +8,5 @@ class Cluster(BaseModel): id: UUID4 name: str compute_id: UUID4 - storage_id: UUID4 + storage_id: UUID1 network_switch_id: UUID4 \ No newline at end of file diff --git a/deevirt_schema/api/datacenter.py b/deevirt_schema/api/datacenter.py index 8440b91..400a5f1 100644 --- a/deevirt_schema/api/datacenter.py +++ b/deevirt_schema/api/datacenter.py @@ -26,4 +26,4 @@ class DatacenterCreate(BaseModel): id:Optional[UUID4] = Field(default_factory=lambda:uuid.uuid4()) name:str cluster_id:UUID4 - storage_pool_id:Optional[UUID4] \ No newline at end of file + storage_pool_id:Optional[UUID4] = Field(default=None) \ No newline at end of file diff --git a/deevirt_schema/api/storage.py b/deevirt_schema/api/storage.py index f05fe4d..df9849d 100644 --- a/deevirt_schema/api/storage.py +++ b/deevirt_schema/api/storage.py @@ -1,5 +1,6 @@ from typing import List, Optional -from pydantic import UUID4, BaseModel, ConfigDict, Field +from uuid import UUID +from pydantic import UUID1, UUID4, BaseModel, ConfigDict, Field from pydantic_xml import attr from ..libvirt.dom import config as configDom @@ -28,7 +29,7 @@ class StoragePool(BaseModel): class Storage(BaseModel): model_config = ConfigDict(from_attributes=True) - id:UUID4 = Field() + id:UUID1 = Field() name:str = Field() pool: Optional[List[StoragePool]] = Field(default=[], alias='storage_pool')