Sets the validity period of a kubeconfig file used by a Resource Access Management (RAM) user or RAM role to connect to a Container Service for Kubernetes (ACK) cluster. The validity period ranges from 1 to 876,000 hours. You can call this API operation when you customize configurations by using an Alibaba Cloud account. The default validity period of a kubeconfig file is three years.
Operation description
You can call this operation only with an Alibaba Cloud account.
If the kubeconfig file used by your cluster is revoked, the custom validity period of the kubeconfig file is reset. In this case, you need to call this API operation to reconfigure the validity period of the kubeconfig file.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cs:UpdateK8sClusterUserConfigExpire |
update |
*Cluster
|
None | None |
Request syntax
POST /k8s/{ClusterId}/user_config/expire HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ClusterId |
string |
Yes |
The ID of the cluster. |
c5b5e80b0b64a4bf6939d2d8fbbc5**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. |
|
| expire_hour |
integer |
Yes |
Specifies the expiration time of the kubeconfig file. Unit: hours. Valid values: [1, 1876000]. The maximum value is 100 years. |
720 |
| user |
string |
Yes |
The RAM user ID. |
206945240368****** |
Response elements
|
Element |
Type |
Description |
Example |
None defined.
Examples
Success response
JSON format
{}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.