Exporting Full Data by SQL Statement
Function
This API is used to export full data by SQL statement. Before calling this API:
- Learn how to authenticate this API.
- Obtain the required region and endpoint.
Debugging
You can debug this API in API Explorer.
URI
POST /v3/{project_id}/instances/{instance_id}/list-full-sqls/export
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition Project ID of a tenant in a region. To obtain the value, see Obtaining a Project ID. Constraints N/A Range The value can contain 32 characters. Only letters and digits are allowed. Default Value N/A |
|
instance_id |
Yes |
String |
Definition Instance ID, which uniquely identifies an instance. Constraints N/A Range The value can contain 36 characters. Only letters and digits are allowed. Default Value N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition User token. You can obtain the token by calling the IAM API used to obtain a user token. After a response is returned, the value of X-Subject-Token in the response header is the token. Constraints N/A Range N/A Default Value N/A |
|
X-Language |
No |
String |
Definition Language. Constraints N/A Range
Default Value en-us |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
node_id |
No |
String |
Definition Node ID. Constraints N/A Range N/A Default Value N/A |
|
begin_time |
Yes |
String |
Definition Query start time. Constraints The value must use the format yyyy-mm-ddThh:mm:ssZ and conform to the ISO 8601 UTC standard. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. The plus sign (+) in the time zone must be URL-encoded to %2B, and the minus sign (-) in the time zone does not need to be encoded. For example, in the Beijing time zone, the time zone offset is shown as +0800 and the value (2024-03-15T17:20:33+0800) of begin_time needs to be encoded as 2024-03-15T17:20:33%2B0800. Range The time range from begin_time to end_time cannot exceed 30 days. Default Value N/A |
|
end_time |
Yes |
String |
Definition Query end time. Constraints The value must use the format yyyy-mm-ddThh:mm:ssZ and conform to the ISO 8601 UTC standard. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. The plus sign (+) in the time zone must be URL-encoded to %2B, and the minus sign (-) in the time zone does not need to be encoded. For example, in the Beijing time zone, the time zone offset is shown as +0800 and the value (2024-03-16T17:20:33+0800) of end_time needs to be encoded as 2024-03-16T17:20:33%2B0800. Range The time range from begin_time to end_time cannot exceed 30 days. Default Value N/A |
|
query |
No |
String |
Definition SQL text. Constraints N/A Range The value can contain 1 to 4,096 characters. Default Value N/A |
|
sql_id |
No |
String |
Definition Normalized SQL statement ID. Constraints N/A Range N/A Default Value N/A |
|
sql_exec_id |
No |
String |
Definition Unique SQL statement ID. Constraints N/A Range N/A Default Value N/A |
|
transaction_id |
No |
String |
Definition Transaction ID. Constraints N/A Range N/A Default Value N/A |
|
trace_id |
No |
String |
Definition Link ID. Constraints N/A Range N/A Default Value N/A |
|
db_name |
No |
String |
Definition Database name. Constraints N/A Range N/A Default Value N/A |
|
schema_name |
No |
String |
Definition Schema name. Constraints N/A Range N/A Default Value N/A |
|
username |
No |
String |
Definition Username. Constraints N/A Range N/A Default Value N/A |
|
client_addr |
No |
String |
Definition Client address. Constraints N/A Range N/A Default Value N/A |
|
client_port |
No |
String |
Definition Client port. Constraints N/A Range N/A Default Value N/A |
|
order_by |
No |
String |
Definition Sorting field. Constraints N/A Range begin_time: start time. Default Value begin_time |
|
is_slow_sql |
No |
Boolean |
Definition Whether the SQL statement is slow. Constraints N/A Range
Default Value N/A |
|
order |
No |
String |
Definition Sorting mode, which can be ascending or descending. Constraints N/A Range
Default Value DESC |
|
multi_queries |
No |
Array of objects |
Definition Query conditions for field aggregation. Default value: []. For details, see Table 4. Constraints Only all-AND or all-OR queries can be performed on the query field. |
|
compare_conditions |
No |
Array of objects |
Definition Combined comparison query condition. You can combine conditions such as range, greater than, and less than for a specified filter field. Default value: []. For details, see Table 5. Constraints N/A |
|
limit |
No |
Long |
Definition Maximum number of records returned by a query. For example, if this parameter is set to 10, a maximum of 10 records can be displayed. Constraints This parameter is deprecated in Huawei Cloud 25.5.0.1 and later. Do not set this parameter in these versions. A system parameter is used to control the maximum number of records that can be returned. The default value is 200. Range [1, 1000] Default Value 10 |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Definition Name of the field to be queried. Constraints Only the character string query is supported. Range 1 to 128 characters, including letters (case-sensitive), digits, and underscores (_) Default Value N/A |
|
condition |
Yes |
String |
Definition Combined condition. Constraints N/A Range The value can only be and, or, AND or OR. Default Value N/A |
|
values |
Yes |
Array of strings |
Definition Set of multiple search criteria. The value is a list of 1 to 5 characters. Constraints N/A |
|
is_fuzzy |
No |
Boolean |
Definition Set of multiple search criteria. Constraints The value can only be true for fuzzy query. Range
Default Value true |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Definition Query field name. Currently, only specified numeric fields are supported. Constraints N/A Range
Default Value N/A |
|
enable_equal |
No |
Boolean |
Definition Whether to include the Equal to condition. If this parameter value is set to true, the boundary values (for min and max) are included in the range condition. Constraints N/A Range
Default Value true |
|
min |
No |
Long |
Definition Value for evaluating the minimum threshold (greater-than condition). Constraints N/A Range [0, 2^63-1] Default Value N/A |
|
max |
No |
Long |
Definition Value for evaluating the maximum threshold (less-than condition). Constraints N/A Range [0, 2^63-1] Default Value N/A |
|
value |
No |
Long |
Definition Value for evaluating the equality threshold (equal-to condition). The value parameter has the highest priority. If value is not left blank, the settings for min and max are ignored. If value is left blank, the min and max filtering conditions are enabled. Constraints N/A Range [0, 2^63-1] Default Value N/A |
Response Parameters
None
Example Request
POST https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/4a89780fa1024361bcb855fed6aab89e/instances/cf9c879513144362bce2b3760ed81d3bin14/list-full-sqls/export
{
"begin_time": "2025-08-08T08:59:29+0000",
"end_time": "2025-08-08T09:59:29+0000",
"compare_conditions": [{
"name": "db_time",
"min": 474,
"max": 475,
"enable_equal": true
}
],
"multi_queries": [{
"name": "query",
"condition": "AND",
"is_fuzzy": true,
"values": ["select node_name", "from pg_catalog.pgxc_node"]
}
]
}
Example Response
None
Status Codes
- Normal
- Abnormal
For details, see Status Codes.
Error Codes
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