跳转到主要内容
GET
/
beta
/
v2
/
enterprise
/
repositories
/
{org_id}
获取代码仓库索引状态
curl --request GET \
  --url https://api.devin.ai/beta/v2/enterprise/repositories/{org_id} \
  --header 'Authorization: Bearer <token>'
[
  {
    "name": "my-org/frontend-app",
    "indexing_enabled": true,
    "latest_index": {
      "created_at": "2024-09-08T00:30:00Z",
      "commit": "abc123def456",
      "status": "completed",
      "job_id": "job-789xyz"
    },
    "latest_completed_search_index_job": {
      "created_at": "2024-09-08T00:30:00Z",
      "commit": "abc123def456",
      "status": "completed",
      "job_id": "job-789xyz"
    },
    "latest_completed_wiki_index_job": null
  }
]
该接口返回与指定组织关联的所有代码仓库的当前索引状态。响应中包含每个代码仓库的索引任务信息、提交 SHA 值以及时间戳。

路径参数

org_id
string
required
要检查的仓库所属组织的唯一标识符

响应

返回一个包含仓库状态对象的数组。
name
string
required
仓库的完整名称,格式为 “owner/repo-name”
indexing_enabled
boolean
required
是否为此仓库启用索引
latest_index
object
关于此仓库最近一次索引任务的信息
latest_completed_search_index_job
object
关于最近一次已完成的搜索索引任务的信息
latest_completed_wiki_index_job
object
关于最近一次已完成的 wiki 索引任务的信息
[
  {
    "name": "my-org/frontend-app",
    "indexing_enabled": true,
    "latest_index": {
      "created_at": "2024-09-08T00:30:00Z",
      "commit": "abc123def456",
      "status": "completed",
      "job_id": "job-789xyz"
    },
    "latest_completed_search_index_job": {
      "created_at": "2024-09-08T00:30:00Z",
      "commit": "abc123def456",
      "status": "completed",
      "job_id": "job-789xyz"
    },
    "latest_completed_wiki_index_job": null
  }
]

状态值

  • pending - 仓库已排队等待建立索引
  • in_progress - 仓库正在建立索引
  • completed - 仓库已成功建立索引
  • failed - 仓库建立索引失败

错误响应

  • 403 - 无权访问该组织
  • 404 - 未找到该组织
  • 422 - 验证错误(org_id 格式无效)