Querying Databases
Description
This API is used to query databases.
Constraints
- This API applies only to DDS Community Edition.
- This operation is not allowed if the DB instance is in any of the following statuses: creating, changing instance class, changing port, frozen, restarting, or abnormal.
URI
Name |
Type |
IN |
Mandatory |
Description |
---|---|---|---|---|
X-Auth-Token |
string |
header |
Yes |
User token obtained from IAM. For details, see Authentication. |
project_id |
string |
path |
Yes |
Project ID of a tenant in a region. To obtain the project ID, see Obtaining a Project ID. |
instance_id |
string |
path |
Yes |
Instance ID, which can be obtained by calling the API described in Querying Instances and Details. If you do not have an instance, call the API described in Creating a DB Instance to create one. |
offset |
Integer |
path |
No |
The index position. The value must be greater than or equal to 0. If this parameter is not transferred, the value is 0 by default. |
limit |
Integer |
path |
No |
Maximum records to be queried. The value ranges from 1 to 100. If this parameter is not transferred, the first 100 DB instances are queried by default. |
Requests
None
Responses
- Parameter description
Table 2 Response body parameters Name
Type
Description
databases
Array of objects
Database list. For details, see Table 3.
total_count
Integer
Total number.
Table 3 databases Name
Type
Description
name
String
Database name. The names of the config and admin databases are not displayed.
data_size
String
Used storage space, in GB. The value contains two decimal places. The used storage space refers to the size of the physical space occupied by data files, log files, and index files on the disk.
storage_size
String
Database logical size, in GB. The value contains two decimal places. The logical size refers to the size of data stored in a database, excluding the size of indexes and logs.
collection_num
Integer
The number of collections in a database.
- Response example
{ "databases" : [ { "name" : "dds-test", "data_size" : "3593", "storage_size" : "256", "collection_num" : "5" } ], "total_count" : 1 }
SDK
Click Document Database Service DDS SDK to download the SDK or view the SDK document. To learn how to install and authenticate an SDK, read the Usage section.
Status Code
For more information, see Status Code.
Error Code
For more information, see Error Code.
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