exam-manager.app.api.task_api#
Definition of exam API endpoints accessible through swagger UI.
Attributes#
Functions#
|
Create a new task. |
Create a new task from template. |
|
|
Get an existing task. |
Get all existing tasks of a certain workflow. |
|
Get all existing task templates. |
|
|
Delete a task. |
|
Update an existing task. |
Module Contents#
- exam-manager.app.api.task_api.task_router#
- async exam-manager.app.api.task_api.create_task(payload: Annotated[scanhub_libraries.models.BaseAcquisitionTask | scanhub_libraries.models.BaseDAGTask, Field(discriminator='task_type')], user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) scanhub_libraries.models.AcquisitionTaskOut | scanhub_libraries.models.DAGTaskOut #
Create a new task.
Parameters#
- payload
Task pydantic input model
Returns#
Task pydantic output model
Raises#
- HTTPException
404: Creation unsuccessful
- async exam-manager.app.api.task_api.create_task_from_template(workflow_id: uuid.UUID, template_id: uuid.UUID, new_task_is_template: bool, user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) scanhub_libraries.models.AcquisitionTaskOut | scanhub_libraries.models.DAGTaskOut #
Create a new task from template.
Parameters#
- workflow_id
ID of the workflow, the task is related to
- template_id
ID of the template, the task is created from
- new_task_is_template
set the is_template property on the new task
Returns#
Task pydantic output model
Raises#
- HTTPException
404: Creation unsuccessful
- async exam-manager.app.api.task_api.get_task(task_id: uuid.UUID | str, user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) scanhub_libraries.models.AcquisitionTaskOut | scanhub_libraries.models.DAGTaskOut #
Get an existing task.
Parameters#
- task_id
Id of the task to be returned
Returns#
Task pydantic output model
Raises#
- HTTPException
404: Not found
- async exam-manager.app.api.task_api.get_all_workflow_tasks(workflow_id: uuid.UUID | str, user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) list[scanhub_libraries.models.AcquisitionTaskOut | scanhub_libraries.models.DAGTaskOut] #
Get all existing tasks of a certain workflow.
Parameters#
- workflow_id
Id of parental workflow
Returns#
List of task pydantic output model
- async exam-manager.app.api.task_api.get_all_task_templates(user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) list[scanhub_libraries.models.AcquisitionTaskOut | scanhub_libraries.models.DAGTaskOut] #
Get all existing task templates.
Returns#
List of task pydantic output model
- async exam-manager.app.api.task_api.delete_task(task_id: uuid.UUID | str, user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) None #
Delete a task.
Parameters#
- task_id
Id of the task to be deleted
Raises#
- HTTPException
404: Not found
- async exam-manager.app.api.task_api.update_task(task_id: uuid.UUID | str, payload: Annotated[scanhub_libraries.models.BaseAcquisitionTask | scanhub_libraries.models.BaseDAGTask, Field(discriminator='task_type')], user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) scanhub_libraries.models.AcquisitionTaskOut | scanhub_libraries.models.DAGTaskOut #
Update an existing task.
Parameters#
- task_id
Id of the workflow to be updated
- payload
Task pydantic base model
Returns#
Task pydantic output model
Raises#
- HTTPException
404: Not found