Help Center/ CodeArts Artifact/ API Reference/ API/ Repository Details/ Querying the Storage Capacity Trend
Updated on 2025-12-05 GMT+08:00

Querying the Storage Capacity Trend

Function

This API is used to query the storage capacity trend.

Calling Method

For details, see Calling APIs.

URI

GET /cloudartifact/v5/{tenant_id}/{project_id}/storageinfo/statistic

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

tenant_id

Yes

String

Definition

Tenant ID.

Constraints

The value can contain 8 to 32 characters. Only letters and digits are supported.

Range

N/A.

Default value

N/A.

project_id

Yes

String

Definition

Project ID, which can be obtained by calling an API or from the console. For details about how to obtain the project ID, see Obtaining a Project ID (CloudArtifact_api_0015.xml).

Constraints

The value contains 32 characters. Only letters and digits are supported.

Range

N/A.

Default value

None

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

repo

No

String

Definition

Repository ID. The format is {region}{domainId}{format}_{sequence}. You can find the repository ID on the general page of your self-hosted repos. It is the string located between the last two slashes (/) in the repository URL.

Constraints

The region and domainId in the repository ID must be valid values. The valid values of format are npm, go, pypi, rpm, composer, maven, debian, conan, nuget, docker2, cocoapods, and ohpm. The upper limit of sequence varies depending on the package.

Range

N/A.

Default value

None

start_time

No

String

Definition

Start time.

Constraints

yyyy-MM-dd format.

Range

N/A.

Default value

None

end_time

No

String

Definition

End time.

Constraints

yyyy-MM-dd format.

Range

N/A.

Default value

None

instance_id

No

String

Definition:

Instance ID. This parameter is no longer used.

Constraints

N/A.

Range

N/A.

Default value

N/A.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

status

String

Definition

Request status.

Range

success: The request is successful.

error: The request fails.

trace_id

String

Definition

Request ID, which uniquely identifies the current request.

Range

A string of digits and hyphens (-).

result

Array of StorageStatisticDO objects

Definition

Storage capacity data.

Range

N/A.

Table 4 StorageStatisticDO

Parameter

Type

Description

filesCount

Long

Definition

Total number of files.

Range

N/A.

usedSpaceLength

Long

Definition

Occupied space (in bytes).

Range

N/A.

usedSpace

String

Definition

Occupied space.

Range

N/A.

summaryDate

String

Definition

Statistics date.

Range

N/A.

foldersCount

Long

Definition

Total folders.

Range

N/A.

itemsCount

Long

Definition

Total number of files and folders.

Range

N/A.

Example Requests

This API is used to query the storage capacity trend.

https://artifact.example.myhuaweicloud.com/cloudartifact/v5/00000000000000000000000000000000/00000000000000000000000000000000/storageinfo/statistic?start_time=2023-11-22&end_time=2023-11-28&repo=xx-xxxxx-x_5a775fdcb14f4431b6c0015618140bc3_maven_1_108

Example Responses

Status code: 200

OK

{
  "status" : "success",
  "trace_id" : "143006-1701222420819-287",
  "result" : [ {
    "filesCount" : 2,
    "usedSpaceLength" : 1034390,
    "usedSpace" : "1,010.15 KB",
    "summaryDate" : "2023-11-22",
    "foldersCount" : null,
    "itemsCount" : null
  }, {
    "filesCount" : 2,
    "usedSpaceLength" : 1034390,
    "usedSpace" : "1,010.15 KB",
    "summaryDate" : "2023-11-23",
    "foldersCount" : null,
    "itemsCount" : null
  }, {
    "filesCount" : 2,
    "usedSpaceLength" : 1034390,
    "usedSpace" : "1,010.15 KB",
    "summaryDate" : "2023-11-24",
    "foldersCount" : null,
    "itemsCount" : null
  }, {
    "filesCount" : 2,
    "usedSpaceLength" : 1034390,
    "usedSpace" : "1,010.15 KB",
    "summaryDate" : "2023-11-25",
    "foldersCount" : null,
    "itemsCount" : null
  }, {
    "filesCount" : 2,
    "usedSpaceLength" : 1034390,
    "usedSpace" : "1,010.15 KB",
    "summaryDate" : "2023-11-26",
    "foldersCount" : null,
    "itemsCount" : null
  }, {
    "filesCount" : 4,
    "usedSpaceLength" : 2068780,
    "usedSpace" : "1.97 MB",
    "summaryDate" : "2023-11-27",
    "foldersCount" : null,
    "itemsCount" : null
  }, {
    "filesCount" : 0,
    "usedSpaceLength" : 0,
    "usedSpace" : "",
    "summaryDate" : "2023-11-28",
    "foldersCount" : null,
    "itemsCount" : null
  } ]
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.