Querying SQL Patch Information
Function
This API is used to query SQL patch information. 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
GET /v3/{project_id}/instances/{instance_id}/sql-patch
| 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. The value of X-Subject-Token in the response header is the token value. 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 | Yes | String | Definition Node ID. Constraints N/A Range The value must contain 32 characters (including letters, digits, hyphens (-), or backslashes (\)), followed by no and then 14 or 20. Default Value N/A | 
| sql_id | Yes | String | Definition ID of the slow SQL statement. To obtain the value, see Querying Slow SQL Statements. Constraints N/A Range The value must consist of digits only and be 1 to 256 characters in length. Default Value N/A | 
| database_name | No | String | Definition Database name. This parameter is optional in slow SQL scenarios and mandatory in other scenarios. Constraints The name cannot be that of a template database. It must be an existing database name. Template databases include template0, template1. Range The value can contain 0 to 63 characters, including only letters, digits, underscores (_), and dollar signs ($). The value cannot start with a digit. Default Value N/A | 
Response Parameters
| Parameter | Type | Description | 
|---|---|---|
| patch_name | String | Definition Patch name. Range N/A | 
| hint | String | Definition Patch content (Hint text). Leave this field empty for ABORT SQL patches. Range N/A | 
| patch_status | String | Definition Patch status. Range 
 | 
Example Request
Querying SQL patch information
GET https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/0611f1bd8b00d5d32f17c017f15b599f/instances/d04686c6baae4f65a742771186f47b7ain14/sql-patch?node_id=d8e6ca5a624745bcb546a227aa3ae1cfin14&sql_id=28f61af50fc9452aa0ed5ea25c3cc3d3
Example Response
SQL patch information queried.
{
   "patch_name": "patch1",
   "hint": "indexscan(t1)",
   "patch_status": "enabled"
}
 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 
    