如果您需要查看当前集群的访问控制情况,您可以调用ListClusterKubeconfigStates接口来获取当前集群已下发用户KubeConfig的列表以及状态。
接口说明
使用该接口需要拥有 ram:ListUsers 和 ram:ListRoles 权限
使用该接口需要拥有管理容器服务(CS)的权限(AliyunCSFullAccess)
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
cs:ListClusterKubeconfigStates |
none |
*Cluster
|
无 | 无 |
请求语法
GET /clusters/{ClusterId}/kubeconfig/states HTTP/1.1
路径参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| ClusterId |
string |
否 |
集群 ID。 |
c82e6987e2961451182edacd74faf**** |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| pageNumber |
integer |
否 |
页码。
|
1 |
| pageSize |
integer |
否 |
每页记录数。
|
10 |
| cloudServiceKubeConfig |
boolean |
否 |
是否查询集群内云产品服务角色 KubeConfig 列表
枚举值:
|
true |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
响应体参数。 |
||
| states |
array<object> |
集群关联的 KubeConfig 状态列表。 |
|
|
array<object> |
|||
| account_id |
string |
阿里云账号、RAM 用户或角色 ID。 |
22855***************** |
| account_name |
string |
RAM 用户登录名称或角色名称。 |
tom |
| account_display_name |
string |
RAM 用户显示名称或角色名称。 |
tom |
| account_type |
string |
账号类型。
|
RamUser |
| account_state |
string |
账号状态。
|
Active |
| cert_expire_time |
string |
KubeConfig 客户端证书过期时间。 |
2027-07-15T01:32:20Z |
| cert_state |
string |
KubeConfig 客户端证书状态。
|
Expired |
| revokable |
boolean |
KubeConfig 客户端证书是否可吊销。 |
true |
| cloud_service_name |
string |
云产品名称 |
cs/ecs/sls |
| cloud_service_roles |
array<object> |
集群云产品服务角色关联的集群角色列表 |
|
|
object |
集群云产品服务角色关联的集群角色信息 |
||
| type |
string |
集群云产品服务角色关联的集群角色类型 枚举值:
|
ClusterRole |
| role_name |
string |
集群云产品服务角色关联的集群角色名称 |
cluster-admin |
| role_namespace |
string |
集群云产品服务角色关联的集群角色命名空间 |
kube-system |
| is_default_template |
boolean |
内容是否与默认的集群角色模板一致
|
|
| page |
object |
分页信息。 |
|
| page_number |
integer |
页码。 |
1 |
| page_size |
integer |
每页包含的最大记录数量。 |
10 |
| total_count |
integer |
结果总数。 |
5 |
示例
正常返回示例
JSON格式
{
"states": [
{
"account_id": "22855*****************",
"account_name": "tom",
"account_display_name": "tom",
"account_type": "RamUser",
"account_state": "Active",
"cert_expire_time": "2027-07-15T01:32:20Z",
"cert_state": "Expired",
"revokable": true,
"cloud_service_name": "cs/ecs/sls",
"cloud_service_roles": [
{
"type": "ClusterRole",
"role_name": "cluster-admin",
"role_namespace": "kube-system",
"is_default_template": true
}
]
}
],
"page": {
"page_number": 1,
"page_size": 10,
"total_count": 5
}
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。