Querying the Submission Discrepancy Information of a Warehouse
Function
This API is used to query submission difference information based on commit id.
URI
GET /v2/projects/{repo_id}/repository/commits/{sha}/diff
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
repo_id |
Yes |
Integer |
Warehouse Short ID |
sha |
Yes |
String |
Commit ID, which is the branch name or tag name of the repository. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Specifies a user token. It can be obtained by calling an IAM API. 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 |
Array of DiffCommitInfo objects |
Difference List |
status |
String |
Status code in a response |
Parameter |
Type |
Description |
---|---|---|
old_path |
String |
File Path Before Change |
new_path |
String |
File Path After Change |
a_mode |
String |
File Mode Before Change |
b_mode |
String |
File Mode After Change |
new_file |
Boolean |
Whether a file is added for this change |
renamed_file |
Boolean |
Do you want to rename the file? |
deleted_file |
Boolean |
Indicates whether to delete files during the change. |
diff |
Boolean |
Difference Information |
Example Requests
GET https://{endpoint}/v2/projects/859341/repository/commits/master/diff
Example Responses
Status code: 200
OK
{ "result" : [ { "diff" : "@@ -1,4 +1,7 @@\n y_mr_0721\n+\n+! [CloudIDE run successfully] (./image/screenshot.PNG)\n+\n edwwd\n # css \n **hhrh**", "old_path" : "README.md", "new_path" : "README.md", "a_mode" : "100644", "b_mode" : "100644", "new_file" : false, "renamed_file" : false, "deleted_file" : false } ], "status" : "success" }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
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