全部產品
Search
文件中心

:DescribeCacheAnalysisJob - 查詢快取分析任務詳情

更新時間:Dec 19, 2025

調用DescribeCacheAnalysisJob介面,查詢快取分析任務詳情。

介面說明

使用該介面需滿足以下前提條件:

  • 使用阿里雲或 DAS 的 SDK 時,建議使用最新版本。

  • 使用 SDK 調用 DAS 服務時,需要將地區指定為 cn-shanghai。

  • 本介面只適用於 Redis 引擎。

說明

調用本介面可查詢執行個體緩衝分析任務中排名前 500 的 Key 資訊。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

hdm:DescribeCacheAnalysisJob

get

*全部資源

*

請求參數

名稱

類型

必填

描述

樣本值

InstanceId

string

執行個體 ID。

r-bp18ff4a195d****

JobId

string

緩衝分析任務 ID,您可通過調用 CreateCacheAnalysisJob 介面擷取返回參數的 JobId。

sf79-sd99-sa37-****

返回參數

名稱

類型

描述

樣本值

object

Message

string

請求返回訊息。

說明

請求成功時該參數返回 Successful,請求失敗時會返回請求異常資訊(如錯誤碼等)。

Successful

RequestId

string

請求 ID。

B6D17591-B48B-4D31-9CD6-9B9796B2****

Data

object

詳細資料列表。

TaskState

string

緩衝分析任務的狀態:

  • BACKUP:備份中。

  • ANALYZING:分析中。

  • FINISHED:分析完成。

  • FAILED:出現錯誤。

BACKUP

JobId

string

緩衝分析任務 ID。

sf79-sd99-sa37-****

Message

string

請求返回訊息。

說明

請求成功時該參數返回 Successful,請求失敗時會返回請求異常資訊(如錯誤碼等)。

Successful

BigKeys

object

KeyInfo

array<object>

大 Key 詳細資料,根據 Key 佔用位元組數降序排列。

object

Type

string

Redis 資料結構類型。

hash

Db

integer

資料庫名稱。

0

ExpirationTimeMillis

integer

Key 到期時間,格式為 Unix 時間戳記,單位為毫秒(ms),0 表示不到期。

1596256542547

Key

string

Key 的名稱。

task_x****

Encoding

string

Key 內部資料類型。

hashtable

Bytes

integer

Key 佔用位元組數。

12345

NodeId

string

執行個體的資料節點 ID。

r-x****-db-0

Count

integer

Key 的元素個數。

127

KeyPrefixes

object

Prefix

array<object>

Key 首碼列表。

object

KeyNum

integer

該首碼 Key 的數量。

123

Type

string

Redis 資料結構類型。

hash

Bytes

integer

Key 佔用位元組數。

12345

Prefix

string

Key 的首碼。

task_

Count

integer

Key 的元素個數。

127

BigKeysOfNum

object

KeyInfo

array<object>

大 Key 詳細資料,根據 Key 數量降序排列。

object

Type

string

Redis 資料結構類型。

hash

Db

integer

資料庫名稱。

0

ExpirationTimeMillis

integer

Key 到期時間,格式為 Unix 時間戳記,單位為毫秒(ms),0 表示不到期。

1596256542547

Key

string

Key 的名稱。

task_x****

Encoding

string

Key 內部資料類型。

hashtable

Bytes

integer

Key 佔用位元組數。

12345

NodeId

string

執行個體的資料節點 ID。

r-x****-db-0

Count

integer

Key 的元素個數。

127

UnexBigKeysOfBytes

object

KeyInfo

array<object>

永不到期 Key 的詳細資料,根據 Key 佔用位元組數降序排列。

object

Type

string

Redis 資料結構類型。

hash

Db

integer

資料庫名稱。

0

ExpirationTimeMillis

integer

Key 到期時間,格式為 Unix 時間戳記,單位為毫秒(ms),0 表示不到期。

1596256542547

Key

string

Key 的名稱。

task_x****

Encoding

string

Key 內部資料類型。

hashtable

Bytes

integer

Key 佔用位元組數。

12345

NodeId

string

執行個體的資料節點 ID

r-x****-db-0

Count

integer

Key 的元素個數。

127

UnexBigKeysOfNum

object

KeyInfo

array<object>

永不到期 Key 的詳細資料,根據 Key 數量降序排列。

object

Type

string

Redis 資料結構類型。

hash

Db

integer

資料庫名稱。

0

ExpirationTimeMillis

integer

Key 到期時間,格式為 Unix 時間戳記,單位為毫秒(ms),0 表示不到期。

1596256542547

Key

string

Key 的名稱。

task_x****

Encoding

string

Key 內部資料類型。

hashtable

Bytes

integer

Key 佔用位元組數。

12345

NodeId

string

執行個體的資料節點 ID。

r-x****-db-0

Count

integer

Key 的元素個數。

127

InstanceId

string

執行個體 ID。

r-bp18ff4a195d****

NodeId

string

執行個體的資料節點 ID。

r-x****-db-0

ExpiryKeysLevelCount

object

ExpiryLevel

array<object>

按到期時間分類的 Key 統計資訊。

object

按到期時間分類的 Key 統計資訊。

AnalysisTs

integer

分析完成的時間,格式為 Unix 時間戳記,單位為毫秒(ms)。

1717469347000

Level

integer

到期時間層級。取值:

  • 0:不到期。

  • 1:已到期。

  • 2:到期 0~1 小時。

  • 3:到期 1~3 小時。

  • 4:到期 3~12 小時。

  • 5:到期 12~24 小時。

  • 6:到期 1~2 天。

  • 7:到期 3~7 天。

  • 8:到期超過 7 天。

0

TotalBytes

integer

按到期時間分類統計的 Key 佔用的位元組數。

8064

TotalKeys

integer

按到期時間分類統計的 Key 總數。

62

Code

string

返回的狀態代碼。

200

Success

string

請求是否執行成功:

  • true:執行成功。

  • false:執行失敗。

true

樣本

正常返回樣本

JSON格式

{
  "Message": "Successful",
  "RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****",
  "Data": {
    "TaskState": "BACKUP",
    "JobId": "sf79-sd99-sa37-****",
    "Message": "Successful",
    "BigKeys": {
      "KeyInfo": [
        {
          "Type": "hash",
          "Db": 0,
          "ExpirationTimeMillis": 1596256542547,
          "Key": "task_x****",
          "Encoding": "hashtable",
          "Bytes": 12345,
          "NodeId": "r-x****-db-0",
          "Count": 127
        }
      ]
    },
    "KeyPrefixes": {
      "Prefix": [
        {
          "KeyNum": 123,
          "Type": "hash",
          "Bytes": 12345,
          "Prefix": "task_",
          "Count": 127
        }
      ]
    },
    "BigKeysOfNum": {
      "KeyInfo": [
        {
          "Type": "hash",
          "Db": 0,
          "ExpirationTimeMillis": 1596256542547,
          "Key": "task_x****",
          "Encoding": "hashtable",
          "Bytes": 12345,
          "NodeId": "r-x****-db-0",
          "Count": 127
        }
      ]
    },
    "UnexBigKeysOfBytes": {
      "KeyInfo": [
        {
          "Type": "hash",
          "Db": 0,
          "ExpirationTimeMillis": 1596256542547,
          "Key": "task_x****",
          "Encoding": "hashtable",
          "Bytes": 12345,
          "NodeId": "r-x****-db-0",
          "Count": 127
        }
      ]
    },
    "UnexBigKeysOfNum": {
      "KeyInfo": [
        {
          "Type": "hash",
          "Db": 0,
          "ExpirationTimeMillis": 1596256542547,
          "Key": "task_x****",
          "Encoding": "hashtable",
          "Bytes": 12345,
          "NodeId": "r-x****-db-0",
          "Count": 127
        }
      ]
    },
    "InstanceId": "r-bp18ff4a195d****",
    "NodeId": "r-x****-db-0",
    "ExpiryKeysLevelCount": {
      "ExpiryLevel": [
        {
          "AnalysisTs": 1717469347000,
          "Level": 0,
          "TotalBytes": 8064,
          "TotalKeys": 62
        }
      ]
    }
  },
  "Code": "200",
  "Success": "true"
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 InvalidParams The request parameters are invalid.
403 NoPermission You are not authorized to do this action.

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情