File indexing completed on 2026-04-09 07:58:21
0001
0002
0003 """
0004 Test client.
0005 """
0006
0007 import argparse
0008
0009
0010
0011
0012
0013
0014
0015
0016 from idds.common.constants import RequestStatus, ProcessingStatus
0017 import idds.common.utils as idds_utils
0018 import pandaclient.idds_api
0019
0020
0021 parser = argparse.ArgumentParser()
0022 parser.add_argument('--workflow_id', dest='workflow_id', action='store', help='Workflow to kill', required=True)
0023 parser.add_argument('--task_id', dest='task_id', action='store', help='Task to kill', required=False)
0024
0025
0026 def kill_workflow_task(idds_server, request_id, task_id=None):
0027 c = pandaclient.idds_api.get_api(idds_utils.json_dumps,
0028 idds_host=idds_server, compress=True, manager=True)
0029 if task_id is None:
0030 ret = c.abort(request_id=request_id)
0031 else:
0032 ret = c.abort_tasks(request_id=request_id, task_id=task_id)
0033
0034 print("Command is sent to iDDS: ", str(ret))
0035
0036
0037 if __name__ == '__main__':
0038 host = "https://aipanda015.cern.ch:443/idds"
0039
0040 args = parser.parse_args()
0041 kill_workflow_task(host, args.workflow_id, args.task_id)