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.
URI
GET /v3/{project_id}/instances/{instance_id}/space-analysis
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Explanation: Project ID of a tenant in a region To obtain this value, see Obtaining a Project ID. Constraints: N/A Values: The value can contain 32 characters. Only letters and digits are allowed. Default value: N/A |
instance_id |
Yes |
String |
Explanation: Unique ID of an instance Constraints: N/A Values: The value can contain 32 characters. Only letters and digits are allowed. Default value: N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
object_type |
Yes |
String |
Explanation: Object type Constraints: N/A Values:
Default value: N/A |
database_id |
No |
String |
Explanation: Database ID Constraints: This parameter is required only when object_type is set to table. Values: N/A Default value: N/A |
offset |
No |
String |
Explanation: 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 Values: [0, 2^31-1] Default value: 0: The query starts from the first data record. |
limit |
No |
String |
Explanation: Number of records to be queried. If this parameter is set to 10, a maximum of 10 records can be displayed. Constraints: N/A Values: [1, 100] Default value: 100 |
show_instance_info |
No |
String |
Explanation: Whether instance-level data is returned Constraints: N/A Values:
Default value: true |
datastore_type |
Yes |
String |
Explanation: DB engine type Constraints: N/A Values:
Default value: N/A |
Request Parameters
None
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
total |
Long |
Explanation: Total number of records. Values: N/A |
db_objects |
Array of DbObjectSpaceInfo objects |
Explanation: Database objects. Values: N/A |
instance_info |
InstanceSpaceInfo object |
Explanation: 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. Values: N/A |
Parameter |
Type |
Description |
---|---|---|
object_type |
String |
Explanation: Object type. If the object type is table, database_id must be transferred. Values:
|
object_name |
String |
Explanation: Object name Values: N/A |
object_id |
String |
Explanation: Object ID Values: N/A |
used_size |
Long |
Explanation: Used space, in bytes Values: N/A |
data_size |
Long |
Explanation: Data space, in bytes Values: N/A |
index_size |
Long |
Explanation: Index space, in bytes Values: N/A |
estimated_rows |
Long |
Explanation: Number of estimated rows, in bytes Values: N/A |
Parameter |
Type |
Description |
---|---|---|
total_size |
Long |
Explanation: Total instance space, in bytes The total space of a TaurusDB instance is not returned. Values: N/A |
used_size |
Long |
Explanation: Used space, in bytes Values: N/A |
data_size |
Long |
Explanation: Data space, in bytes Values: N/A |
log_size |
Long |
Explanation: Log space, in bytes Values: N/A |
avg_daily_growth |
Long |
Explanation: Average daily data growth in the last seven days, in bytes Values: N/A |
last_result_time |
Long |
Explanation: Time when the last analysis result was generated, in milliseconds Values: N/A |
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
Successful request
{ "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 request |
400 |
Client error |
500 |
Server error |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot