server.web.routes.v3.fsm.tool ============================= .. py:module:: server.web.routes.v3.fsm.tool .. autoapi-nested-parse:: Routes for Tools. Attributes ---------- .. autoapisummary:: server.web.routes.v3.fsm.tool.logger Functions --------- .. autoapisummary:: server.web.routes.v3.fsm.tool.add_tool server.web.routes.v3.fsm.tool.get_tool_versions server.web.routes.v3.fsm.tool.get_tool_resource_usage Module Contents --------------- .. py:data:: logger .. py:function:: add_tool(request: fastapi.Request, db: sqlalchemy.orm.Session = Depends(get_db)) -> Any :async: Add a tool to the database. .. py:function:: get_tool_versions(tool_id: int, request: fastapi.Request, db: sqlalchemy.orm.Session = Depends(get_db)) -> Any Get the Tool Version. .. py:function:: get_tool_resource_usage(tool_name: str, start_date: Optional[str] = None, end_date: Optional[str] = None, db: sqlalchemy.orm.Session = Depends(get_db)) -> Any Gets resource usage and node args for all TaskInstances associated with a given tool. We limit this to one week time spans to not overwhelm the database. :param tool_name: Name of the tool. :type tool_name: str :param start_date: The start date in 'YYYY-MM-DD' format (query parameter). :type start_date: str :param end_date: The end date in 'YYYY-MM-DD' format (query parameter). :type end_date: str :returns: A list of dictionaries containing TaskInstance ID, node argument value, TaskInstance maxrss, TaskInstance wallclock, and requested resources. :rtype: List[Dict[str, Any]] Example Call: /tool/large_wf_tool/tool_resource_usage?start_date=2024-07-11&end_date=2024-07-18 Example Response: [ { "node_arg_val": "--provenance True", "ti_id": 12345677, "ti_maxrss": 50844672, "ti_requested_resources": {"runtime": 21600, "memory": 10}, "ti_wallclock": 20 }, { "node_arg_val": "--intrinsic False", "ti_id": 12345678, "ti_maxrss": 43960320, "ti_requested_resources": {"runtime": 21600, "memory": 10}, "ti_wallclock": 22 } ]