Querying Database Error Logs
Function
This API is used to query error logs of an instance. Searching for error logs by keyword is not supported.
This API will be unavailable. You are advised to switch workloads to the new API Querying Error Logs of a GeminiDB Mongo Instance.
Constraints
This API supports GeminiDB Mongo instances.
The latest 2,000 error logs can be queried.
The past one month of error logs can be queried.
Authorization Information
Each account has permissions to call all APIs, but IAM users must have the required permissions specifically assigned.
- If you are using role/policy-based authorization, see the required permissions in Permissions and Supported Actions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
gaussdbfornosql:instance:listErrorLog
List
instance *
- g:ResourceTag/<tag-key>
- g:EnterpriseProjectId
nosql:instance:list
-
URI
GET /v3/{project_id}/instances/{instance_id}/error-log
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID of a tenant in a region. To obtain this value, see Obtaining a Project ID. Constraints N/A Range The value contains 32 characters. Only letters and digits are allowed. Default Value N/A |
| instance_id | Yes | String | Definition Instance ID. To obtain the value, call the Querying Instances and Details API. If no instance is available, call the Creating an Instance API to create one. Constraints N/A Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| start_time | Yes | String | Definition Start time for querying error logs. Constraints The start time cannot be 30 days earlier than the current time and cannot be the same as the end time. The value of end_time must be later than that of start_time. The value is in the yyyy-mm-ddThh:mm:ssZ format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. Range N/A Default Value N/A |
| end_time | Yes | String | Definition End time for querying error logs. Constraints The end time cannot be later than the current time and cannot be the same as the start time. The value of end_time must be later than that of start_time. The value is in the yyyy-mm-ddThh:mm:ssZ format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. Range N/A Default Value N/A |
| node_id | No | String | Definition Node ID. For details about the value, see field id in Table 11. Constraints N/A Range N/A Default Value If this parameter is not specified, all nodes in the instance can be queried. |
| type | No | String | Definition Statement type. Constraints N/A Range
Default Value If this parameter is not specified, all statement types are queried. |
| offset | No | Integer | Definition Index offset. The query starts from the next piece of data indexed by this parameter. Constraints The value must be a non-negative integer. Range [0,1999] Default Value 0: The query starts from the first data record. |
| limit | No | Integer | Definition Number of records returned by a query. Constraints The sum of limit and offset values must be less than or equal to 2000. Range [1,100] Default Value 10: 10 records are returned by default. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token You can obtain the token by calling the IAM API by following Obtaining a User Token Through Password Authentication. Constraints N/A Range N/A Default Value N/A |
Response Parameters
Status code: 202
| Parameter | Type | Description |
|---|---|---|
| total_count | Integer | Definition Total number of records. Range N/A |
| error_log_list | Array of Table 5 objects | Definition Error log information list. |
Example Requests
GET https://{Endpoint}/v3/375d8d8fad1f43039e23d3b6c0f60a19/instances/9136fd2a9fcd405ea4674276ce36dae8in10/error-log Example Responses
Status code: 202
Success
{
"error_log_list" : [ {
"node_name" : "Test_replica_node_2",
"level" : "WARNING",
"time" : "2020-12-15T08:53:01.868+0000",
"content" : "W NETWORK [LogicalSessionCacheReap] Unable to reach primary for set replica"
} ],
"total_count" : 1
} Status Codes
For details, see Status Codes.
Error Codes
For details, see Error Codes.
What is your overall rating for this page?
Thank 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