Querying SQL Execution Information
Function
This API is used to query SQL execution information.
Calling Method
For details, see Calling APIs.
URI
GET /v1/{project_id}/clusters/{cluster_id}/dms/queries/{query_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID. To obtain the value, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
| cluster_id | Yes | String | Definition Cluster ID. For details about how to obtain the value, see Obtaining the Cluster ID. Constraints The value must be a valid DWS cluster ID. Range It is a 36-digit UUID. Default Value N/A |
| query_id | Yes | String | Definition Query ID. Constraints N/A Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| ctime | No | Long | Definition Collection time, which is a timestamp. Constraints N/A Range N/A Default Value N/A |
Request Parameters
None
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Definition Response code. Range N/A |
| msg | String | Definition Response information. Range N/A |
| data | ListQueriesDto object | Definition Response data. Range N/A |
Example Requests
GET https://{Endpoint}/v1/{project_id}/clusters/{cluster_id}/dms/queries/{query_id}?ctime=1699062846000 Example Responses
Status code: 200
{
"code" : 0,
"msg" : "OK",
"data" : {
"ctime" : 1699062846000,
"pid" : "140535026615872",
"waiting" : false,
"duration" : 0,
"enqueue" : "",
"warning" : "",
"query" : "WLM fetch collect info from data nodes",
"lane" : "fast",
"priority" : null,
"virtual_cluster_id" : 0,
"inst_name" : "cn_5002",
"db_name" : "postgres",
"query_id" : "145522562959855061",
"query_band" : "",
"job_name" : "",
"job_inst" : "",
"user_name" : "Ruby",
"application_name" : "workload",
"client_address" : "",
"client_hostname" : "",
"client_port" : "",
"start_time" : 0,
"block_time" : 0,
"estimate_total_time" : 0,
"estimate_left_time" : 0,
"resource_pool" : "default_pool",
"control_group" : "",
"min_peak_memory" : 0,
"max_peak_memory" : 0,
"average_peak_memory" : 0,
"memory_skew_percent" : 0,
"estimate_memory" : 0,
"spill_info" : "",
"min_spill_size" : 0,
"max_spill_size" : 0,
"average_spill_size" : 0,
"spill_skew_percent" : 0,
"min_dn_time" : 0,
"max_dn_time" : 0,
"average_dn_time" : 0,
"dntime_skew_percent" : 0,
"min_cpu_time" : 0,
"max_cpu_time" : 0,
"total_cpu_time" : 0,
"cpu_skew_percent" : 0,
"average_peak_iops" : 0,
"iops_skew_percent" : 0,
"max_peak_iops" : 0,
"min_peak_iops" : 0,
"query_plan" : "",
"query_status" : "active",
"wlm_status" : "active",
"wlm_attrib" : "ordinary",
"system_query" : false,
"backend_start" : 0,
"elapsed_time" : 0,
"curr_xact_start" : 0,
"state_change" : 0,
"query_start" : 0,
"query_elapsed_time" : 0
}
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Query succeeded. |
| 400 | Request error. |
| 401 | Authentication failed. |
| 403 | You do not have required permissions. |
| 404 | No resources found. |
| 500 | Internal server error. |
| 503 | Service unavailable. |