Skip to content

Commit 562ebff

Browse files
committed
polish endspoint exposed in api-server
1 parent 175ff33 commit 562ebff

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

services/api-server/src/simcore_service_api_server/_service_jobs.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,20 @@ async def start_log_export(
175175
)
176176
return async_job_get
177177

178-
async def delete_project_assets(self, project_id: ProjectID):
178+
async def delete_job_assets(
179+
self, solver_or_program: Solver | Program, project_id: ProjectID
180+
):
179181
"""Marks job project as hidden and deletes S3 assets associated it"""
180182
await self._web_rest_client.patch_project(
181183
project_id=project_id, patch_params=ProjectPatch(hidden=True)
182184
)
183185
await self._storage_rest_client.delete_project_s3_assets(
184186
user_id=self.user_id, project_id=project_id
185187
)
188+
await self._web_rpc_client.mark_project_as_job(
189+
product_name=self.product_name,
190+
user_id=self.user_id,
191+
project_uuid=project_id,
192+
job_parent_resource_name=solver_or_program.name,
193+
storage_data_deleted=True,
194+
)

services/api-server/src/simcore_service_api_server/api/routes/solvers_jobs.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,15 @@ async def delete_job_assets(
167167
version: VersionStr,
168168
job_id: JobID,
169169
job_service: Annotated[JobService, Depends(get_job_service)],
170+
solver_service: Annotated[SolverService, Depends(get_solver_service)],
170171
):
171-
await job_service.delete_project_assets(project_id=job_id)
172+
solver = await solver_service.get_solver(
173+
solver_key=solver_key,
174+
solver_version=version,
175+
)
176+
await job_service.delete_job_assets(
177+
job_parent_resource_name=solver.name, project_id=job_id
178+
)
172179

173180

174181
@router.post(

services/api-server/src/simcore_service_api_server/services_http/storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ async def delete_project_s3_assets(
290290
self, user_id: int, project_id: ProjectID
291291
) -> None:
292292
response = await self.client.delete(
293-
f"/locations/{self.SIMCORE_S3_ID}/folders/{project_id}",
293+
f"/simcore-s3/folders/{project_id}",
294294
params={"user_id": user_id},
295295
)
296296
response.raise_for_status()

0 commit comments

Comments
 (0)