feat(diracx-api): add set_job_status#777
Conversation
056c907 to
cd46648
Compare
aldbr
left a comment
There was a problem hiding this comment.
Mostly based on the comments I gave in your other PR in dirac-cwl.
| """Set the status of a job. | ||
|
|
||
| :param job_id: Target Job ID | ||
| :type job_id: str |
There was a problem hiding this comment.
type is not necessary as you already specify the the type hint within the signature of the function.
|
|
||
| @with_client | ||
| async def set_job_status( | ||
| job_id: str, |
There was a problem hiding this comment.
I think job_id is expected to be an int
| job_id: str, | |
| job_id: int, |
| ) | ||
| result = await client.jobs.set_job_statuses(body, force=force) | ||
| if result.success: | ||
| logger.debug("Job statuses set successfully") |
There was a problem hiding this comment.
I guess it should be singular here.
| logger.debug("Job statuses set successfully") | |
| logger.debug("Job status set successfully") |
|
why not just calling the client directly ? There does not seem to be any added logic here ? |
|
@aldbr maybe we should be more explicit in docs/devs/explanations/components/api.md ? |
There is actually a very small piece of logic to create and add the timestamp to the request here https://github.com/DIRACGrid/diracx/pull/777/changes#diff-2d32214b7bab7d5a88d21308ad744235df705a7ff238ac879292c6b2a4a364c3R166-R167 In
Here I see 2 options for the new job wrapper:
Do you have any opinion? |
|
Note: I am closing this PR, we are going to work on the |
Adds the
set_job_statusfunction to set the status, minor status and application status of a job.Needed for issue DIRACGrid/dirac-cwl#83