Queries the hot keys of a specified ApsaraDB for Redis instance.

Before you call this operation, make sure that the following conditions are met:

  • This operation is applicable to only the Redis engine.
  • When you use an Alibaba Cloud SDK, make sure that the aliyun-sdk-core version is later than V4.3.3. We recommend that you use the latest version.
  • The SDK version for Database Autonomy Service (DAS) must be V1.0.2 or later.
  • When you use the SDK to call the DAS service, you must specify the region as cn-shanghai.

Request parameters

Parameter Type Required Example Description
Action String No DescribeHotKeys

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

InstanceId String No r-bp18ff4a195d****

The ID of the Redis instance. You can call the DescribeInstances operation to view the ID.

NodeId String No r-x****-db-0

The ID of the Redis node. You can call the DescribeRoleZoneInfo operation to view the InsName response parameter.

Response parameters

Parameter Type Example Description
Code String 200

The returned status code.

Data Array of HotKey

The list of detailed information.

HotKey
Db Integer 0

The database instance.

Hot String 5500~6000

The access frequency.

Key String BACKUP

The ID of the sharded instance.

KeyType String zset

The type of the keys.

Size Long 12345

The number of elements in the keys.

Message String Successful

The returned message of the request.

Note If the request is successful, Successful is returned for this parameter. If the request fails, a request exception message such as an error code is returned.
RequestId String B6D17591-B48B-4D31-9CD6-9B9796B2****

The ID of the request.

Success String true

Indicates whether the request was successful.

  • true: The request was successful.
  • false: The request failed.

Examples

Sample requests

http(s)://https://das.cn-shanghai.aliyuncs.com/?Action=DescribeHotKeys
&InstanceId=r-bp18ff4a195d****
&NodeId=r-x****-db-0
&<Common request parameters>

Sample success responses

XML format

<DescribeHotKeysReponse>
  <RequestId> B6D17591-B48B-4D31-9CD6-9B9796B2270A</RequestId>
  <Message>Successful</Message>
  <Data>
        <HotKey>
              <KeyType>zset</KeyType>
              <Hot>5500~6000</Hot>
              <Size>12345</Size>
              <Key>BACKUP</Key>
              <Db>0</Db>
        </HotKey>
  </Data>
  <Code>200</Code>
  <Success>true</Success>
</DescribeHotKeysReponse>

JSON format

{"RequestId":" B6D17591-B48B-4D31-9CD6-9B9796B2270A",
"Message":"Successful",
"Data":{
    "HotKey":[{
        "KeyType":"zset",
        "Hot":"5500~6000",
        "Size":"12345",
        "Key":"BACKUP",
        "Db":"0"}]},
        "Code":"200",
        "Success":"true"}

Error codes

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