server.web.routes.v2.cli.task ============================= .. py:module:: server.web.routes.v2.cli.task .. autoapi-nested-parse:: Routes for Tasks. Attributes ---------- .. autoapisummary:: server.web.routes.v2.cli.task.logger server.web.routes.v2.cli.task._task_instance_label_mapping server.web.routes.v2.cli.task._reversed_task_instance_label_mapping Functions --------- .. autoapisummary:: server.web.routes.v2.cli.task.get_task_status server.web.routes.v2.cli.task.get_task_subdag server.web.routes.v2.cli.task.update_task_statuses server.web.routes.v2.cli.task.get_task_dependencies server.web.routes.v2.cli.task.get_tasks_recursive server.web.routes.v2.cli.task.get_task_resource_usage server.web.routes.v2.cli.task._get_tasks_recursive server.web.routes.v2.cli.task._get_dag_and_wf_id server.web.routes.v2.cli.task._get_node_dependencies server.web.routes.v2.cli.task._get_subdag server.web.routes.v2.cli.task._get_tasks_from_nodes server.web.routes.v2.cli.task.get_downstream_tasks server.web.routes.v2.cli.task.get_task_details server.web.routes.v2.cli.task.get_task_details_viz Module Contents --------------- .. py:data:: logger .. py:data:: _task_instance_label_mapping .. py:data:: _reversed_task_instance_label_mapping .. py:function:: get_task_status() -> Any Get the status of a task. .. py:function:: get_task_subdag() -> Any Used to get the sub dag of a given task. It returns a list of sub tasks as well as a list of sub nodes. .. py:function:: update_task_statuses() -> Any Update the status of the tasks. .. py:function:: get_task_dependencies(task_id: int) -> Any Get task's downstream and upstream tasks and their status. .. py:function:: get_tasks_recursive(direction: str) -> Any Get all input task_ids'. Either downstream or upsteam tasks based on direction; return all recursive(including input set) task_ids in the defined direction. .. py:function:: get_task_resource_usage() -> Any Return the resource usage for a given Task ID. .. py:function:: _get_tasks_recursive(task_ids: Set[int], direction: jobmon.core.constants.Direction, session: sqlalchemy.orm.Session) -> set Get all input task_ids'. Either downstream or upsteam tasks based on direction; return all recursive(including input set) task_ids in the defined direction. .. py:function:: _get_dag_and_wf_id(task_id: int, session: sqlalchemy.orm.Session) -> tuple .. py:function:: _get_node_dependencies(nodes: set, dag_id: int, session: sqlalchemy.orm.Session, direction: jobmon.core.constants.Direction) -> Set[int] Get all upstream nodes of a node. :param nodes: set of nodes :type nodes: set :param dag_id: ID of DAG :type dag_id: int :param session: SQLAlchemy session :type session: Session :param direction: either up or down :type direction: Direction .. py:function:: _get_subdag(node_ids: list, dag_id: int, session: sqlalchemy.orm.Session) -> list Get all descendants of a given nodes. It only queries the primary keys on the edge table without join. :param node_ids: list of node IDs :type node_ids: list :param dag_id: ID of DAG :type dag_id: int :param session: SQLAlchemy sessions :type session: Session .. py:function:: _get_tasks_from_nodes(workflow_id: int, nodes: List, task_status: List, session: sqlalchemy.orm.Session) -> dict Get task ids of the given node ids. :param workflow_id: ID of the workflow :type workflow_id: int :param nodes: list of nodes :type nodes: list :param task_status: list of task statuses :type task_status: list :param session: SQLAlchemy session :type session: Session .. py:function:: get_downstream_tasks() -> Any Get only the direct downstreams of a task. .. py:function:: get_task_details(task_id: int) -> Any Get information about TaskInstances associated with specific Task ID. .. py:function:: get_task_details_viz(task_id: int) -> Any Get status of Task from Task ID.