Obtaining Files in a Branch Directory
Description
This API is used to obtain files in the branch directory.
URI
GET /v1/repositories/{repository_uuid}/branch/{branch_name}/sub-files
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
repository_uuid |
Yes |
String |
Repository ID |
|
branch_name |
Yes |
String |
Branch name |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
path |
No |
String |
File path |
|
offset |
No |
Integer |
Offset |
|
limit |
No |
Integer |
Number of records |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
error |
Error object |
Response error |
|
result |
LogsTreeList object |
Response result |
|
status |
String |
Response status |
|
Parameter |
Type |
Description |
|---|---|---|
|
trees |
Array of LogsTree objects |
File log tree |
|
total |
Integer |
Total number of records |
|
Parameter |
Type |
Description |
|---|---|---|
|
blob_id |
String |
Storage block ID |
|
commit |
Commit object |
Commit message |
|
file_name |
String |
File name |
|
file_path |
String |
File path |
|
md5 |
String |
MD5 |
|
type |
String |
Storage type |
|
Parameter |
Type |
Description |
|---|---|---|
|
author_email |
String |
Author email |
|
author_name |
String |
Author |
|
authored_date |
String |
Author commit time |
|
committed_date |
String |
Commit time |
|
committer_email |
String |
Committer email |
|
committer_name |
String |
Committer |
|
format |
Object |
File change details. The format is determined by the stat_format parameter. |
|
id |
String |
SHA ID of a commit |
|
message |
String |
Commit message |
|
parent_ids |
Array of strings |
Parent commit ID |
Request Examples
GET https://{endpoint}/v1/repositories/{repository_uuid}/branch/{branch_name}/sub-files
Response Examples
Status code: 200
Request succeeded
{
"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"
}
Status Codes
|
Status Codes |
Description |
|---|---|
|
200 |
Request succeeded |
Error codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot