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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request syntax

POST /k8s/ClusterId/user_config/expire HTTP/1.1
Content-Type:application/json

{
  "expire_hour" : Long,
  "user" : "String"
}

Request parameters

Table 1. Request path parameters
Parameter Type Required Example Description
ClusterId String Yes c5b5e80b0b64a4bf6939d2d8fbbc5****

The ID of the cluster that you want to manage.

Table 2. Request body parameters
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 OK

Response 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 OK

Error codes

For a list of error codes, visit the API Error Center.