All Products
Search
Document Center

Tair (Redis® OSS-Compatible):DescribeRunningLogRecords

Last Updated:Oct 30, 2024

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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
kvstore:DescribeRunningLogRecordsget
  • DBInstance
    acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the instance.

r-bp1zxszhcgatnx****
NodeIdstringNo

The ID of the node in the instance. You can set this parameter to query the operational logs of a specified node.

Note
  • This parameter is available only for read/write splitting and cluster instances of ApsaraDB for Redis.
  • If you set this parameter, you must also set the CharacterType parameter.
  • r-bp1zxszhcgatnx****-db-0
    StartTimestringYes

    The beginning of the time range to query. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

    2018-12-03T07:01Z
    EndTimestringYes

    The end of the time range to query. The end time must be later than the start time. The time range cannot exceed one day. We recommend that you specify 1 hour. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

    2018-12-03T08:01Z
    DBNamestringNo

    The name of the database.

    0
    RoleTypestringNo

    The role of the data shard. Default value: master. Valid values:

    • master: master node
    • slave: replica node
    master
    PageSizeintegerNo

    The number of entries to return on each page. Valid values: 30, 50, and 100. Default value: 30.

    30
    PageNumberintegerNo

    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.

    1
    ResourceGroupIdstringNo

    The ID of the resource group.

    rg-acfmyiu4ekp****
    CharacterTypestringNo

    The shard type of the cluster instance. Valid values:

    • proxy: proxy node
    • db: data node
    • cs: config server node
    Note If you set this parameter, you must also set the NodeId parameter.
    proxy
    QueryKeywordstringNo

    The keyword that is used to query operational logs.

    aof
    OrderTypestringNo

    The method that is used to sort the returned log entries. Valid values:

    • asc: ascending order
    • desc: descending order
    asc

    Response parameters

    ParameterTypeDescriptionExample
    object
    StartTimestring

    The beginning of the time range to query.

    2018-12-03T07:01Z
    RequestIdstring

    The ID of the request.

    093B8579-9264-43A0-ABA9-AA86****
    PageRecordCountinteger

    The number of log entries returned on the current page.

    5
    TotalRecordCountinteger

    The total number of entries returned.

    5
    PageSizeinteger

    The maximum number of entries returned on each page.

    30
    InstanceIdstring

    The ID of the instance.

    r-bp1zxszhcgatnx****
    Enginestring

    The type of the database engine.

    Redis
    PageNumberinteger

    The page number of the returned page.

    1
    Itemsarray<object>

    Details about the log entries.

    LogRecordsobject
    CreateTimestring

    The time when the log was generated. The time is in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

    2018-12-03T07:07:30Z
    InstanceIdstring

    The ID of the instance.

    r-bp1zxszhcgatnx****
    Contentstring

    The content of the log.

    CONFIG REWRITE executed with success.
    NodeIdstring

    The ID of the node.

    Note If a standard instance is queried, (null) is returned.
    r-bp1zxszhcgatnx****-db-0

    Examples

    Sample success responses

    JSONformat

    {
      "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 codeError codeError messageDescription
    400InvalidStartTime.MalformedThe Specified parameter StartTime is not valid.-
    400InvalidEndTime.MalformedThe 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.
    400InvalidPageSize.MalformedThe specified parameter PageSize is not valid.-
    404InvalidDbInstanceId.NotFoundSpecified instance does not exist.The specified instance does not exist

    For a list of error codes, visit the Service error codes.