Updated on 2026-09-08 GMT+08:00

Performing a Pre-upgrade Check

Function

This API is used to perform a pre-upgrade check.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.

URI

POST /api/v3/projects/{project_id}/clusters/{cluster_id}/operation/precheck

Table 1 Path Parameters

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

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

apiVersion

Yes

String

Definition:

API version. The value is fixed at v3 and cannot be changed.

Constraints:

The value cannot be changed.

Range:

  • v3

Default Value:

v3

kind

Yes

String

Definition:

API type. The value is fixed at PreCheckTask and cannot be changed.

Constraints:

The value cannot be changed.

Range:

  • PreCheckTask

Default Value:

PreCheckTask

spec

Yes

PrecheckSpec object

Definition:

Details about the configurations that need to be checked before an upgrade. CCE checks the configurations based on spec.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

Table 3 PrecheckSpec

Parameter

Mandatory

Type

Description

clusterID

Yes

String

Definition:

Cluster ID

Constraints:

N/A

Range:

N/A

Default Value:

N/A

clusterVersion

Yes

String

Definition:

Cluster version. The value is the patch version of the current cluster. You can log in to the console and view the version on the Overview page.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

targetVersion

Yes

String

Definition:

Target version. If you enter a major version, the latest patch version is automatically selected.

Constraints:

N/A

Range:

Available cluster versions later than the current cluster version

Default Value:

N/A

skippedCheckItemList

No

Array of skippedCheckItemList objects

Definition:

List of skipped check items

Constraints:

N/A

Range:

N/A

Default Value:

N/A

Table 4 skippedCheckItemList

Parameter

Mandatory

Type

Description

name

No

String

Definition:

Name of a skipped check item

Constraints:

N/A

Range:

N/A

Default Value:

N/A

resourceSelector

No

resourceSelector object

Definition:

Resource tag selector

Constraints:

This parameter is available only for node checks, but not for cluster or add-on checks.

Range:

N/A

Default Value:

N/A

Table 5 resourceSelector

Parameter

Mandatory

Type

Description

key

Yes

String

Definition:

Tag key

Constraints:

N/A

Range:

  • node.uid: node UIDs

Default Value:

N/A

values

No

Array of strings

Definition:

Tag value list

Constraints:

N/A

Range:

N/A

Default Value:

N/A

operator

Yes

String

Definition:

Logical operator of tags

Constraints:

N/A

Range:

  • In

Default Value:

N/A

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

apiVersion

String

Definition:

API version

Range:

N/A

kind

String

Definition:

Resource type.

Range:

N/A

metadata

PrecheckCluserResponseMetadata object

Definition:

Pre-upgrade check metadata

Range:

N/A

spec

PrecheckCluserResponseSpec object

Definition:

Details about the configurations that need to be checked before an upgrade. CCE checks the configurations based on spec.

Range:

N/A

status

PrecheckStatus object

Definition:

Pre-upgrade check status of a cluster

Range:

N/A

Table 7 PrecheckCluserResponseMetadata

Parameter

Type

Description

uid

String

Definition:

Task ID

Range:

N/A

Table 8 PrecheckCluserResponseSpec

Parameter

Type

Description

clusterID

String

Definition:

Cluster ID

Range:

N/A

clusterVersion

String

Definition:

Current cluster version

Range:

N/A

targetVersion

String

Definition:

Target version

Range:

N/A

skippedCheckItemList

Array of skippedCheckItemListResponse objects

Definition:

List of skipped check items

Range:

N/A

Table 9 skippedCheckItemListResponse

Parameter

Type

Description

name

String

Definition:

Name of a skipped check item

Range:

N/A

resourceSelector

resourceSelectorResponse object

Definition:

Resource tag selector. This parameter is available only for node checks, but not for cluster or add-on checks.

Range:

N/A

Table 10 resourceSelectorResponse

Parameter

Type

Description

key

String

Definition:

Tag key

Range:

  • node.uid

values

Array of strings

Definition:

Tag value list

Range:

N/A

operator

String

Definition:

Logical operator of tags

Range:

  • In

Table 11 PrecheckStatus

Parameter

Type

Description

phase

String

Definition:

Status

Range:

  • Init: initializing

  • Running

  • Success

  • Failed

  • Error: An error occurred.

expireTimeStamp

String

Definition:

Check result expiration time

Range:

N/A

message

String

Definition:

Information, which typically indicates the log for execution errors

Range:

N/A

clusterCheckStatus

clusterCheckStatus object

Definition:

Status of a cluster restrictions check

Range:

N/A

addonCheckStatus

addonCheckStatus object

Definition:

Status of an add-on check

Range:

N/A

nodeCheckStatus

nodeCheckStatus object

Definition:

Node check status

Range:

N/A

Table 12 clusterCheckStatus

Parameter

Type

Description

phase

String

Definition:

Status

Range:

  • Init: initializing

  • Running

  • Success

  • Failed

itemsStatus

Array of PreCheckItemStatus objects

Definition:

Check item status set

Range:

N/A

Table 13 addonCheckStatus

Parameter

Type

Description

phase

String

Definition:

Status

Range:

  • Init: initializing

  • Running

  • Success

  • Failed

itemsStatus

Array of PreCheckItemStatus objects

Definition:

Check item status set

Range:

N/A

Table 14 nodeCheckStatus

Parameter

Type

Description

phase

String

Definition:

Status

Range:

  • Init: initializing

  • Running

  • Success

  • Failed

nodeStageStatus

Array of NodeStageStatus objects

Definition:

Node check status

Range:

N/A

Table 15 NodeStageStatus

Parameter

Type

Description

nodeInfo

NodeInfo object

Definition:

Node information

Range:

N/A

itemsStatus

Array of PreCheckItemStatus objects

Definition:

Check item status set

Range:

N/A

Table 16 NodeInfo

Parameter

Type

Description

uid

String

Definition:

Node UID

Range:

N/A

name

String

Definition:

Node name

Range:

N/A

status

String

Definition

Node status

Range

Node resource lifecycle management (such as installation and uninstallation) status and Kubernetes node status in a cluster. The options include:

  • Build: The node is being created.

  • Installing: The node is being accepted for management.

  • Upgrading: The node is being upgraded.

  • Active: The node is running normally.

  • Abnormal: The node is abnormal.

  • Deleting: The node is being deleted.

  • Error: The node is faulty.

nodeType

String

Definition

Node type

Range

  • BareMetal: BMS

  • VirtualMachine: ECS

Table 17 PreCheckItemStatus

Parameter

Type

Description

name

String

Definition:

Check item name

Range:

N/A

kind

String

Definition:

Check item type

Range:

  • Exception: An exception needs to be handled by the user.

  • Risk: A risk can be skipped after being confirmed by the user.

group

String

Definition:

Check item group

Range:

  • LimitCheck: cluster limit check

  • MasterCheck: master node check

  • NodeCheck: worker node check

  • AddonCheck: add-on check

  • ExecuteException: process error check

level

String

Definition:

Check item risk level

Range:

  • Info: information

  • Warning

  • Fatal: critical

phase

String

Definition:

Status

Range:

  • Init: initializing

  • Running

  • Success

  • Failed

message

String

Definition:

More information icon

Range:

N/A

riskSource

riskSource object

Definition:

Risk source

Range:

N/A

errorCodes

Array of strings

Definition:

Error code set

Range:

N/A

Table 18 riskSource

Parameter

Type

Description

configurationRisks

Array of configurationRisks objects

Definition:

Configuration risk

Range:

N/A

deprecatedAPIRisks

Array of deprecatedAPIRisks objects

Definition:

Deprecated API risk

Range:

N/A

nodeRisks

Array of nodeRisks objects

Definition:

Node risk

Range:

N/A

addonRisks

Array of addonRisks objects

Definition:

Add-on risk

Range:

N/A

Table 19 configurationRisks

Parameter

Type

Description

package

String

Definition:

Component name

Range:

N/A

sourceFile

String

Definition:

Involved file path

Range:

N/A

nodeMsg

String

Definition:

Node information

Range:

N/A

field

String

Definition:

Parameter value.

Range:

N/A

operation

String

Definition:

Modification operation type

Range:

N/A

originalValue

String

Definition:

Original value

Range:

N/A

value

String

Definition:

Current value

Range:

N/A

Table 20 deprecatedAPIRisks

Parameter

Type

Description

url

String

Definition:

Request path, for example, /apis/policy/v1beta1/podsecuritypolicies

Range:

N/A

userAgent

String

Definition:

Client information

Range:

N/A

Table 21 nodeRisks

Parameter

Type

Description

NodeID

String

Definition:

Worker node ID

Range:

N/A

Table 22 addonRisks

Parameter

Type

Description

addonTemplateName

String

Definition:

Add-on template name

Range:

N/A

alias

String

Definition:

Add-on alias

Range:

N/A

Example Requests

Request body for a cluster pre-upgrade check

POST /api/v3/projects/{project_id}/clusters/{cluster_id}/operation/precheck

{
  "kind" : "PreCheckTask",
  "apiVersion" : "v3",
  "spec" : {
    "clusterID" : "8978deaa-1743-11ee-8e46-0255ac10004c",
    "clusterVersion" : "v1.15.11-r1",
    "targetVersion" : "v1.19.16-r80",
    "skippedCheckItemList" : [ ]
  }
}

Example Responses

Status code: 200

Cluster pre-upgrade check succeeded.

{
  "kind" : "PreCheckTask",
  "apiVersion" : "v3",
  "metadata" : {
    "uid" : "9991b45e-a2be-4b49-aca4-50a25fa6f81e"
  },
  "spec" : {
    "clusterID" : "8978deaa-1743-11ee-8e46-0255ac10004c",
    "clusterVersion" : "v1.15.11-r1",
    "targetVersion" : "v1.19.16-r80"
  },
  "status" : {
    "phase" : "Init",
    "clusterCheckStatus" : {
      "phase" : "Init"
    },
    "addonCheckStatus" : {
      "phase" : "Init"
    },
    "nodeCheckStatus" : {
      "phase" : "Init"
    }
  }
}

Status Codes

Status Code

Description

200

Cluster pre-upgrade check succeeded.

Error Codes

See Error Codes.