Creating a Task for Parsing All SQL Statements
Function
This API is used to create a task for parsing all SQL statements.
URI
POST /v3/{project_id}/instances/{instance_id}/full-sql/add-task
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Explanation: Project ID of a tenant in a region To obtain this value, see Obtaining a Project ID. Constraints: N/A Values: The value can contain 32 characters. Only letters and digits are allowed. Default value: N/A |
instance_id |
Yes |
String |
Explanation: Unique ID of an instance Constraints: N/A Values: The value can contain 32 characters. Only letters and digits are allowed. Default value: N/A |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
datastore_type |
Yes |
String |
Explanation: DB engine type Constraints: N/A Values: N/A Default value: N/A |
node_id |
No |
String |
Explanation: Node ID Constraints: N/A Values: The value can contain 32 characters. Only letters and digits are allowed. Default value: N/A |
start_at |
Yes |
Long |
Explanation: Start time Constraints: Unix timestamp, in milliseconds Values: [0, 2^31-1]. The actual value depends on the query result. Default value: N/A |
end_at |
Yes |
Long |
Explanation: End time Constraints: Unix timestamp, in milliseconds Values: [0, 2^31-1]. The actual value depends on the query result. Default value: N/A |
user_list |
No |
Array of strings |
Explanation: Username list Constraints: The list can contain a maximum of 20 usernames. Values: N/A Default value: N/A |
keyword_list |
No |
Array of strings |
Explanation: Keyword list Constraints: The list can contain a maximum of 20 keywords. Values: N/A Default value: N/A |
db_list |
No |
Array of strings |
Explanation: Database list Constraints: The list can contain a maximum of 20 databases. Values: N/A Default value: N/A |
operation_list |
No |
Array of strings |
Explanation: Operation type list Constraints: The list can contain a maximum of 20 operation types. Values: N/A Default value: N/A |
thread_id_list |
No |
Array of strings |
Explanation: Thread ID list Constraints: The list can contain a maximum of 20 thread IDs. Values: N/A Default value: N/A |
status_list |
No |
Array of strings |
Explanation: Execution status list Constraints: N/A Values:
Default value: N/A |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
task_id |
Long |
Explanation: Task ID Values: N/A |
Example Request
POST https://das.cn-north-1.myhuaweicloud.com/v3/63be57f43e114de790a9735d1c5bc95d/instances/5c59fa7d6f09456b947f32922f9aeda1in01/full-sql/add-task { "datastore_type": "mysql", "node_id": "09ab88b8a12340569ac056af284011d9no01", "start_at": 1742815900000, "end_at": 1742819500000, "user_list": [ "a" ], "keyword_list": [ "b" ], "db_list": [ "c", "sdfssdff" ], "operation_list": [ "SELECT" ], "thread_id_list": [ "1" ], "status_list": [ "0" ] }
Example Response
Status code: 200
{ "task_id": 1 }
Status Codes
Status Code |
Description |
---|---|
200 |
Successful request |
400 |
Client error |
500 |
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