Querying Whether SQL Explorer and Slow Query Log Are Enabled
Function
This API is used to query whether SQL Explorer and Slow Query Log are enabled. This function is available only for paid instances.
URI
GET /v3/{project_id}/instances/{instance_id}/sql/switch
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. To obtain this value, see Obtaining a Project ID. |
instance_id |
Yes |
String |
Instance ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
Fuction type. The value can be DAS SQL Explorer and DAS Slow Query Log. |
datastore_type |
Yes |
String |
Database type. Currently, SQL Explorer supports RDS for MySQL and GaussDB(for MySQL) databases, and Slow Query Log supports RDS for MySQL, GaussDB(for MySQL), and RDS for PostgreSQL databases. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. |
X-Language |
No |
String |
Request language type. The value can be:
|
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
status |
String |
Function status. The value can be Enabled, Disabled, or Switching. |
retention_days |
Long |
Number of days during which SQL data is retained. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. Minimum length: 8 Maximum length: 36 |
error_msg |
String |
Error message. Minimum length: 2 Maximum length: 512 |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. Minimum length: 8 Maximum length: 36 |
error_msg |
String |
Error message. Minimum length: 2 Maximum length: 512 |
Example Requests
Querying whether Slow Query Log is enabled
GET https://das.cn-north-1.myhuaweicloud.com/v3/054e292c9880d4992f02c0196d3ea468/instances/da304cd5bbb944de828759bc7be3d3fein01/sql/switch?type=DAS Slow Query Log&datastore_type=MySQL
Example Responses
Status code: 200
DAS status response body
{ "status" : "Enabled", "retention_days" : 7 }
Status Code
Status Code |
Description |
---|---|
200 |
DAS status response body. |
400 |
Client error. |
500 |
Server error. |
Error Code
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