Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Data Admin Service/ API Reference/ Deprecated APIs/ Obtaining the Space Analysis Data List

Obtaining the Space Analysis Data List

Updated on 2025-01-17 GMT+08:00

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.

URI

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

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

To obtain this value, see Obtaining a Project ID.

instance_id

Yes

String

Instance ID

Table 2 Query parameters

Parameter

Mandatory

Type

Description

object_type

Yes

String

Object type

Default value: database

Enumerated values:

  • database
  • table

database_id

No

String

Database ID

offset

No

String

Offset. If offset is set to N, the resource query starts from the N+1 piece of data. The value is 0 by default, indicating that the query starts from the first piece of data. The value must be a number but cannot be a negative number. The offset value must be an integer multiple of limit value.

Default value: 0.

limit

No

String

Number of records to be queried. The default value is 100. The value cannot be a negative number. The minimum value is 1 and the maximum value is 100.

Default value: 100

show_instance_info

No

String

Whether to return instance data. The value can be true or false.

Default value: true

datastore_type

Yes

String

Engine type

Enumerated values:

  • MySQL
  • TaurusDB
  • SQLServer

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token

X-Language

No

String

Language

Enumerated values:

  • zh-cn
  • en-us

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total

Long

Total number of records

db_objects

Array of DbObjectSpaceInfo objects

DB objects

instance_info

InstanceSpaceInfo object

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.

Table 5 DbObjectSpaceInfo

Parameter

Type

Description

object_type

String

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

Enumerated values:

  • database
  • table

object_name

String

Object name

object_id

String

Object ID

used_size

Long

Used space, in bytes

data_size

Long

Data space, in bytes

index_size

Long

Index space, in bytes

estimated_rows

Long

Number of estimated value rows, in bytes

Table 6 InstanceSpaceInfo

Parameter

Type

Description

total_size

Long

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

used_size

Long

Used space, in bytes

data_size

Long

Data space, in bytes

log_size

Long

Log space, in bytes

avg_daily_growth

Long

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

last_result_time

Long

Time when the last analysis result is generated, in milliseconds

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum length: 8 characters

Maximum length: 36 characters

error_msg

String

Error message

Minimum length: 2 characters

Maximum length: 512 characters

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum length: 8 characters

Maximum length: 36 characters

error_msg

String

Error message

Minimum length: 2 characters

Maximum length: 512 characters

Example Request

  • 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 Response

Status code: 200

Success

{
  "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

Success

400

Client error

500

Server error

Error Codes

See Error Codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback