获取分支目录下的文件
功能介绍
获取分支目录下的文件
URI
GET /v1/repositories/{repository_uuid}/branch/{branch_name}/sub-files
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| repository_uuid | 是 | String | 仓库id |
| branch_name | 是 | String | 分支名称 |
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| path | 否 | String | 文件路径 |
| offset | 否 | Integer | 偏移量 |
| limit | 否 | Integer | 记录数量 |
请求参数
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| X-Auth-Token | 是 | String | 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
响应参数
状态码: 200
| 参数 | 参数类型 | 描述 |
|---|---|---|
| error | Error object | 响应错误 |
| result | LogsTreeList object | 响应结果 |
| status | String | 响应状态 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| blob_id | String | 存储块id |
| commit | Commit object | 提交信息 |
| file_name | String | 文件名称 |
| file_path | String | 文件路径 |
| md5 | String | MD5 |
| type | String | 存储类型 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| author_email | String | 作者邮箱 |
| author_name | String | 作者 |
| authored_date | String | 作者提交时间 |
| committed_date | String | 提交时间 |
| committer_email | String | 提交作者邮箱 |
| committer_name | String | 提交作者 |
| format | Object | 文件变更的详情信息,其格式由请求查询参数 stat_format 决定 |
| id | String | 提交对应的SHA id |
| message | String | 提交的信息 |
| parent_ids | Array of strings | 父提交id |
请求示例
GET https://{endpoint}/v1/repositories/{repository_uuid}/branch/{branch_name}/sub-files 响应示例
状态码: 200
OK
{
"result" : {
"trees" : [ {
"blob_id" : "ef69ef5dc0c53022fe52a4d02de15f73d96e055c",
"file_name" : "csharpDemo.png",
"file_path" : "images/csharpDemo.png",
"md5" : "8830d25fe6b4e2cd14d75ddb5cae73a7",
"type" : "blob",
"commit" : {
"id" : "1cfd6d81fff948828c7f59bda74c0ef80e53def0",
"message" : "init",
"parent_ids" : [ ],
"author_name" : "repo",
"author_email" : "repo@test.com",
"committed_date" : "2019-11-13 11:29:26",
"committer_name" : "repo",
"committer_email" : "repo@test.com"
}
} ],
"total" : 5
},
"status" : "success"
} 状态码
| 状态码 | 描述 |
|---|---|
| 200 | OK |
错误码
请参见错误码。