Skip to main content
PUT
索引代码仓库

权限

需要具备组织级 IndexOrgRepositories 权限的服务用户。

行为

此端点是幂等的——对同一代码仓库多次调用,不会创建重复的索引作业。它会为指定的代码仓库启用索引,并触发索引作业。 你还可以在请求体中选择性指定 branch_names,以索引特定分支。如果省略,则使用默认分支。

授权

Authorization
string
header
必填

服务用户凭据(前缀:cog_)

路径参数

repository_path
string
必填
org_id
string
必填

组织 ID(前缀:org-)

示例:

"org-abc123def456"

请求体

application/json
branch_names
string[]

响应

成功响应

branches
string[]
必填
indexing_enabled
boolean
必填
repository_path
string
必填
indexing_status
RepoIndexingStatusResponse · object | null