Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/dstack/_internal/core/models/volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class Volume(CoreModel):
created_at: datetime
status: VolumeStatus
status_message: Optional[str] = None
deleted: bool
volume_id: Optional[str] = None # id of the volume in the cloud
provisioning_data: Optional[VolumeProvisioningData] = None
attachment_data: Optional[VolumeAttachmentData] = None
Expand Down
1 change: 1 addition & 0 deletions src/dstack/_internal/server/services/volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ def volume_model_to_volume(volume_model: VolumeModel) -> Volume:
created_at=volume_model.created_at.replace(tzinfo=timezone.utc),
status=volume_model.status,
status_message=volume_model.status_message,
deleted=volume_model.deleted,
volume_id=vpd.volume_id if vpd is not None else None,
provisioning_data=vpd,
attachment_data=vad,
Expand Down
7 changes: 7 additions & 0 deletions src/tests/_internal/server/routers/test_volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ async def test_lists_volumes_across_projects(self, test_db, session: AsyncSessio
"created_at": "2023-01-02T03:05:00+00:00",
"status": "submitted",
"status_message": None,
"deleted": False,
"volume_id": None,
"provisioning_data": None,
"attachment_data": None,
Expand All @@ -80,6 +81,7 @@ async def test_lists_volumes_across_projects(self, test_db, session: AsyncSessio
"created_at": "2023-01-02T03:04:00+00:00",
"status": "submitted",
"status_message": None,
"deleted": False,
"volume_id": None,
"provisioning_data": None,
"attachment_data": None,
Expand All @@ -104,6 +106,7 @@ async def test_lists_volumes_across_projects(self, test_db, session: AsyncSessio
"created_at": "2023-01-02T03:04:00+00:00",
"status": "submitted",
"status_message": None,
"deleted": False,
"volume_id": None,
"provisioning_data": None,
"attachment_data": None,
Expand Down Expand Up @@ -150,6 +153,7 @@ async def test_non_admin_cannot_see_others_projects(self, test_db, session: Asyn
"created_at": "2023-01-02T03:04:00+00:00",
"status": "submitted",
"status_message": None,
"deleted": False,
"volume_id": None,
"provisioning_data": None,
"attachment_data": None,
Expand Down Expand Up @@ -190,6 +194,7 @@ async def test_lists_volumes(self, test_db, session: AsyncSession):
"created_at": "2023-01-02T03:04:00+00:00",
"status": "submitted",
"status_message": None,
"deleted": False,
"volume_id": None,
"provisioning_data": None,
"attachment_data": None,
Expand Down Expand Up @@ -230,6 +235,7 @@ async def test_returns_volume(self, test_db, session: AsyncSession):
"created_at": "2023-01-02T03:04:00+00:00",
"status": "submitted",
"status_message": None,
"deleted": False,
"volume_id": None,
"provisioning_data": None,
"attachment_data": None,
Expand Down Expand Up @@ -282,6 +288,7 @@ async def test_creates_volume(self, test_db, session: AsyncSession):
"created_at": "2023-01-02T03:04:00+00:00",
"status": "submitted",
"status_message": None,
"deleted": False,
"volume_id": None,
"provisioning_data": None,
"attachment_data": None,
Expand Down