Closed pskun closed 2 years ago
增加创建任务、上传数据、查看任务状态、列出任务列表、删除任务五个接口: 一、创建任务: 发送请求: curl -X 'POST' \ 'http://192.168.190.2:5207/api/create_task/?task_name=iflytek&task_type=classification' \ -H 'accept: application/json' \ -d '' 返回结果:
curl -X 'POST' \ 'http://192.168.190.2:5207/api/create_task/?task_name=iflytek&task_type=classification' \ -H 'accept: application/json' \ -d ''
{ "ret_code": 200, "message": "task成功创建", "task_id": "iflytek_20221101105310" }
二、上传数据 发送请求 client = GTSEngineClient("192.168.190.2", "5207") client.upload_file(task_id="classification_20221101102810", local_data_path="/cognitive_comp/pankunhao/code/gts_teacher/datasets/GTS测试数据/tnews/labeled_sample.json") 返回结果
client = GTSEngineClient("192.168.190.2", "5207") client.upload_file(task_id="classification_20221101102810", local_data_path="/cognitive_comp/pankunhao/code/gts_teacher/datasets/GTS测试数据/tnews/labeled_sample.json")
{'ret_code': 200, 'message': '上传成功'}
三、查看任务状态 发送请求 curl -X 'POST' \ 'http://192.168.190.2:5207/api/check_task_status?task_id=iflytek_20221101105310' \ -H 'accept: application/json' \ -d '' 返回结果
curl -X 'POST' \ 'http://192.168.190.2:5207/api/check_task_status?task_id=iflytek_20221101105310' \ -H 'accept: application/json' \ -d ''
{ "ret_code": 0, "message": "Initialized" }
四、列出任务列表 发送请求 curl -X 'POST' \ 'http://192.168.190.2:5207/api/list_task/' \ -H 'accept: application/json' \ -d ''
curl -X 'POST' \ 'http://192.168.190.2:5207/api/list_task/' \ -H 'accept: application/json' \ -d ''
返回结果
{ "ret_code": 200, "message": "Success", "tasks": [ "classification_20221101102810", "classification_20221101102900", "iflytek_20221101105310" ] }
五、删除任务 发送请求 curl -X 'POST' \ 'http://192.168.190.2:5207/api/delete_task/?task_id=classification_20221101102810' \ -H 'accept: application/json' \ -d ''
curl -X 'POST' \ 'http://192.168.190.2:5207/api/delete_task/?task_id=classification_20221101102810' \ -H 'accept: application/json' \ -d ''
{ "ret_code": 200, "message": "Success" }
增加创建任务、上传数据、查看任务状态、列出任务列表、删除任务五个接口: 一、创建任务: 发送请求:
curl -X 'POST' \ 'http://192.168.190.2:5207/api/create_task/?task_name=iflytek&task_type=classification' \ -H 'accept: application/json' \ -d ''
返回结果:二、上传数据 发送请求
client = GTSEngineClient("192.168.190.2", "5207") client.upload_file(task_id="classification_20221101102810", local_data_path="/cognitive_comp/pankunhao/code/gts_teacher/datasets/GTS测试数据/tnews/labeled_sample.json")
返回结果三、查看任务状态 发送请求
curl -X 'POST' \ 'http://192.168.190.2:5207/api/check_task_status?task_id=iflytek_20221101105310' \ -H 'accept: application/json' \ -d ''
返回结果四、列出任务列表 发送请求
curl -X 'POST' \ 'http://192.168.190.2:5207/api/list_task/' \ -H 'accept: application/json' \ -d ''
返回结果
五、删除任务 发送请求
curl -X 'POST' \ 'http://192.168.190.2:5207/api/delete_task/?task_id=classification_20221101102810' \ -H 'accept: application/json' \ -d ''
返回结果