Help Center> CodeArts Repo> API Reference> APIs> Repository> Obtains the last submission statistics of the warehouse.
Updated on 2023-12-04 GMT+08:00

Obtains the last submission statistics of the warehouse.

Function

Obtains the last submission statistics of the warehouse.

URI

GET /v1/repositories/{repository_id}/statistics

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

repository_id

Yes

String

Primary key ID of a warehouse.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

branch_name

Yes

String

Branch Name

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the 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

Table 4 Response body parameters

Parameter

Type

Description

error

Error object

Response error.

result

RepoCommitStatistics object

Result

status

String

Status code in a response

Table 5 Error

Parameter

Type

Description

code

String

Error Codes

message

String

Error message

Table 6 RepoCommitStatistics

Parameter

Type

Description

all_branch_commits_count

Integer

Total Warehouse Submission Times

codelines

Array of RepoDailyCodeline objects

Daily Submitted Code Lines in Last 15 Days

count

Integer

Total Submission Times of the Corresponding Branch Warehouse

event

RepoStatisticsEvent object

Warehouse Statistics Status

statistics

Array of RepoStatistics objects

Warehouse Statistics List

total

Integer

Warehouse Statistics Times

Table 7 RepoDailyCodeline

Parameter

Type

Description

additions

Integer

Add code lines every day.

date

String

Date

deletions

Integer

Deleting Code Lines Every Day

Table 8 RepoStatisticsEvent

Parameter

Type

Description

branch

String

Branch Name

Minimum: 1

Maximum: 260

created_at

String

Time when warehouse statistics are created.

date

String

Date when warehouse statistics are collected.

id

Integer

ID of a warehouse statistics event.

project_id

Integer

Specifies the repository ID.

status

String

Status of warehouse statistics: waiting for statistics collection, waiting for statistics collection, active statistics collection, and finish statistics collection.

updated_at

String

Time when warehouse statistics are updated.

user_id

Integer

Specifies the user ID.

Table 9 RepoStatistics

Parameter

Type

Description

add_lines

Integer

Add Code Line

branch

String

Branch Name

Minimum: 1

Maximum: 260

commit_count

Integer

Number of the commit times

created_at

String

Time when warehouse statistics are created.

delete_lines

Integer

Deleting Code Lines

id

Integer

Warehouse Statistics Record ID

project_id

Integer

Specifies the repository ID.

updated_at

String

Time when warehouse statistics are updated.

user_name

String

User Name

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.