You can call this operation to query operational logs of an ApsaraDB for Redis instance.

For more information about how to perform the corresponding operation in the console, see Query operational logs of an instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String No DescribeRunningLogRecords

The operation that you want to perform. Set the value to DescribeRunningLogRecords.

InstanceId String Yes r-bp1xxxxxxxxxxxxx

The ID of the instance for which you want to query operational logs.

StartTime String Yes 2018-12-03T07:01Z

The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format.

EndTime String Yes 2018-12-03T08:01Z

The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The end time must be later than the start time.

NodeId String No r-bp1xxxxxxxxxxxxx-db-0

The ID of the child node in the cluster. You must specify this parameter when you query a specified child node in the cluster.

DBName String No demo

The name of the database.

RoleType String No master

The role of the node. Default value: master.

PageSize Integer No 30

The number of entries to return on each page.

PageNumber Integer No 1

The number of the page to return.

RegionId String No cn-hangzhou

The ID of the region.

Response parameters

Parameter Type Example Description
RequestId String 093B8579-9264-43A0-ABA9-AA8621FF

The ID of the request.

InstanceId String r-bp1xxxxxxxxxxxxx

The ID of the instance.

StartTime String 2018-12-03T07:01Z

The beginning of the time range where operational logs are queried.

Engine String Redis

The database engine type of the instance.

TotalRecordCount Integer 5

The total number of entries returned.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 30

The number of entries returned per page.

PageRecordCount Integer 5

The number of logs that are returned on the current page.

Items Array

The operational logs that are returned.

Level String WARNING

The level of the log entry.

CreateTime String 2018-12-03T07:07:30Z

The time when the log was generated.

Category String NETWORK

The category of the log.

Content String CONFIG REWRITE executed with success.

The content of the log.

Examples

Sample requests

https://r-kvstore.aliyuncs.com/
?Action=DescribeRunningLogRecords
&InstanceId=r-bp1xxxxxxxxxxxxx
&StartTime=2018-12-03T07:01Z
&EndTime=2018-12-03T08:01Z
&<Common request parameters>

Sample success responses

XML format

<DescribeRunningLogRecordsResponse>
      <Items>
            <LogRecords>
                  <CreateTime>2019-03-22T08:43:24Z</CreateTime>
                  <Level>WARNING</Level>
                  <Content>CONFIG REWRITE executed with success. </Content>
            </LogRecords>
      </Items>
      <PageNumber>1</PageNumber>
      <TotalRecordCount>1</TotalRecordCount>
      <PageSize>30</PageSize>
      <InstanceId>r-bp1xxxxxxxxxxxxx</InstanceId>
      <RequestId>AAFCDED7-3FE1-49B2-9E9F-2D66E3D041A8</RequestId>
      <StartTime>2019-03-20T07:01Z</StartTime>
      <PageRecordCount>1</PageRecordCount>
</DescribeRunningLogRecordsResponse>

JSON format

{
    "Items": {
        "LogRecords": [
            {
                "CreateTime": "2019-03-22T08:43:24Z",
                "Level": "WARNING",
                "Content": "CONFIG REWRITE executed with success."
            }
        ]
    },
    "PageNumber": 1,
    "TotalRecordCount": 1,
    "PageSize": 30,
    "InstanceId": "r-bp1xxxxxxxxxxxxx",
    "RequestId": "AAFCDED7-3FE1-49B2-9E9F-2D66E3D041A8",
    "StartTime": "2019-03-20T07:01Z",
    "PageRecordCount": 1
}

Error codes

HttpCode Error code Error message Description
400 InvalidStartTime.Malformed The Specified parameter StartTime is not valid. The error message returned because the format of the beginning time is invalid. The time must be in GMT. Example: 2011-06-11T16:00Z.
400 InvalidEndTime.Malformed The Specified parameter EndTime is not valid. The error message returned because the format of the end time is invalid. The time must be in GMT. Example: 2011-06-11T16:00Z.

For a list of error codes, visit the API Error Center.