Updated on 2025-12-26 GMT+08:00

Querying Database Storage Usage

Function

This API is used to query database storage usage. Before calling this API:

Debugging

You can debug this API in API Explorer.

URI

GET /v3.1/{project_id}/instances/{instance_id}/database-volume

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

To obtain the value, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 32 characters. Only letters and digits are allowed.

Default Value

N/A

instance_id

Yes

String

Definition

Instance ID, which uniquely identifies an instance.

Constraints

N/A

Range

The value can contain 36 characters. Only letters and digits are allowed.

Default Value

N/A

Table 2 Query parameters

Parameter

Mandatory

Type

Description

database_name

No

String

Definition

Database name.

Constraints

N/A

Range

N/A

Default Value

N/A

table_space_name

No

String

Definition

Default tablespace name of the database.

Constraints

N/A

Range

N/A

Default Value

N/A

user_name

No

String

Definition

Username of a table.

Constraints

N/A

Range

N/A

Default Value

N/A

offset

No

Integer

Definition

Index offset. The query starts from the next piece of data indexed by this parameter.

Constraints

N/A

Range

0 - 10000

Default Value

0

limit

No

Integer

Definition

Number of records returned by a query.

Constraints

The value cannot be negative.

Range

1–200

Default Value

100

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token.

You can obtain the token by calling the IAM API used to obtain a user token.

After a response is returned, the value of X-Subject-Token in the response header is the token.

Constraints

N/A

Range

N/A

Default Value

N/A

X-Language

No

String

Definition

Language.

Constraints

N/A

Range

  • zh-cn
  • en-us

Default Value

en-us

Response Parameters

Table 4 Response body parameters

Parameter

Type

Description

database_volumes

Array of objects

Definition

Database storage usage list. For details, see Table 5.

total_count

Integer

Definition

Total number.

Range

N/A

Table 5 DatabaseVolume

Parameter

Type

Description

database_name

String

Definition

Database name.

Range

N/A

table_space_name

String

Definition

Default tablespace name of the database.

Range

N/A

user_name

String

Definition

Username of a table.

Range

N/A

database_size

String

Definition

Database storage size.

Range

N/A

Example Request

Querying database storage usage

GET https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3.1/3d39c18788b54a919bab633874c159dfin14/instances/3d39c18788b54a919bab633874c159dfin01/database-volume

Example Response

{ 
    "database_volumes": [
        {
            "database_name": "postgres",
            "table_space_name": "pg_default",
            "user_name": "rdsAdmin",
            "database_size": "708 MB"
        }
    ],
    "total_count": 1
}

Status Codes

Error Codes

For details, see Error Codes.