Skip to content

Commit 3262cf6

Browse files
authored
Merge pull request #43 from ecmwf-projects/387-get-job
forward get job to compute api
2 parents 8356336 + c87751f commit 3262cf6

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

ogc_api_processes_fastapi/clients.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def get_jobs(self) -> List[models.StatusInfo]:
121121
"""
122122

123123
@abc.abstractmethod
124-
def get_job(self, job_id: str) -> models.StatusInfo:
124+
def get_job(self, job_id: str, response: fastapi.Response) -> models.StatusInfo:
125125
"""Get status information of the job identified by `job_id`.
126126
127127
Called with `GET /jobs/{job_id}`.
@@ -130,6 +130,8 @@ def get_job(self, job_id: str) -> models.StatusInfo:
130130
----------
131131
job_id : str
132132
Identifier of the job.
133+
response: fastapi.Response
134+
Response.
133135
134136
Returns
135137
-------

ogc_api_processes_fastapi/routers.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def make_links_to_job(
3535
Returns
3636
-------
3737
List[models.Link]
38-
Links to attach to jon
38+
Links to attach to job.
3939
"""
4040
rel_job_link = "self"
4141
title_job_link = None
@@ -292,11 +292,12 @@ def create_get_job_endpoint(
292292
operation_id="getJobStatus",
293293
)
294294
def get_job(
295-
request: fastapi.Request,
296295
job_id: str,
296+
request: fastapi.Request,
297+
response: fastapi.Response,
297298
) -> models.StatusInfo:
298299
"""Show the status of a job."""
299-
job = client.get_job(job_id=job_id)
300+
job = client.get_job(job_id=job_id, response=response)
300301
job.links = make_links_to_job(job=job, request=request)
301302

302303
return job

tests/conftest.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ def get_jobs(self) -> List[models.StatusInfo]:
7777
]
7878
return jobs_list
7979

80-
def get_job(
81-
self,
82-
job_id: str,
83-
) -> models.StatusInfo:
80+
def get_job(self, job_id: str, response: fastapi.Response) -> models.StatusInfo:
8481
status_info = models.StatusInfo(
8582
jobID=1, status=models.StatusCode.running, type=models.JobType.process
8683
)

0 commit comments

Comments
 (0)