exam-manager.app.api.task_api ============================= .. py:module:: exam-manager.app.api.task_api .. autoapi-nested-parse:: Definition of exam API endpoints accessible through swagger UI. Attributes ---------- .. autoapisummary:: exam-manager.app.api.task_api.task_router Functions --------- .. autoapisummary:: exam-manager.app.api.task_api.create_task exam-manager.app.api.task_api.create_task_from_template exam-manager.app.api.task_api.get_task exam-manager.app.api.task_api.get_all_workflow_tasks exam-manager.app.api.task_api.get_all_task_templates exam-manager.app.api.task_api.delete_task exam-manager.app.api.task_api.update_task Module Contents --------------- .. py:data:: task_router .. py:function:: 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 :async: Create a new task. Parameters ---------- payload Task pydantic input model Returns ------- Task pydantic output model Raises ------ HTTPException 404: Creation unsuccessful .. py:function:: 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 :async: 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 .. py:function:: 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 :async: Get an existing task. Parameters ---------- task_id Id of the task to be returned Returns ------- Task pydantic output model Raises ------ HTTPException 404: Not found .. py:function:: 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] :async: Get all existing tasks of a certain workflow. Parameters ---------- workflow_id Id of parental workflow Returns ------- List of task pydantic output model .. py:function:: get_all_task_templates(user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) -> list[scanhub_libraries.models.AcquisitionTaskOut | scanhub_libraries.models.DAGTaskOut] :async: Get all existing task templates. Returns ------- List of task pydantic output model .. py:function:: delete_task(task_id: uuid.UUID | str, user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) -> None :async: Delete a task. Parameters ---------- task_id Id of the task to be deleted Raises ------ HTTPException 404: Not found .. py:function:: 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 :async: 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