If you need to view the access control status of the current cluster, you can invoke the ListClusterKubeconfigStates API to obtain the list and status of KubeConfig configurations that have been issued to users for the current cluster.
Operation description
Invoking this API requires the ram:ListUsers and ram:ListRoles permissions.
Invoking this API requires permissions to manage Container Service (CS) (AliyunCSFullAccess).
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cs:ListClusterKubeconfigStates |
none |
*Cluster
|
None | None |
Request syntax
GET /clusters/{ClusterId}/kubeconfig/states HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ClusterId |
string |
No |
The ID of the cluster. |
c82e6987e2961451182edacd74faf**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| pageNumber |
integer |
No |
The page number.
|
1 |
| pageSize |
integer |
No |
The number of entries per page.
|
10 |
| cloudServiceKubeConfig |
boolean |
No |
Whether to query the KubeConfig list of service roles for cloud products within the cluster.
Valid values:
|
true |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body. |
||
| states |
array<object> |
The status list of the kubeconfig files associated with the cluster. |
|
|
array<object> |
|||
| account_id |
string |
The ID of an Alibaba Cloud account, RAM user, or RAM role. |
22855***************** |
| account_name |
string |
The logon name or role name of the RAM user. |
tom |
| account_display_name |
string |
The displayed name or role name of the RAM user. |
tom |
| account_type |
string |
The type of the account.
|
RamUser |
| account_state |
string |
The status of the account.
|
Active |
| cert_expire_time |
string |
The expiration time of the client certificate for the kubeconfig file. |
2027-07-15T01:32:20Z |
| cert_state |
string |
The status of the client certificate for the kubeconfig file.
|
Expired |
| revokable |
boolean |
Indicates whether the client certificate for the kubeconfig file can be revoked. |
true |
| cloud_service_name |
string |
Cloud service name. |
cs/ecs/sls |
| cloud_service_roles |
array<object> |
List of cluster roles associated with the cluster cloud product service roles. |
|
|
object |
Information about the cluster role associated with the cluster cloud product service role. |
||
| type |
string |
The type of the cluster role associated with the cloud service role of the cluster. Valid values:
|
ClusterRole |
| role_name |
string |
Name of the cluster role associated with the cluster cloud product service role. |
cluster-admin |
| role_namespace |
string |
Namespace of the cluster role associated with the cluster cloud product service role. |
kube-system |
| is_default_template |
boolean |
Indicates whether the content matches the default cluster role template.
|
|
| page |
object |
The pagination information. |
|
| page_number |
integer |
The page number. |
1 |
| page_size |
integer |
The number of entries per page. |
10 |
| total_count |
integer |
The total number of entries returned. |
5 |
Examples
Success response
JSON format
{
"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": false
}
]
}
],
"page": {
"page_number": 1,
"page_size": 10,
"total_count": 5
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.