Rotating a Cluster Certificate of a User
Function
This API is used to rotate the certificate of a cluster.
After the operation completes, the certificate for the cluster component is renewed with a new five-year validity period.
Calling Method
For details, see Calling APIs.
URI
POST /api/v3/projects/{project_id}/clusters/{cluster_id}/rotatecredentials
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Details: Project ID. For details about how to obtain the value, see How to Obtain Parameters in the API URI. Constraints: None Options: Project IDs of the account Default value: N/A |
| cluster_id | Yes | String | Details: Cluster ID. For details about how to obtain the value, see How to Obtain Parameters in the API URI. Constraints: None Options: Cluster IDs Default value: N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | Definition Type (or format) of the request body. The default value is application/json. Other values of this field will be provided for specific APIs, if any. Constraints GET requests are not validated. Default Value N/A |
| X-Auth-Token | Yes | String | Details: Requests for calling an API can be authenticated using either a token or AK/SK. If token-based authentication is used, this parameter is mandatory and must be set to a user token. For details, see Obtaining a User Token. Constraints: None Options: N/A Default value: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| component | Yes | String | Definition Name of a component to be rotated Constraints N/A Range
Default Value N/A |
| certificateExpirationTime | No | Integer | Definition The length of time the old ServiceAccount-token signing certificate remains valid after the certificate is rotated. To ensure that the old ServiceAccount-token signing certificate continue to pass signature verification after rotation, CCE retains the old certificate for a period of time. The rules are as follows:
Constraints N/A Range 0–8784 (hours) Default Value 24 (hours) |
| certContent | No | AuthenticatingProxy object | Definition Certificate details Constraints This parameter is mandatory when component is set to custom. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| ca | No | String | Details: X509 CA certificate (Base64-encoded) configured in authenticating_proxy mode Constraints: This field is mandatory when the cluster authentication mode is authenticating_proxy. Options: Maximum size: 1 MB Default value: N/A |
| cert | No | String | Details: Client certificate issued by the X509 CA certificate configured in authenticating_proxy mode, which is used for authentication from kube-apiserver to the extended API server. (The value must be Base64-encoded.) Constraints: This field is mandatory when the cluster authentication mode is authenticating_proxy. Options: Maximum size: 1 MB Default value: N/A |
| privateKey | No | String | Details: Private key of the client certificate issued by the X509 CA certificate configured in authenticating_proxy mode, which is used for authentication from kube-apiserver to the extended API server. The private key used by the Kubernetes cluster does not support password encryption. Use an unencrypted private key. (The value must be Base64-encoded.) Constraints: This field is mandatory when the cluster authentication mode is authenticating_proxy. Options: Maximum size: 1 MB Default value: N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| jobid | String | Definition ID returned after a job is submitted. This ID can be used to query the execution of the job. Constraints N/A Range N/A Default Value N/A |
Example Requests
POST /api/v3/projects/{project_id}/clusters/{cluster_id}/rotatecredentials
{
"component" : "service-account-controller"
} Example Responses
Status code: 200
The certificate rotation task has been delivered in the cluster.
{
"jobid" : "2ec9b78d-9368-46f3-8f29-d1a95622a568"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | The certificate rotation task has been delivered in the cluster. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot