获取证书详情 - ShowResourceDetailCertificate
功能介绍
获取所监控或者统计的证书详情。
调用方法
请参见如何调用API。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权,具体权限要求请参见权限和授权项。
- 如果使用身份策略授权,需具备如下身份策略权限。
授权项
访问级别
资源类型(*为必须)
条件键
别名
依赖的授权项
cpcs::getResourceDetailCertificate
Read
-
-
cpcs:system:getResourceDetailCertificate
-
URI
GET /v1/{project_id}/dew/cpcs/resource/certificates
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| project_id | 是 | String | 项目id |
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| cluster_id | 否 | String | 集群id,默认空字符串,默认查询所有集群 |
| app_id | 否 | String | 应用id,默认空字符串,默认查询所有的应用 |
| service_type | 否 | String | 密码服务类型,默认空字符串,默认查询所有密码服务类型 |
| algorithm_type | 否 | String | 算法类型,默认空字符串,0:国密,1:国际 |
| certificate_type | 否 | String | 证书类型,默认空字符串,0:根证书,1:业务证书 |
| limit | 否 | Integer | 页面大小,不超过1500 |
| offset | 否 | Integer | 页数,默认1 |
| from | 否 | Long | 查询起始时间戳,毫秒级时间戳,默认为0,默认从三天前查询 |
| to | 否 | Long | 查询终止时间戳,毫秒级时间戳,默认为0,默认查询到当前时间 |
请求参数
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| X-Auth-Token | 否 | String | 用户token,参见:IAM token获取方法 |
响应参数
状态码:200
| 参数 | 参数类型 | 描述 |
|---|---|---|
| metric_name | String | 资源名称 |
| certificate_list | Array of certificate_list objects | 证书详情列表 |
| total_count | Integer | 证书总数 |
| expired_count | Integer | 证书过期数量 |
| expiring_count | Integer | 证书即将过期数量 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| name | String | 证书名称 |
| id | String | 证书ID |
| tenant_id | String | 租户ID |
| cluster_id | String | 集群ID |
| server_type | String | 密码服务类型 |
| certificate_type | String | 证书类型,0:根证书,1:业务证书 |
| algorithm_type | String | 算法类型,0:国密,1:国际 |
| algorithm | String | 算法名称 |
| start_time | Long | 开始时间,UNIX时间戳,单位毫秒 |
| expired_time | Long | 过期时间,UNIX时间戳,单位毫秒 |
| issuer | String | 签发者 |
| user | String | 用户 |
| status | Integer | 证书状态,0:正常,2:过期,3:即将过期 |
| create_time | String | 创建时间 |
请求示例
-
证书详情:空数据时
GET https://cpcs.com/v1/{project_id}/dew/cpcs/resource/certificates?algorithm_type=&certificate_type=&cluster_id=&service_type=&limit=10&offset=1 -
获取特定类型的证书详情,服务为协同签名,算法为国际算法,根证书,第一页,一页10个
GET https://cpcs.com/v1/{project_id}/dew/cpcs/resource/certificates?algorithm_type=1&certificate_type=0&cluster_id=&service_type=COLLA_SIGN&limit=10&offset=1 -
获取所有类型的证书详情,第一页,一页10个
GET https://cpcs.com/v1/{project_id}/dew/cpcs/resource/certificates?algorithm_type=&certificate_type=&cluster_id=&service_type=&limit=10&offset=1
响应示例
状态码:200
正常返回
{
"metric_name" : "证书的详情信息",
"certificate_list" : [ {
"name" : "缺省RSA证书_0",
"id" : "216e49989f583aacf829d4dbce584c76",
"tenant_id" : "3bab8e245e854f68af5967c00dd43127",
"cluster_id" : "227c92f3b5e849e3bbff50f1b57c2143",
"server_type" : "SSL_VPN",
"certificate_type" : "0",
"algorithm_type" : null,
"algorithm" : "RSA",
"start_time" : 1739772940000,
"expired_time" : 2370492940000,
"issuer" : "",
"user" : "",
"status" : 0,
"create_time" : "2024-05-28 13:53:50"
}, {
"name" : "缺省SM2证书_0",
"id" : "83da123629dc87ca10a19251a24407dc",
"tenant_id" : "3bab8e245e854f68af5967c00dd43127",
"cluster_id" : "227c92f3b5e849e3bbff50f1b57c2143",
"server_type" : "SSL_VPN",
"certificate_type" : "0",
"algorithm_type" : null,
"algorithm" : "SM2",
"start_time" : 1739772940000,
"expired_time" : 2370492940000,
"issuer" : "",
"user" : "",
"status" : 0,
"create_time" : "2024-05-28 13:53:50"
} ],
"total_count" : 8,
"expired_count" : 0,
"expiring_count" : 0
} 状态码
| 状态码 | 描述 |
|---|---|
| 200 | 正常返回 |
错误码
请参见错误码。