Obtaining Repository File Contents
Function
This API is used to obtain repository file contents.
URI
GET /v1/{project_id}/git/files/{namespace}/{project}/{path}
Table 1 describes the parameters.
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
project_id |
String |
Yes |
Tenant's project ID. |
namespace |
String |
Yes |
Namespace ID or URL code name. |
project |
String |
Yes |
Repository project ID or URL code name. If the value contains a slash (/), replace it with a colon (:). |
path |
String |
Yes |
File path. If the value contains a slash (/), replace it with a colon (:). |
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
ref |
String |
Yes |
Branch name, tag name, or commit SHA value. |
Request
Request parameters
None
Response
Response parameters
Parameter |
Type |
Description |
---|---|---|
path |
String |
File path. |
sha |
String |
Commit SHA value. |
encoding |
String |
Encoding mode. Value: base64 or text/plain. |
content |
String |
File contents. |
Example
Example request
None
Example response
{ "path": "string", "sha": "string", "encoding": "base64", "content": "string" }
Status Code
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
Error Code
Error code must be in the format of SVCSTG.REPO.[Error_ID]. Example: SVCSTG.REPO.0401. See ServiceStage 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