From 5ccfeebaa85b42d7f5c3192993641e65fdf97eb4 Mon Sep 17 00:00:00 2001 From: cooper-lzy <78672629+cooper-lzy@users.noreply.github.com> Date: Mon, 18 Jul 2022 09:14:48 +0800 Subject: [PATCH 1/2] add api desc task --- .../workflow/workflow-api/api-desc-task.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 docs-2.0/nebula-explorer/workflow/workflow-api/api-desc-task.md diff --git a/docs-2.0/nebula-explorer/workflow/workflow-api/api-desc-task.md b/docs-2.0/nebula-explorer/workflow/workflow-api/api-desc-task.md new file mode 100644 index 00000000000..c2e82befb36 --- /dev/null +++ b/docs-2.0/nebula-explorer/workflow/workflow-api/api-desc-task.md @@ -0,0 +1,82 @@ +# 获取指定任务的运行结果 + +本文介绍如何使用工作流的 API 获取指定任务的运行结果。 + +## API 路径 + +`api-open/v1/jobs//tasks//sample_result` + +- ``:作业 ID。参见下文的请求参数。 + +- ``:任务 ID。参见下文的请求参数。 + +## 请求参数 + +### 路径参数 + +|参数|类型|是否必填|默认值|示例|说明| +|:---|:---|:---|:---|:---|:---| +|`job_id`|number|必填|-|`29987`|作业 ID。可以通过其他 API 查询到,或者在作业列表页面查看。| +|`task_id`|number|必填|-|`8c171f70fb6f11ecac7e6da0662c195b`|作业 ID。可以通过其他 API 查询到,或者在指定作业页面单击组件,在右上角查看。| + +### Headers 参数 + +|参数|类型|是否必填|默认值|示例|说明| +|:---|:---|:---|:---|:---|:---| +|`Content-Type`|string|必填|-|`application/json`|内容类型。| +|`explorer_token`|string|必填|-|`eyJhbxxx`|授权 Token,用于验证账号信息。如何获取授权 Token 请参见[工作流 API 概览](workflow-api-overview.md)。| + +### Body 参数 + +|参数|类型|是否必填|默认值|示例|说明| +|:---|:---|:---|:---|:---|:---| +|`limit`|number|必填|`10`|-|返回结果行数限制。| + +### 请求示例 + +```http +curl -i -X GET -H "Content-Type: application/json" -H "Cookie: "explorer_token=eyJhbxxx"" http://192.168.8.145:7002/api-open/v1/jobs/29987/tasks/8c171f70fb6f11ecac7e6da0662c195b/sample_result?limit=1000 +``` + +## 返回参数 + +|参数|类型|示例|说明| +|:---|:---|:---|:---| +|`code` | number | `0` | | +|`message` | string | `Success` | 执行结果信息。 | +|`data` | object | - | 返回的数据列表。 | +|    - `items`|list|-|详细结果列表。| +|       - `result` | string | `"player110","0.150000"` | 根据算法不同,结果可能是 2 列或 3 列。| + +### 返回示例 + +```http +{ + "cookie": [], + "Content-Type": "application/json", + "Traceparent": "00-14047b04b6810be06be22e010f500506-4c310a844b824a7f-00", + "Date": "Fri, 15 Jul 2022 09:36:56 GMT", + "Content-Length": "2014" +} +{ + "code": 0, + "data": { + "items": [ + [ + "player110", + "0.150000" + ], + [ + "team219", + "0.452126" + ], + ...... + [ + "player121", + "0.262148" + ] + ] + }, + "message": "Success" +} +``` \ No newline at end of file From c4d71437add981cef30ab61d9510bb305df3791f Mon Sep 17 00:00:00 2001 From: cooper-lzy <78672629+cooper-lzy@users.noreply.github.com> Date: Mon, 18 Jul 2022 09:51:43 +0800 Subject: [PATCH 2/2] Update api-desc-task.md --- .../nebula-explorer/workflow/workflow-api/api-desc-task.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs-2.0/nebula-explorer/workflow/workflow-api/api-desc-task.md b/docs-2.0/nebula-explorer/workflow/workflow-api/api-desc-task.md index c2e82befb36..514b3503c4c 100644 --- a/docs-2.0/nebula-explorer/workflow/workflow-api/api-desc-task.md +++ b/docs-2.0/nebula-explorer/workflow/workflow-api/api-desc-task.md @@ -23,7 +23,7 @@ |参数|类型|是否必填|默认值|示例|说明| |:---|:---|:---|:---|:---|:---| -|`Content-Type`|string|必填|-|`application/json`|内容类型。| +|`Content-Type`|string|必填|-|`application/x-www-form-urlencoded`|内容类型。| |`explorer_token`|string|必填|-|`eyJhbxxx`|授权 Token,用于验证账号信息。如何获取授权 Token 请参见[工作流 API 概览](workflow-api-overview.md)。| ### Body 参数 @@ -35,7 +35,7 @@ ### 请求示例 ```http -curl -i -X GET -H "Content-Type: application/json" -H "Cookie: "explorer_token=eyJhbxxx"" http://192.168.8.145:7002/api-open/v1/jobs/29987/tasks/8c171f70fb6f11ecac7e6da0662c195b/sample_result?limit=1000 +curl -i -X GET -H "Content-Type: application/x-www-form-urlencoded" -H "Cookie: "explorer_token=eyJhbxxx"" http://192.168.8.145:7002/api-open/v1/jobs/29987/tasks/8c171f70fb6f11ecac7e6da0662c195b/sample_result?limit=1000 ``` ## 返回参数 @@ -79,4 +79,4 @@ curl -i -X GET -H "Content-Type: application/json" -H "Cookie: "explorer_token=e }, "message": "Success" } -``` \ No newline at end of file +```