You can call the DescribeResourceUsage operation to query the storage usage of an ApsaraDB RDS instance.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeResourceUsage |
The operation that you want to perform. Set the value to DescribeResourceUsage. |
DBInstanceId | String | Yes | rm-uf6wjk5xxxxxxx |
The ID of the instance. |
ResourceGroupId | String | No | rg-acfmy***** |
The ID of the resource group. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
BackupOssDataSize | Long | 8821760 |
The size of data backup files that are stored in Object Storage Service (OSS) buckets. Unit: bytes. The value 0 indicates no data backup files are stored in OSS buckets. |
DiskUsed | Long | 2337275904 |
The total storage that is occupied by data files and log files on the instance. Unit: bytes. The value -1 indicates that no data files or log files are stored on the instance. |
ArchiveBackupSize | Long | 0 |
The storage that is occupied by archived backup files on the instance. Unit: bytes. |
BackupOssLogSize | Long | 44180999 |
The size of log backup files that are stored in OSS buckets. Unit: bytes. The value 0 indicates no log backup files are stored in OSS buckets. |
BackupLogSize | Long | 45145563 |
The storage that is occupied by log backup files, excluding archived backup files, on the instance. Unit: bytes. |
BackupDataSize | Long | 94324736 |
The storage that is occupied by data backup files, excluding archived backup files, on the instance. Unit: bytes. |
ColdBackupSize | Long | 2337275904 |
The storage that is used to store cold backup files. Unit: bytes. The value -1 indicates that no cold backup files are stored. |
DataSize | Long | 1292094741 |
The storage that is used to store data files. Unit: bytes. The value -1 indicates that no data files are stored. |
PaidBackupSize | Long | 0 |
The backup storage for which you must pay. ApsaraDB RDS provides a free quota on backup storage. You must pay for the backup storage that exceeds the free quota. Unit: bytes. |
RequestId | String | F937E173-559C-4498-8D90-38D32342B9E4 |
The ID of the request. |
LogSize | Long | 1045181163 |
The storage that is used to store log files. Unit: bytes. The value -1 indicates that no log files are stored. |
BackupSize | Long | 53002759 |
The storage that is used to store backup files. Unit: bytes. The value -1 indicates that no backup files are stored. |
DBInstanceId | String | rm-uf6wjk5xxxxxxx |
The ID of the instance. |
Engine | String | MySQL |
The database engine that the instance runs. |
SQLSize | Long | 315052751 |
The storage that is occupied to execute SQL statements on the instance. Unit: bytes. The value -1 indicates that no SQL statements are executed. |
Examples
Sample requests
http(s)://rds.aliyuncs.com/?Action=DescribeResourceUsage
&DBInstanceId=rm-uf6wjk5xxxxxxx
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeResourceUsageResponse>
<PaidBackupSize>0</PaidBackupSize>
<RequestId>28E73580-103C-4925-A48D-9A7E25F24297</RequestId>
<BackupSize>51305057407</BackupSize>
<ArchiveBackupSize>0</ArchiveBackupSize>
<ColdBackupSize>-1</ColdBackupSize>
<LogSize>2097152</LogSize>
<BackupOssLogSize>48565375</BackupOssLogSize>
<DBInstanceId> rm-uf6wjk5xxxxxxx</DBInstanceId>
<BackupDataSize>51256492032</BackupDataSize>
<DataSize>3198156800</DataSize>
<BackupLogSize>48565375</BackupLogSize>
<BackupOssDataSize>0</BackupOssDataSize>
<SQLSize>446228522</SQLSize>
<DiskUsed>3200253952</DiskUsed>
<Engine>MySQL</Engine>
</DescribeResourceUsageResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"PaidBackupSize" : 0,
"RequestId" : "28E73580-103C-4925-A48D-9A7E25F24297",
"BackupSize" : 51305057407,
"ArchiveBackupSize" : 0,
"ColdBackupSize" : -1,
"LogSize" : 2097152,
"BackupOssLogSize" : "48565375",
"DBInstanceId" : " rm-uf6wjk5xxxxxxx",
"BackupDataSize" : 51256492032,
"DataSize" : 3198156800,
"BackupLogSize" : 48565375,
"BackupOssDataSize" : "0",
"SQLSize" : 446228522,
"DiskUsed" : 3200253952,
"Engine" : "MySQL"
}
Error codes
For a list of error codes, visit the API Error Center.