cURL
当知识库没有进行中的导入任务时,该接口可能返回
SystemError。建议在提交导入任务后调用。Authorizations
string
header
required
DashScope API Key,在控制台 API Key 页面 获取。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
查询知识库导入任务的执行状态
curl -G "https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/indices/rag/index_job/status" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-d "index_id=your_index_id" \
-d "job_id=your_job_id"{
"code": "Success",
"status_code": 200,
"data": {
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"ingestion_status": "COMPLETED",
"ingestion_message": "COMPLETED",
"total_count": 4,
"rows": [
{
"code": "FINISH",
"doc_id": "file_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxx",
"doc_name": "sample_document",
"doc_type": "pdf",
"size": 191166,
"status": "FINISH",
"message": "索引构建成功",
"ingestion_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"dataSync": false,
"canDelete": true,
"meta_extract_info": [],
"gmt_modified": 1782209511000
}
],
"page_number": 1,
"page_size": 10,
"started_at": 1782209506000,
"ended_at": 1782209512000,
"created_at": 1782209506000,
"updated_at": 1782209512000
},
"success": true,
"message": "success",
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "SUCCESS"
}SystemError。建议在提交导入任务后调用。DashScope API Key,在控制台 API Key 页面 获取。
知识库 ID,对应创建知识库时返回的 pipelineId。
导入任务 ID。提交导入任务接口的返回字段 ingestionId,也可在文档列表的 ingestion_id 字段中找到。index_id 和 job_id 必须同时传入,仅传 index_id 会返回 SystemError。
页码,从 1 开始,默认 1。任务含较多文档时可分页查询。
每页返回的文档数量,默认 10。
响应码,成功时为 Success。
HTTP 状态码。
请求唯一标识,排查问题时请提供此 ID。
Show child attributes
导入任务 ID。
任务整体状态:PENDING(等待中)、RUNNING(进行中)、COMPLETED(已完成)。
任务状态描述,通常与 ingestion_status 一致。
任务涉及的文档总数。任务进行中时可能为 0。
每个文档的处理详情。结构与查询文档列表接口的 rows 一致。
Show child attributes
文档 ID。
文档名称。
文档类型。
细粒度处理状态码,如 FINISH、PARSE_FAILED。
粗粒度处理状态。
处理状态描述。
文件大小(字节)。
所属导入任务 ID。
关联的连接器 ID,未使用连接器时为空字符串。
文件所属类目 ID。
文件所属类目名称。
文件标签,多个标签以逗号分隔。
该文件是否参与数据同步。
该文件是否可删除。
文件来源标识。
最后修改时间,Unix 毫秒时间戳。
元数据抽取结果。
当前页码。
每页数量。
任务开始时间(毫秒级 Unix 时间戳)。
任务结束时间(毫秒级 Unix 时间戳)。进行中时为 null。
任务创建时间(毫秒级 Unix 时间戳)。
任务最后更新时间(毫秒级 Unix 时间戳)。
请求是否成功。
提示信息,成功时为 success。
请求状态:SUCCESS 或 FAILED。
curl -G "https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/indices/rag/index_job/status" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-d "index_id=your_index_id" \
-d "job_id=your_job_id"{
"code": "Success",
"status_code": 200,
"data": {
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"ingestion_status": "COMPLETED",
"ingestion_message": "COMPLETED",
"total_count": 4,
"rows": [
{
"code": "FINISH",
"doc_id": "file_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxx",
"doc_name": "sample_document",
"doc_type": "pdf",
"size": 191166,
"status": "FINISH",
"message": "索引构建成功",
"ingestion_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"dataSync": false,
"canDelete": true,
"meta_extract_info": [],
"gmt_modified": 1782209511000
}
],
"page_number": 1,
"page_size": 10,
"started_at": 1782209506000,
"ended_at": 1782209512000,
"created_at": 1782209506000,
"updated_at": 1782209512000
},
"success": true,
"message": "success",
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "SUCCESS"
}