Querying databases
Function
Querying databases
URI
GET /v2/{project_id}/audit/{instance_id}/databases
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
** Parameter description**: Specifies the project ID. You can obtain the value by calling the IAM API for querying the project list of a specified IAM user. ** Restrictions**: N/A ** Value range**: The value is subject to the return value of the IAM service interface. The value contains 32 to 64 characters. ** Default value**: N/A |
instance_id |
Yes |
String |
Definition: Instance ID. The value can be obtained from the ID field of the API for querying the instance list. ** Restrictions**: N/A Range: The value is subject to the value of the API for querying the instance list. The value contains 32 to 64 characters. ** Default value**: N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
status |
No |
String |
Instance Status
|
offset |
No |
String |
Definition: Pagination offset. The query starts from the next piece of data indexed by this parameter. ** Restrictions**: Only integers greater than or equal to 0 are supported. Range: Greater than or equal to 0 ** Default value**: The default value is 0. |
limit |
No |
String |
Definition: Number of records queried on each page. ** Restrictions**: Only integers greater than 0 are supported. Range: Greater than 0 and less than or equal to 10000 ** Default value**: The default value is 100. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
** Parameter description**: User token. You can obtain the token by calling the IAM API used to query the user token. The token is the value of X-Subject-Token in the response header. ** Restrictions**: N/A ** Value range**: Used by the IAM service to query the user token. ** Default value**: N/A |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
databases |
Array of DataBaseBean objects |
Database list |
total |
Integer |
Total number of license files |
Parameter |
Type |
Description |
---|---|---|
id |
String |
The database record ID. |
name |
String |
Database name |
type |
String |
Type of the database to be added. The value can be:
|
version |
String |
DB Version |
charset |
String |
Database character sets
|
ip |
String |
Database IP address |
port |
String |
Database Port |
os |
String |
Database OS |
status |
String |
Instance Status
|
instance_name |
String |
Database instance |
audit_status |
String |
Database status. The value can be:
|
agent_url |
Array of strings |
Unique ID of an agent |
db_classification |
String |
Database classification. The value can be:
|
rds_audit_switch_mismatch |
Boolean |
The audit switch status of the RDS instance does not match. When the database audit function is enabled and the log upload function on RDS is disabled, the value of this field is true. |
rds_id |
String |
ID of the RDS database. |
rds_obj_info |
String |
RDS database information. |
dws_obj_info |
String |
GaussDB(DWS) database information. |
clouddb_obj_info |
String |
Cloud database information. This field has been discarded. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
details |
Array of DbssErrorDetail objects |
PDP5 authentication exception information |
encoded_authorization_message |
String |
PDP5 authentication exception information |
error_code |
String |
Error Codes |
error_msg |
String |
Error message. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error Codes |
error_msg |
String |
PDP5 error information |
Status code: 403
Parameter |
Type |
Description |
---|---|---|
details |
Array of DbssErrorDetail objects |
PDP5 authentication exception information |
encoded_authorization_message |
String |
PDP5 authentication exception information |
error_code |
String |
Error Codes |
error_msg |
String |
Error message. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error Codes |
error_msg |
String |
PDP5 error information |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
details |
Array of DbssErrorDetail objects |
PDP5 authentication exception information |
encoded_authorization_message |
String |
PDP5 authentication exception information |
error_code |
String |
Error Codes |
error_msg |
String |
Error message. |
Example Requests
/v2/{project_id}/audit/{instance_id}/databases
Example Responses
Status code: 200
Success
{ "databases" : [ { "database" : { "charset" : "UTF8", "clouddb_obj_info" : null, "db_classification" : "ECS", "dws_obj_info" : null, "id" : "twS8v5gBhN3UjKKcoyJ6", "instance_name" : null, "ip" : "10.0.2.3", "name" : "pgtest", "port" : "5300", "rds_audit_switch_mismatch" : false, "rds_id" : null, "rds_obj_info" : null, "status" : false, "type" : "POSTGRESQL", "version" : "7.4" } }, { "database" : { "charset" : "GBK", "clouddb_obj_info" : null, "db_classification" : "ECS", "dws_obj_info" : null, "id" : "4YF4Y5gBzqyXNYgsjgsC", "instance_name" : null, "ip" : "122.24.4.52", "name" : "Tewensente", "port" : "1", "rds_audit_switch_mismatch" : false, "rds_id" : null, "rds_obj_info" : null, "status" : false, "type" : "MYSQL", "version" : "5.0" } } ], "total" : 2 }
Status Codes
Status Code |
Description |
---|---|
200 |
Success |
400 |
Incorrect request parameter. |
403 |
Authorization failed. |
500 |
Internal 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