Help Center/ Data Admin Service/ API Reference/ Deprecated APIs/ Obtaining the Space Analysis Data List
Updated on 2026-01-20 GMT+08:00

Obtaining the Space Analysis Data List

Function

This API is used to obtain the space analysis data list. The file system generates instance-level data, and the information_schema.tables table generates database-level and table-level data. Space & Metadata Analysis allows you to analyze a maximum of 10,000 tables. If tablespace data is missing, there may be too many instance tables, or the account password has not been saved. If the password has not been saved, use the user management API or page to save the database account. This function is supported for MySQL, TaurusDB, and SQL Server.

Authorization Information

Each account has permissions to call all APIs, but IAM users must have the required permissions specifically assigned.

  • If you are using role/policy-based authorization, see the required permissions in Permissions Policies and Supported Actions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    das:clouddba:listSpaceAnalysis

    list

    Instance

    -

    -

    -

URI

GET /v3/{project_id}/instances/{instance_id}/space-analysis

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

To obtain this value, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 32 characters, including only letters and digits.

Default Value

N/A

instance_id

Yes

String

Definition

Unique ID of an instance

Constraints

N/A

Range

The value can contain 32 characters, including only letters and digits.

Default Value

N/A

Table 2 Query parameters

Parameter

Mandatory

Type

Description

object_type

Yes

String

Definition

Object type

Constraints

N/A

Range

  • database
  • table

Default Value

N/A

database_id

No

String

Definition

Database ID

Constraints

This parameter is required only when object_type is set to table.

Range

N/A

Default Value

N/A

offset

No

String

Definition

Index offset. The query starts from the next piece of data indexed by this parameter. If this parameter is set to 1 and limit is set to 10, only the second to eleventh records are displayed.

Constraints

N/A

Range

[0, 2^31-1]

Default Value

0: The query starts from the first data record.

limit

No

String

Definition

Number of records to be queried. If this parameter is set to 10, a maximum of 10 records can be displayed.

Constraints

N/A

Range

[1, 100]

Default Value

100

show_instance_info

No

String

Definition

Whether instance-level data is returned

Constraints

N/A

Range

  • true
  • false

Default Value

true

datastore_type

Yes

String

Definition

DB engine type

Constraints

N/A

Range

  • MySQL
  • TaurusDB
  • SQLServer

Default Value

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

total

Long

Definition

Total number of records.

Range

N/A

db_objects

Array of DbObjectSpaceInfo objects

Definition

Database objects.

Range

N/A

instance_info

InstanceSpaceInfo object

Definition

Instance storage usage. The data comes from the file system. The used space includes the data space, log space, and other space. Other space includes space for storing temporary files generated by the engine.

Range

N/A

Table 4 DbObjectSpaceInfo

Parameter

Type

Description

object_type

String

Definition

Object type. If the object type is table, database_id must be transferred.

Range

  • database
  • table

object_name

String

Definition

Object name

Range

N/A

object_id

String

Definition

Object ID

Range

N/A

used_size

Long

Definition

Used space, in bytes

Range

N/A

data_size

Long

Definition

Data space, in bytes

Range

N/A

index_size

Long

Definition

Index space, in bytes

Range

N/A

estimated_rows

Long

Definition

Number of estimated rows, in bytes

Range

N/A

Table 5 InstanceSpaceInfo

Parameter

Type

Description

total_size

Long

Definition

Total instance space, in bytes The total space of a TaurusDB instance is not returned.

Range

N/A

used_size

Long

Definition

Used space, in bytes

Range

N/A

data_size

Long

Definition

Data space, in bytes

Range

N/A

log_size

Long

Definition

Log space, in bytes

Range

N/A

avg_daily_growth

Long

Definition

Average daily data growth in the last seven days, in bytes

Range

N/A

last_result_time

Long

Definition

Time when the last analysis result was generated, in milliseconds

Range

N/A

Example Requests

  • Obtaining the database list
    GET https://das.cn-north-1.myhuaweicloud.com/v3/054e292c9880d4992f02c0196d3ea468/instances/fa7d0b6e40704cd48facf9889d6e745bin01/space-analysis?datastore_type=MySQL&object_type=database&show_instance_info=true&offset=0&limit=100
  • Obtaining the table list
    GET https://das.cn-north-1.myhuaweicloud.com/v3/054e292c9880d4992f02c0196d3ea468/instances/fa7d0b6e40704cd48facf9889d6e745bin01/space-analysis?datastore_type=MySQL&object_type=table&database_id=24937&show_instance_info=false&offset=0&limit=100

Example Responses

Status code: 200

Successful response

{
  "db_objects" : [ {
    "object_type" : "database",
    "object_name" : "db_01",
    "object_id" : "24937",
    "used_size" : 171687936,
    "data_size" : 129646592,
    "index_size" : 38895616
  }, {
    "object_type" : "database",
    "object_name" : "test_db",
    "object_id" : "24936",
    "used_size" : 84574208,
    "data_size" : 41484288,
    "index_size" : 38895616
  } ],
  "total" : 2,
  "instance_info" : {
    "total_size" : 42949672960,
    "used_size" : 2635862016,
    "data_size" : 256262144,
    "log_size" : 2100001252,
    "avg_daily_growth" : 86016,
    "last_result_time" : 1615323657065
  }
}

Status Codes

Status Code

Description

200

Successful response

400

Client error

500

Server error

Error Codes

See Error Codes.