Skip to main content
检索与同步

查询任务状态

查询知识库导入任务的执行状态

GET
/api/v1/indices/rag/index_job/status
cURL
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。建议在提交导入任务后调用。

Authorizations

string
header
required

DashScope API Key,在控制台 API Key 页面(https://rag.console.aliyun.com/settings/apikey)获取。

Query Parameters

string
required

知识库 ID,对应创建知识库时返回的 pipelineId

length >= 1
string
required

导入任务 ID。提交导入任务接口的返回字段 ingestionId,也可在文档列表的 ingestion_id 字段中找到。index_idjob_id 必须同时传入,仅传 index_id 会返回 SystemError。

length >= 1

Response

200-application/json
string

响应码,成功时为 Success

integer

HTTP 状态码。

string

请求唯一标识,排查问题时请提供此 ID。

object