Querying Database Storage Usage
Function
This API is used to query database storage usage. Before calling this API:
- Learn how to authenticate this API.
- Obtain the required region and endpoint.
Debugging
You can debug this API in API Explorer.
URI
GET /v3.1/{project_id}/instances/{instance_id}/database-volume
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition Project ID of a tenant in a region. To obtain the value, see Obtaining a Project ID. Constraints N/A Range The value can contain 32 characters. Only letters and digits are allowed. Default Value N/A |
|
instance_id |
Yes |
String |
Definition Instance ID, which uniquely identifies an instance. Constraints N/A Range The value can contain 36 characters. Only letters and digits are allowed. Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
database_name |
No |
String |
Definition Database name. Constraints N/A Range N/A Default Value N/A |
|
table_space_name |
No |
String |
Definition Default tablespace name of the database. Constraints N/A Range N/A Default Value N/A |
|
user_name |
No |
String |
Definition Username of a table. Constraints N/A Range N/A Default Value N/A |
|
offset |
No |
Integer |
Definition Index offset. The query starts from the next piece of data indexed by this parameter. Constraints N/A Range 0 - 10000 Default Value 0 |
|
limit |
No |
Integer |
Definition Number of records returned by a query. Constraints The value cannot be negative. Range 1–200 Default Value 100 |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition User token. You can obtain the token by calling the IAM API used to obtain a user token. After a response is returned, the value of X-Subject-Token in the response header is the token. Constraints N/A Range N/A Default Value N/A |
|
X-Language |
No |
String |
Definition Language. Constraints N/A Range
Default Value en-us |
Response Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
database_volumes |
Array of objects |
Definition Database storage usage list. For details, see Table 5. |
|
total_count |
Integer |
Definition Total number. Range N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
database_name |
String |
Definition Database name. Range N/A |
|
table_space_name |
String |
Definition Default tablespace name of the database. Range N/A |
|
user_name |
String |
Definition Username of a table. Range N/A |
|
database_size |
String |
Definition Database storage size. Range N/A |
Example Request
Querying database storage usage
GET https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3.1/3d39c18788b54a919bab633874c159dfin14/instances/3d39c18788b54a919bab633874c159dfin01/database-volume
Example Response
{
"database_volumes": [
{
"database_name": "postgres",
"table_space_name": "pg_default",
"user_name": "rdsAdmin",
"database_size": "708 MB"
}
],
"total_count": 1
}
Status Codes
- Normal
- Abnormal
For details, see Status Codes.
Error Codes
For details, 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