mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-17 04:18:07 +00:00
Implement with_tasks option to expand the task information (#3343)
* Implement with_tasks option to expand the task information * Added tests * format
This commit is contained in:
@ -1308,14 +1308,16 @@ class Jobs(Endpoint):
|
||||
"DELETE", models.Job, data=requests.JobGet(job_id=job_id_expanded)
|
||||
)
|
||||
|
||||
def get(self, job_id: UUID_EXPANSION) -> models.Job:
|
||||
def get(self, job_id: UUID_EXPANSION, with_tasks: bool = False) -> models.Job:
|
||||
"""Get information about a specific job"""
|
||||
job_id_expanded = self._disambiguate_uuid(
|
||||
"job_id", job_id, lambda: [str(x.job_id) for x in self.list()]
|
||||
)
|
||||
self.logger.debug("get job: %s", job_id_expanded)
|
||||
job = self._req_model(
|
||||
"GET", models.Job, data=requests.JobGet(job_id=job_id_expanded)
|
||||
"GET",
|
||||
models.Job,
|
||||
data=requests.JobGet(job_id=job_id_expanded, with_tasks=with_tasks),
|
||||
)
|
||||
return job
|
||||
|
||||
|
Reference in New Issue
Block a user