Help Center/ CodeArts Repo/ API Reference/ APIs/ Repository/ Obtaining Warehouse Statistics
Updated on 2023-09-12 GMT+08:00

Obtaining Warehouse Statistics

Function

Obtaining Warehouse Statistics

URI

GET /v1/repositories/{repository_uuid}/statistic-data

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

repository_uuid

Yes

String

Specifies the repository ID.

Request Parameters

Table 2 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 3 Response body parameters

Parameter

Type

Description

error

Error object

Response error.

result

RepositoryStatisticsVO object

Result

status

String

Status code in a response

Table 4 Error

Parameter

Type

Description

code

String

Error Codes

message

String

Error message

Table 5 RepositoryStatisticsVO

Parameter

Type

Description

repoName

String

Repository name.

commitCount

Integer

Number of the commit times

repoSize

String

Repository capacity

lastCommitTime

String

Last Submission Time

codeLines

Integer

Indicates the number of code lines.

branchCount

Integer

Number of Branches

archiveUrl

String

Code Repository Download Address

Example Requests

GET https://{endpoint}/v1/repositories/{repository_uuid}/statistic-data

Example Responses

Status code: 200

OK

{
  "result" : {
    "repoName" : "repoName",
    "commitCount" : "111",
    "repoSize" : "0.26 MB",
    "lastCommitTime" : "2020-01-01 11:11:11",
    "codeLines" : "368965",
    "branchCount" : "222",
    "archiveUrl" : "https://devcloud.cn-north-7.ulanqab.huawei.com/repo/v1/repo/repository/2111663431/archive"
  },
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.