Obtaining the Number of Committed Code Lines
Function
Obtain the number of committed code lines of a specified branch in the code repository on a specified date.
URI
GET /v3/repositories/{repository_id}/commit-lines
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| repository_id | Yes | Integer | Explanation: Repository ID. Constraints: N/A Range: 1–2147483647 Default value: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| ref_name | Yes | String | Explanation: Branch or tag name. Constraints: N/A Range: 1–2,000 Default value N/A |
| begin_date | Yes | String | Explanation: Start date of a commit. Constraints: Must be in the format of yyyy-MM-dd. Range: N/A Default value N/A |
| end_date | Yes | String | Explanation: End date of a commit. Constraints: Must be in the format of yyyy-MM-dd. Range: The interval between begin_date and end_date cannot exceed 60 days. Default value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Explanation: User token. It can be obtained by calling the corresponding Obtaining a User Token. The value of X-Subject-Token in the response header is the user token. Constraints: N/A Range: 1–100,000 characters. Default value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| error | Error object | Explanation: Response error code. Range: N/A |
| result | CommitStatistic object | Explanation: Number of added and deleted code lines. Range: N/A |
| status | String | Explanation: Response status. Range:
|
Example Requests
GET https://{endpoint}/v2/repositories/907199/commit-lines Example Responses
Status code: 200
OK
{
"result" : {
"additions" : 9,
"deletions" : 6
},
"status" : "success"
} Status Code
| 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.