UpdateKubernetesKubeConfig - Update the Kubernetes cluster name and configuration file
Updates the name and kubeconfig file of a Kubernetes cluster.
|
Applicable editions |
Central edition, Region edition |
Service endpoints and authorization information
- Obtain the service endpoint. Use the endpoint to replace {domain} in the API request syntax.
- Obtain a personal access token.
- Obtain the organization ID (required only for Central edition). Go to the Basic Information page in the Organization Management console to find your organization ID.
|
Product |
Resource |
Required permission |
|
Pipeline |
Kubernetes cluster |
Read and write |
Request syntax
Central edition
POST https://{domain}/oapi/v1/flow/organizations/{organizationId}/k8s/credential
Region edition
POST https://{domain}/oapi/v1/flow/k8s/credential
Request headers
|
Parameter |
Type |
Required |
Description |
Example value |
|
x-yunxiao-token |
string |
Yes |
Your personal access token. |
pt-0fh3****0fbG_35af****0484 |
Request parameters
|
Parameter |
Type |
Location |
Required |
Description |
Example value |
|
organizationId |
string |
path |
|
The organization ID. |
5ebbc0228123212b59xxxxx |
|
id |
integer |
query |
Yes |
The cluster ID. |
123 |
|
name |
string |
query |
Yes |
The cluster name. |
San Zhang's cluster |
|
kubeConfig |
string |
query |
Yes |
The cluster configuration file. |
apiVersion: v1... |
Request examples
Central edition
curl -X 'POST' \
'https://{domain}/oapi/v1/flow/organizations/5ebbc0228123212b59xxxxx/k8s/credential?id=123&name=San Zhang's cluster&kubeConfig=apiVersion: v1...' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'
Region edition
curl -X 'POST' \
'https://{domain}/oapi/v1/flow/k8s/credential?id=123&name=San Zhang's cluster&kubeConfig=apiVersion: v1...' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'
Response parameters
|
Parameter |
Type |
Description |
Example value |
|
- |
boolean |
Whether the operation succeeded. |
true |
Response example
true
Error codes
For more information, see Error code center.