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 |
Repository primary key ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
branch_name |
Yes |
String |
Branch name. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
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 |
RepoCommitStatistics object |
Response result. |
status |
String |
Response status. |
Parameter |
Type |
Description |
---|---|---|
all_branch_commits_count |
Integer |
Total commits. |
codelines |
Array of RepoDailyCodeline objects |
Daily committed lines in last 15 days. |
count |
Integer |
Total commits in the corresponding repository. |
event |
RepoStatisticsEvent object |
Repository statistics status. |
statistics |
Array of RepoStatistics objects |
Repository statistics list. |
total |
Integer |
Total collects. |
Parameter |
Type |
Description |
---|---|---|
additions |
Integer |
Daily increased code lines. |
date |
String |
Date. |
deletions |
Integer |
Daily deleted code lines. |
Parameter |
Type |
Description |
---|---|---|
branch |
String |
Branch name. Minimum length: 1 Maximum length: 260 |
created_at |
String |
Repository statistics creation time. |
date |
String |
Repository statistics date. |
id |
Integer |
Repository statistical event ID. |
project_id |
Integer |
Repository ID. |
status |
String |
Repository statistical status: waiting, active, and finish. |
updated_at |
String |
Repository statistics update time. |
user_id |
Integer |
User ID. |
Parameter |
Type |
Description |
---|---|---|
add_lines |
Integer |
Add code lines. |
branch |
String |
Branch name. Minimum length: 1 Maximum length: 260 |
commit_count |
Integer |
Number of commits. |
created_at |
String |
Repository statistics creation time. |
delete_lines |
Integer |
Deleted code lines. |
id |
Integer |
Repository statistics record ID. |
project_id |
Integer |
Repository ID. |
updated_at |
String |
Repository statistics update time. |
user_name |
String |
Username. |
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 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.