查询代码库的文件树。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
当前API暂无授权信息透出。
请求语法
GET /repository/{repositoryId}/files/tree
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 | 
|---|---|---|---|---|
| organizationId | string | 是 | 企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】 | 624666bd54d036291ae13a36 | 
| accessToken | string | 否 | 个人访问令牌。 使用阿里云 AK+SK 或使用 STS 临时授权方式不需要传该字段 | f0b1e61db5961df5975a93f9129d2513 | 
| repositoryId | long | 是 | 代码库 ID | 2851516 | 
| path | string | 否 | 代码仓库内的文件路径,获取该路径下的文件目录,默认获取代码库文件树的全部结构 | module | 
| refName | string | 否 | 分支名称、标签名称或 CommitID,默认为代码库库默认分支 | master / tag1.0 / sjjfssa | 
| type | string | 否 | 查找策略 DIRECT:仅展示当前目录下的内容 RECURSIVE:递归查找当前路径下的所有文件 FLATTEN:扁平化展示(如果是目录,递归查找,直到子目录包含文件或多个目录为止) | RECURSIVE | 
返回参数
示例
正常返回示例
JSON格式
{
  "requestId": "6557983C-FB08-51A9-AC5A-A7A0D0950A07",
  "errorMessage": "\"\"",
  "errorCode": "SYSTEM_UNKNOWN_ERROR",
  "success": true,
  "result": [
    {
      "path": "test-codeup",
      "isLFS": false,
      "id": "76c3f251f414ac31f2e01faf6f2008a9d756a437",
      "name": "test-codeup",
      "type": "blob",
      "mode": "100644"
    }
  ]
}错误码
| HTTP status code | 错误码 | 错误信息 | 描述 | 
|---|---|---|---|
| 403 | Forbidden.UserNotAdminOrOwner | The current user is not an admin or owner in the organization and is not authorized to perform the operation. | 当前用户非该企业管理员或拥有者,无权进行操作。 | 
| 403 | Forbidden.UserNotInCurrentOrganization | The user is not in the organization and is not authorized to perform the operation. | 当前用户不在该企业中,无权进行操作。 | 
访问错误中心查看更多错误码。
变更历史
| 变更时间 | 变更内容概要 | 操作 | 
|---|
暂无变更历史
