All Products
Search
Document Center

Container Service for Kubernetes:UpdateK8sClusterUserConfigExpire

Last Updated:Apr 17, 2024

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.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
cs:UpdateK8sClusterUserConfigExpireWrite
  • Cluster
    acs:cs:{#regionId}:{#accountId}:cluster/{#ClusterId}
    none
none

Request syntax

POST /k8s/{ClusterId}/user_config/expire

Request parameters

ParameterTypeRequiredDescriptionExample
ClusterIdstringYes

The ID of the cluster.

c5b5e80b0b64a4bf6939d2d8fbbc5****
bodyobjectNo

The request body.

expire_hourlongYes

The validity period of the kubeconfig file. Unit: hours.

Note The value of expire_hour must be greater than 0 and equal to or smaller than 876000 (100 years).
720
userstringYes

The user ID.

The ID of the Resource Access Management (RAM) user that you use.

Response parameters

ParameterTypeDescriptionExample
The current API has no return parameters

Examples

Sample success responses

JSONformat

{}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-03-28The internal configuration of the API is changed, but the call is not affectedsee changesets
Change itemChange content
The internal configuration of the API is changed, but the call is not affected.