You can call the UpdateK8sClusterUserConfigExpire operation to renew the kubeconfig file of a cluster.
Note
- You can call this operation only with an Alibaba Cloud account.
- After you revoke the kubeconfig file of a cluster, the validity period of the kubeconfig file that you specified becomes invalid. You can call this API operation to specify the validity period again.
Debugging
Request syntax
POST /k8s/ClusterId/user_config/expire HTTP/1.1
Content-Type:application/json
{
"expire_hour" : Long,
"user" : "String"
}Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| ClusterId | String | Yes | c5b5e80b0b64a4bf6939d2d8fbbc5**** |
The ID of the cluster that you want to manage. |
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| expire_hour | Long | Yes | 720 |
The validity period that you want to use. Unit: hours. Note The value of the expire_hour parameter must be greater than 0 and cannot exceed 876000
(100 years).
|
| user | String | Yes | RAM user ID |
The ID of the Resource Access Management (RAM) user that you use. |
Response syntax
HTTP/1.1 200 OKResponse parameters
Sample requests
POST /k8s/c5b5e80b0b64a4bf6939d2d8fbbc5****/user_config/expire HTTP/1.1
Host:cs.aliyuncs.com
Content-Type:application/json
{
"expire_hour" : 720,
"user" : "RAM user id"
}Sample success responses
JSON format
HTTP/1.1 200 OKError codes
For a list of error codes, visit the API Error Center.