Docs
api
Cloud Database(UDB)
DescribeUDBInstanceLog

Retrieve UDB error logs or slow query logs - DescribeUDBInstanceLog

Overview

Query the error logs or slow query logs of UDB within a certain period of time

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is DescribeUDBInstanceLog.Yes
PublicKeystringThe user’s public key can be obtained from ConsoleYes
SignaturestringUser signature generated based on public key and API command, see Signature AlgorithmYes

Request Parameters

Parameter NameTypeDescription InformationRequired
RegionstringRegion. See List of Regions and Availability ZonesYes
ZonestringAvailability Zone. See Availability Zone ListNo
ProjectIdstringProject ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the GetProjectList interface.No
DBIdstringInstance IDYes
BeginTimeintThe start timestamp (Unix Timestamp) of the queried logs. For real-time queries, this parameter should be the timestamp of the last polling request, and the backend will return the log content from this value to the current time.Yes
EndTimeintThe end timestamp (Unix Timestamp) for querying logs. This value is not passed for real-time queries, and the difference with BeginTime does not exceed 24 hours: (EndTime-BeginTime) < 246060Yes
LogTypestringTypes of query logs
error: Error log; slow: Slow log
Yes

Response Field

Field NameTypeDescription InformationRequired
RetCodeintReturn status code. If it is 0, it means successful return. If it is not 0, it means failure.Yes
ActionstringOperation command name.Yes
MessagestringReturns an error message, providing detailed description when RetCode is non-zero.No
LogstringThe content of the queried logs, a segment of plain text.No
NextTimestringThe next time of the logs queried this time, used for the BeginTime parameter of the next polling; if the log query ends, it will return to null, and the front end ends the query.No

Example

Request Example

http://api.dezai.com/?Action=DescribeUDBInstanceLog
&DBId=xxxxx
&BeginTime=1497262210
&EndTime=1497323400
&LogType=error

Response Example

{
  "Action": "DescribeUDBInstanceLogResponse",
  "Log": "",
  "NextTime": "1497323401",
  "RetCode": 0
}