Obtaining the Content of a Specified File in a Specified Branch of a Repository
Description
This API is used to obtain the content of a specified file in a specified branch of a repository.
URI
GET /v1/repositories/{repository_uuid}/branch/{branch_name}/file
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
repository_uuid |
Yes |
String |
Repository ID |
|
branch_name |
Yes |
String |
Branch name |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
path |
Yes |
String |
File path |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
No |
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 |
FilesResponseInfo object |
Response result |
|
status |
String |
Response status |
Request Examples
GET https://{endpoint}/v1/repositories/{repository_uuid}/branch/{branch_name}/file
Response Examples
Status code: 200
Request succeeded
{
"result" : [ {
"file_name" : "README.md",
"file_path" : "README.md",
"size" : 666,
"encoding" : "base64",
"ref" : "master",
"blob_id" : "75c19b5b1904a72c8a9959c98ae6884d0ace0279",
"file_type" : "text/plain; charset=utf-8",
"content" : "RUVFRUVFRUU="
} ],
"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