Help Center/ GaussDB/ API Reference/ APIs (Recommended)/ Data Storage Insights/ Querying the Storage Usage of Schemas in a Specified Database
Updated on 2025-12-26 GMT+08:00

Querying the Storage Usage of Schemas in a Specified Database

Function

This API is used to query the storage usage of schemas in a specified database. Before calling this API:

Debugging

You can debug this API in API Explorer.

URI

GET /v3.1/{project_id}/instances/{instance_id}/schema-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

Yes

String

Definition

Database name.

Constraints

N/A

Range

N/A

Default Value

N/A

schema_name

No

String

Definition

Schema name.

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

The value must be a non-negative integer.

Range

0–10000

Default Value

0

limit

No

Integer

Definition

Number of records returned by a query.

Constraints

The value cannot be a negative number.

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

Response Parameters

Table 4 Response body parameters

Parameter

Type

Description

schema_volumes

Array of objects

Storage usage of schemas in a database. For details, see Table 5.

total_count

Integer

Definition

Total number.

Range

N/A

Table 5 SchemaVolume

Parameter

Type

Description

schema_size

String

Definition

Schema size.

Range

N/A

table_count

String

Definition

Number of tables in a schema.

Range

N/A

user_name

String

Definition

Username of a schema.

Range

N/A

schema_name

String

Definition

Schema name.

Range

N/A

Example Request

Querying the storage usage of schemas in a specified database

GET https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3.1/3d39c18788b54a919bab633874c159dfin14/instances/3d39c18788b54a919bab633874c159dfin01/schema-volume?database_name=test_db

Example Response

{ 
    "schema_volumes": [
        {
            "schema_size": "28 MB",
            "table_count": "161",
            "user_name": "rdsAdmin",
            "schema_name": "pg_catalog"
        }
    ],
    "total_count": 1
}

Status Codes

Error Codes

For details, see Error Codes.