调用DescribeCacheAnalysisJob接口,查询缓存分析任务详情。
接口说明
使用该接口需满足以下前提条件:
使用阿里云或 DAS 的 SDK 时,建议使用最新版本。
使用 SDK 调用 DAS 服务时,需要将地域指定为 cn-shanghai。
本接口只适用于 Redis 引擎。
调用本接口可查询实例缓存分析任务中排名前 500 的 Key 信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
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 |
| 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 |
| TotalBytes |
integer |
按过期时间分类统计的 Key 占用的字节数。 |
8064 |
| TotalKeys |
integer |
按过期时间分类统计的 Key 总数。 |
62 |
| Code |
string |
返回的状态码。 |
200 |
| Success |
string |
请求是否执行成功:
|
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. | 没有权限执行该操作 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。