All Products
Search
Document Center

:Update a component in a cluster

更新时间:Dec 12, 2023

You can call the UpgradeClusterAddons operation to update a specified component in a cluster to the required version.

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 headers

This operation uses only common request headers. For more information, see Common request parameters.

Request syntax

POST /clusters/{ClusterId}/components/upgrade HTTP/1.1

Request parameters

Parameter Type Position Required Example Description
ClusterId String Path Yes cf4299b79b3e34226abfdc80a4bda****

The ID of the cluster that you want to manage.

Array Body No

The request parameters for the operation.

component_name String Body Yes coredns

The name of the component that you want to update.

next_version String Body Yes 1.6.7

The version to which the component can be updated. You can call the DescribeClusterAddonsVersion operation to query the version to which the component can be updated.

version String Body No v1.6.2

The current version of the component.

config String Body No {\"CpuRequest\":\"800m\"}

The custom component settings that you want to use. The value is a JSON string.

Examples

Sample requests

POST /clusters/cf4299b79b3e34226abfdc80a4bda****/components/upgrade HTTP/1.1 
Content-Type:application/json
[ {
  "component_name" : "coredns",
  "next_version" : "1.6.7",
  "version" : "v1.6.2"
} ]

Sample success responses

JSON format

HTTP/1.1 200 OK

Error codes

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