Queries the storage usage of a database instance for which Database Autonomy Service (DAS) Enterprise Edition V1 or V2 is enabled.
Operation description
For information about the database instances that support this operation, see Overview of DAS Enterprise Edition.
If you use an Alibaba Cloud SDK or DAS SDK to call this operation, we recommend that you use the latest version of the SDK.
If you use an SDK to call API operations of DAS, you must set the region ID to cn-shanghai.
This operation is applicable only to DAS Enterprise Edition V1 and V2.
We recommend that you call the DescribeSqlLogStatistic operation to query the data statistics of a database instance for which DAS Enterprise Edition is enabled.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
hdm:GetDasProServiceUsage |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| UserId |
string |
No |
The ID of the Alibaba Cloud account that is used to create the database instance. Note
This parameter is optional. The system can automatically obtain the account ID based on the value of InstanceId when you call this operation. |
196278346919**** |
| InstanceId |
string |
Yes |
The database instance ID. |
rm-2ze8g2am97624**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Message |
string |
The returned message. Note
If the request was successful, Successful is returned. If the request failed, an error message such as an error code is returned. |
Successful |
| RequestId |
string |
The request ID. |
7172BECE-588A-5961-8126-C216E16B**** |
| Data |
object |
The data returned. |
{ "storageFreeQuotaInMB": 5120, "ip": "rm-2ze8g2am97624****.mysql.****.com", "custinsId": 12448331, "userId": "196278346919****", "uuid": "hdm_b0ae36343407609bf3e8df8709d8****", "expireTime": 1924963200000, "instanceId": "rm-2ze8g2am97624****", "storageUsed": 10773752667393, "engine": "MySQL", "instanceAlias": "TESTDB01_PROD", "port": 3310, "vpcId": "hdm_****", "commodityInstanceId": "daspro-****", "startTime": 1606381940000, "isSpare": false, "region": "cn-shanghai", "serviceUnitId": "5", "sqlRetention": 30 } |
| storageFreeQuotaInMB |
number |
The SQL Explorer storage space that is offered free-of-charge. Unit: MB. |
5120 |
| ip |
string |
The endpoint of the database instance. |
rm-2ze8g2am97624****.mysql.****.com |
| userId |
string |
The ID of the Alibaba Cloud account that is used to create the database instance. |
196278346919**** |
| expireTime |
integer |
The point of time when DAS Enterprise Edition for the database instance expires. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. |
1648742400000 |
| instanceId |
string |
The database instance ID. |
rm-2ze8g2am97624**** |
| storageUsed |
integer |
The storage usage of SQL Explorer of the database instance. Unit: bytes. |
35903498 |
| engine |
string |
The type of the database engine. |
MySQL |
| instanceAlias |
string |
The name of the database instance. |
TESTDB01 |
| port |
integer |
The port number that is used to connect to the database instance. |
3306 |
| vpcId |
string |
The virtual private cloud (VPC) ID. |
vpc-2zentqj1sk4qmolci**** |
| commodityInstanceId |
string |
The ID of the DAS Enterprise Edition instance. |
daspro-cn-v0h1l6i**** |
| startTime |
integer |
The time when DAS Enterprise Edition was enabled for the database instance. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. |
1646100892000 |
| isSpare |
boolean |
Indicates whether DAS Enterprise Edition for the database instance has expired. Valid values:
|
false |
| region |
string |
The region in which the database instance resides. |
cn-shanghai |
| serviceUnitId |
string |
The service unit ID. |
4 |
| sqlRetention |
string |
The storage duration of SQL Explorer data. Unit: days. |
180 |
| migrationPredictRemainingTime |
integer |
The estimated remaining time for migrating the data generated by the SQL Explorer and Audit feature from the previous version to the new version. Unit: milliseconds. Note
This parameter is returned only when the SQL Explorer and Audit feature is migrated from the previous version to the new version. |
60000 |
| Code |
integer |
The HTTP status code returned. |
200 |
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
true |
Examples
Success response
JSON format
{
"Message": "Successful",
"RequestId": "7172BECE-588A-5961-8126-C216E16B****",
"Data": {
"storageFreeQuotaInMB": 5120,
"ip": "rm-2ze8g2am97624****.mysql.****.com",
"userId": "196278346919****",
"expireTime": 1648742400000,
"instanceId": "rm-2ze8g2am97624****",
"storageUsed": 35903498,
"engine": "MySQL",
"instanceAlias": "TESTDB01",
"port": 3306,
"vpcId": "vpc-2zentqj1sk4qmolci****",
"commodityInstanceId": "daspro-cn-v0h1l6i****",
"startTime": 1646100892000,
"isSpare": false,
"region": "cn-shanghai",
"serviceUnitId": "4",
"sqlRetention": "180",
"migrationPredictRemainingTime": 60000
},
"Code": 200,
"Success": true
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParams | The request parameters are invalid. | |
| 403 | NoPermission | You are not authorized to do this action. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.