Queries the active logs of an ApsaraDB for Redis instance.
Operation Description
For more information about how to view the operational logs of an instance in the ApsaraDB for Redis console, see View active logs.
This operation can be called up to 100 times per minute.
debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
kvstore:DescribeRunningLogRecords | READ |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InstanceId | string | Yes | The time when the log was generated. The time is in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC. | r-bp1zxszhcgatnx**** |
NodeId | string | No | The shard type of the cluster instance. Valid values:
Note
If you set this parameter, you must also set the NodeId parameter.
| r-bp1zxszhcgatnx****-db-0 |
StartTime | string | Yes | Details about the log entries. | 2018-12-03T07:01Z |
EndTime | string | Yes | The operation that you want to perform. Set the value to DescribeRunningLogRecords. | 2018-12-03T08:01Z |
DBName | string | No | The name of the database. | 0 |
RoleType | string | No | The total number of entries returned. Enumeration Value:
| master |
PageSize | integer | No | The role of the data shard. Default value: master. Valid values:
Enumeration Value:
| 30 |
PageNumber | integer | No | The ID of the instance. | 1 |
ResourceGroupId | string | No | The method that is used to sort the returned log entries. Valid values:
| rg-acfmyiu4ekp**** |
CharacterType | string | No | The number of the page to return. The value must be an integer that is greater than 0 and less than or equal to the maximum value supported by the integer data type. Default value: 1. Enumeration Value:
| proxy |
QueryKeyword | string | No | The content of the log. | aof |
OrderType | string | No | The ID of the node in the instance. You can set this parameter to query the operational logs of a specified node. Note
| asc |
Response parameters
Examples
Sample success responses
JSON
format
{
"StartTime": "2018-12-03T07:01Z",
"RequestId": "093B8579-9264-43A0-ABA9-AA86****",
"PageRecordCount": 5,
"TotalRecordCount": 5,
"PageSize": 30,
"InstanceId": "r-bp1zxszhcgatnx****",
"Engine": "Redis",
"PageNumber": 1,
"Items": {
"LogRecords": [
{
"CreateTime": "2018-12-03T07:07:30Z",
"InstanceId": "r-bp1zxszhcgatnx****",
"Content": "CONFIG REWRITE executed with success.",
"NodeId": "r-bp1zxszhcgatnx****-db-0"
}
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidStartTime.Malformed | The Specified parameter StartTime is not valid. | - |
400 | InvalidEndTime.Malformed | The Specified parameter EndTime is not valid. | The end time is invalid. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC. Example: 2011-06-11T16:00Z. |
400 | InvalidPageSize.Malformed | The specified parameter PageSize is not valid. | - |
404 | InvalidDbInstanceId.NotFound | Specified instance does not exist. | - |
For a list of error codes, visit the Service error codes.