Skip to content

Commit 80c2bb1

Browse files
committed
Add docstring to new run_path endpoint
1 parent 0445f1c commit 80c2bb1

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/ert/dark_storage/endpoints/experiment_server.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,14 @@ async def start_time(
266266
return Response(str(experiment.start_time_unix), status_code=200)
267267

268268

269-
@router.post(f"/{EverEndpoints.run_path}", dependencies=authenticated)
270-
async def run_path(
269+
@router.post(f"/{EverEndpoints.runpath}", dependencies=authenticated)
270+
async def check_runpath(
271271
paths: PathsCheckRequest,
272272
) -> Response:
273+
"""
274+
Check if any of the given paths (iteration directories) exists.
275+
Returns a 200 response if at least one path exists, 404 otherwise.
276+
"""
273277
exists = False
274278

275279
async with anyio.create_task_group() as tg:
@@ -284,8 +288,8 @@ async def _check_path(path: str) -> None:
284288
tg.start_soon(_check_path, path)
285289

286290
if exists:
287-
return Response("Run path exists", status_code=200)
288-
return Response("Run path does not exist", status_code=404)
291+
return Response("Runpath exists", status_code=200)
292+
return Response("Runpath does not exist", status_code=404)
289293

290294

291295
@router.websocket(f"/{EverEndpoints.events}/{{experiment_id}}")

src/everest/strings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ class EverEndpoints(StrEnum):
3434
experiments = "experiments"
3535
status = "status"
3636
events = "events"
37-
run_path = "run_path"
37+
runpath = "runpath"

0 commit comments

Comments
 (0)