Obtaining the Last Commit Statistics of a Repository
Function
This API is used to obtain the last commit statistics of a repository.
URI
GET /v1/repositories/{repository_id}/statistics
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| repository_id | Yes | String | Explanation: Repository ID. Constraints: N/A Range: 1–2147483647 Default value: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| branch_name | Yes | String | Explanation: Branch name. Constraints: N/A Range: 1–2,000 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 | RepoCommitStatistics object | Explanation: Response result. Range: N/A |
| status | String | Explanation: Response status. Range:
|
| Parameter | Type | Description |
|---|---|---|
| code | String | Explanation: Error code. Range: Max. 100 characters in the error code format. |
| message | String | Explanation: Error message. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| all_branch_commits_count | Integer | Explanation: Total commits. Range: N/A |
| codelines | Array of RepoDailyCodeline objects | Explanation: Daily committed lines in last 15 days. Range: N/A |
| count | Integer | Explanation: Total commits in the corresponding repository. Range: N/A |
| event | RepoStatisticsEvent object | Explanation: Repository statistics status. Range: N/A |
| statistics | Array of RepoStatistics objects | Explanation: Repository statistics list. Range: N/A |
| total | Integer | Explanation: Total collects. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| additions | Integer | Explanation: Daily increased code lines. Range: N/A |
| date | String | Explanation: Date. Range: N/A |
| deletions | Integer | Explanation: Daily deleted code lines. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| branch | String | Explanation: Branch name. Range: N/A |
| created_at | String | Explanation: Repository statistics creation time. Range: N/A |
| date | String | Explanation: Repository statistics date. Range: N/A |
| id | Integer | Explanation: Repository statistical event ID. Range: N/A |
| project_id | Integer | Explanation: Repository ID Range: N/A |
| status | String | Explanation: Repository statistics status. Range:
|
| updated_at | String | Explanation: Repository statistics update time. Range: N/A |
| user_id | Integer | Explanation: User ID. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| add_lines | Integer | Explanation: Add code lines. |
| branch | String | Explanation: Branch name. Range: N/A |
| commit_count | Integer | Explanation: Number of commits. Range: N/A |
| created_at | String | Explanation: Repository statistics creation time. Range: N/A |
| delete_lines | Integer | Explanation: Deleted code lines. Range: N/A |
| id | Integer | Explanation: Repository statistics record ID. Range: N/A |
| project_id | Integer | Explanation: Repository ID. Range: N/A |
| updated_at | String | Explanation: Repository statistics update time. Range: N/A |
| user_name | String | Explanation: Username. Range: N/A |
Example Requests
None.
Example Responses
Status code: 200
OK
{
"result" : {
"event" : null,
"total" : 0,
"statistics" : [ ],
"all_branch_commits_count" : 1,
"count" : 1,
"codelines" : {
"additions" : 0,
"deletions" : 0,
"date" : "20191015"
}
},
"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.