Queries the error logs of an ApsaraDB for MongoDB instance.
Operation description
This operation is applicable to instances of the general-purpose local-disk and dedicated local-disk specification types.
This operation is limited to 30 calls per minute. If this limit is exceeded, the calls are throttled. Do not call this operation at a high frequency. If you need to call this operation at a high frequency, use a Logstore. For more information, see Manage a Logstore.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dds:DescribeErrorLogRecords |
get |
*dbinstance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBInstanceId |
string |
Yes |
The instance ID. Note
If you set this parameter to the ID of a sharded cluster instance, you must also specify the NodeId parameter. |
dds-bp12c5b040dc**** |
| NodeId |
string |
No |
Instance ID of the mongos or shard node in the sharded cluster instance. Note
This parameter is valid only when the DBInstanceId parameter is set to instance ID of a sharded cluster instance. |
d-bp128a003436**** |
| RoleType |
string |
No |
The role of the node in the instance. Valid values:
Note
If the NodeId parameter is set to the ID of a mongos node, the value of this parameter can only be primary. |
primary |
| StartTime |
string |
Yes |
The beginning of the time range to query. Specify the time in the yyyy-MM-ddTHH:mmZ format (UTC). |
2019-01-01T12:10Z |
| EndTime |
string |
Yes |
The end of the time range to query. The end time must be later than the start time, and the interval between the start time and the end time cannot exceed one day. Specify the time in the yyyy-MM-ddTHH:mmZ format (UTC). |
2019-01-02T12:10Z |
| DBName |
string |
No |
The name of the database. |
mongodbtest |
| PageSize |
integer |
No |
The number of entries per page. Valid values: 30 to 100. |
30 |
| PageNumber |
integer |
No |
The page number. The value must be a positive integer that does not exceed the maximum value of the Integer data type. Default value: 1. |
1 |
| ResourceGroupId |
string |
No |
The resource group ID. For more information about resource groups, see View basic information of a resource group. |
rg-acfmyiu4ekp**** |
| QueryKeywords |
string |
No |
The query keywords. Separate multiple keywords with spaces. A maximum of 10 keywords can be specified. |
test test1 |
| LogicalOperator |
string |
No |
The logical operator for keyword-based searches. Default value: and. |
and |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| TotalRecordCount |
integer |
The total number of records. |
1 |
| PageRecordCount |
integer |
The number of records per page. |
1 |
| RequestId |
string |
The request ID. |
68BCBEC2-1E66-471F-A1A8-E3C60C0A80B0 |
| PageNumber |
integer |
The page number. |
1 |
| Items |
object |
||
| LogRecords |
array<object> |
The list of error log details. |
|
|
object |
|||
| ConnInfo |
string |
The connection information of the log entry. |
conn18xxxxxx |
| CreateTime |
string |
The time when the log entry was generated. The time is in the yyyy-MM-ddTHH:mm:ssZ format (UTC). |
2019-02-26T12:09:34Z |
| Category |
string |
The category of the log entry. Valid values:
|
NETWORK |
| Content |
string |
The content of the log entry. |
xxxxxxxx |
| Id |
integer |
The log ID. |
1111111111 |
| Engine |
string |
The engine type of the current database. |
MongoDB |
Examples
Success response
JSON format
{
"TotalRecordCount": 1,
"PageRecordCount": 1,
"RequestId": "68BCBEC2-1E66-471F-A1A8-E3C60C0A80B0",
"PageNumber": 1,
"Items": {
"LogRecords": [
{
"ConnInfo": "conn18xxxxxx",
"CreateTime": "2019-02-26T12:09:34Z",
"Category": "NETWORK",
"Content": "xxxxxxxx",
"Id": 1111111111
}
]
},
"Engine": "MongoDB"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameterCombination | The end time must be greater than the start time | The start time must be earlier than the end time. |
| 400 | InvalidStartTime.Malformed | The Specified parameter StartTime is not valid. | |
| 400 | InvalidEndTime.Malformed | The Specified parameter EndTime is not valid. | |
| 403 | LogApiFrequencyExceeded | Exceeding the allowed frequency of log api. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.