更新时间:2025-09-29 GMT+08:00
分享

获取密钥分布统计信息

功能介绍

获取CPCS中密钥分布统计信息

调用方法

请参见如何调用API

URI

GET /v1/{project_id}/dew/cpcs/secret-key/statistic

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目id

表2 Query参数

参数

是否必选

参数类型

描述

cluster_id

String

集群id,默认为空,默认查询所有集群

app_id

String

应用id,默认为空,默认查询所有app

from

Long

查询的初始时间戳,毫秒级时间戳,默认查询前三天

to

Long

查询的终止时间戳,毫秒级时间戳,默认查询到当前时间

period

Integer

统计周期,默认为1,五分钟为一个周期

filter

String

统计值,默认为min:最小值

algorithm

String

算法,有:“sm2”,"rsa"

algorithm_type

String

算法类型,0:国密算法,1:国际算法

certificate_type

String

证书类型,0:根证书,1:业务证书

server_type

String

密码服务类型

请求参数

响应参数

状态码:200

表3 响应Body参数

参数

参数类型

描述

total_count

Integer

总数量

invalid_count

Integer

无效数量

valid_count

Integer

有效数量

key_counts_by_service_type

Array of VendorKeyStatistic objects

密钥分布按服务类型统计

key_counts_by_algorithm

Array of VendorKeyStatistic objects

密钥分布按算法统计

key_counts_by_algorithm_and_cluster

Array of VendorKeyStatistic objects

密钥分布按算法和集群统计

表4 VendorKeyStatistic

参数

参数类型

描述

total_count

Integer

总数

valid_count

Integer

有效数量

invalid_count

Integer

无效数量

tenant_id

String

租户ID

cluster_id

String

集群ID

cluster_name

String

集群名称

server_type

String

服务类型

algorithm

String

算法

请求示例

密码服务资源信息

/v1/{project_id}/dew/cpcs/secret-key/statistic

响应示例

状态码:200

正常返回

{
  "total_count" : 8,
  "invalid_count" : 0,
  "valid_count" : 8,
  "key_counts_by_service_type" : [ {
    "total_count" : 8,
    "valid_count" : 8,
    "invalid_count" : 0,
    "tenant_id" : "4740d5274ad740749a9686e1b7456a85",
    "cluster_id" : "0a5217b0bc064e42a7d2e3f3c49f2b81",
    "cluster_name" : "otp",
    "server_type" : "OTP",
    "algorithm" : "SM4"
  } ],
  "key_counts_by_algorithm" : [ {
    "total_count" : 8,
    "valid_count" : 8,
    "invalid_count" : 0,
    "tenant_id" : "4740d5274ad740749a9686e1b7456a85",
    "cluster_id" : "0a5217b0bc064e42a7d2e3f3c49f2b81",
    "cluster_name" : "otp",
    "server_type" : "OTP",
    "algorithm" : "SM4"
  } ],
  "key_counts_by_algorithm_and_cluster" : [ {
    "total_count" : 8,
    "valid_count" : 8,
    "invalid_count" : 0,
    "tenant_id" : "4740d5274ad740749a9686e1b7456a85",
    "cluster_id" : "0a5217b0bc064e42a7d2e3f3c49f2b81",
    "cluster_name" : "otp",
    "server_type" : "OTP",
    "algorithm" : "SM4"
  } ]
}

状态码

状态码

描述

200

正常返回

错误码

请参见错误码

相关文档