This API is used to create add-on check tasks in batches in a specified cluster.
POST /api/v3/projects/{project_id}/clusters/{cluster_id}/addons/precheck
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 |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
Content-Type |
Yes |
String |
Details: The request body type or format Constraints: The GET method is not verified. Options: 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 |
|---|---|---|---|
kind |
Yes |
String |
Definition API type. Constraints The value cannot be changed. Range The value is fixed at AddonCheck. Default Value AddonCheck |
apiVersion |
Yes |
String |
Definition API version. Constraints The value cannot be changed. Range The value is fixed at v3. Default Value v3 |
spec |
Yes |
AddonCheckSpec object |
Definition Details of an add-on check. Constraints N/A |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
clusterID |
Yes |
String |
Definition Cluster ID. Constraints N/A Range N/A Default Value N/A |
addonList |
Yes |
Array of AddonInfo objects |
Definition Add-on check information list, including the name of the add-on template to be checked, add-on instance ID, and add-on upgrade configuration. Constraints N/A |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
addonTemplateName |
Yes |
String |
Definition Add-on template name. Constraints N/A Range Add-on template supported by CCE. Default Value N/A |
addonInstanceID |
Yes |
String |
Definition Add-on instance ID, which can be obtained from the items[].metadata.uid field in Listing Add-on Instances. Constraints This parameter is mandatory. Range N/A Default Value N/A |
targetVersion |
No |
String |
Definition Target version of an add-on upgrade. Constraints This parameter is mandatory in the add-on upgrade scenario. Range Add-on version provided by CCE. You can obtain the value from the items[].spec.versions.version field in Listing Add-on Templates. Default Value N/A |
type |
Yes |
String |
Definition Add-on check type. Constraints This parameter is mandatory. Range Default Value N/A |
values |
No |
Map<String,Object> |
Definition Add-on template edit or upgrade parameters (which vary depending on add-ons). Set the parameters accordingly. Constraints N/A |
Status code: 201
Parameter |
Type |
Description |
|---|---|---|
kind |
String |
Definition API type. Constraints The value cannot be changed. Range The value is fixed at AddonCheck. Default Value AddonCheck |
apiVersion |
String |
Definition API version. Constraints The value cannot be changed. Range The value is fixed at v3. Default Value v3 |
spec |
AddonCheckSpec object |
Definition Details of an add-on check. Constraints N/A |
status |
AddonCheckStatus object |
Definition Results of creating an add-on check task, including the task ID for querying the add-on check result. Constraints N/A |
Parameter |
Type |
Description |
|---|---|---|
clusterID |
String |
Definition Cluster ID. Constraints N/A Range N/A Default Value N/A |
addonList |
Array of AddonInfo objects |
Definition Add-on check information list, including the name of the add-on template to be checked, add-on instance ID, and add-on upgrade configuration. Constraints N/A |
Parameter |
Type |
Description |
|---|---|---|
addonTemplateName |
String |
Definition Add-on template name. Constraints N/A Range Add-on template supported by CCE. Default Value N/A |
addonInstanceID |
String |
Definition Add-on instance ID, which can be obtained from the items[].metadata.uid field in Listing Add-on Instances. Constraints This parameter is mandatory. Range N/A Default Value N/A |
targetVersion |
String |
Definition Target version of an add-on upgrade. Constraints This parameter is mandatory in the add-on upgrade scenario. Range Add-on version provided by CCE. You can obtain the value from the items[].spec.versions.version field in Listing Add-on Templates. Default Value N/A |
type |
String |
Definition Add-on check type. Constraints This parameter is mandatory. Range Default Value N/A |
values |
Map<String,Object> |
Definition Add-on template edit or upgrade parameters (which vary depending on add-ons). Set the parameters accordingly. Constraints N/A |
Parameter |
Type |
Description |
|---|---|---|
items |
Array of AddonCheckTask objects |
Definition Add-on check task list, including the add-on check task ID, add-on template name, and add-on instance ID. Constraints N/A |
Parameter |
Type |
Description |
|---|---|---|
metadata |
CheckTaskMetadata object |
Definition Basic information. Metadata is a collection of attributes. Constraints N/A |
spec |
CheckTaskSpec object |
Definition Target information of an add-on check, including the target version of an add-on upgrade. Constraints N/A |
status |
CheckTaskStatus object |
Definition Add-on check task status. Constraints N/A |
Parameter |
Type |
Description |
|---|---|---|
type |
String |
Definition Add-on check type. Range |
taskID |
String |
Definition Add-on check task ID, which is used to query the task check result. Range N/A |
addonTemplateName |
String |
Definition Add-on template name. Range Add-on template provided by CCE. You can obtain the value from the items[].metadata.name field in Listing Add-on Templates. |
addonInstanceName |
String |
Definition Add-on instance name. Range N/A |
addonInstanceID |
String |
Definition Add-on instance ID. Range N/A |
createTimeStamp |
String |
Definition Creation time of an add-on check task. Range N/A |
expireTimeStamp |
String |
Definition Timeout duration of an add-on check task. This field is available only for tasks in the Failed or Success state. Range N/A |
Parameter |
Type |
Description |
|---|---|---|
addonTargetVersion |
String |
Definition Target version of an add-on upgrade. Range N/A |
Parameter |
Type |
Description |
|---|---|---|
status |
String |
Definition Status of an add-on check. Range |
message |
String |
Definition Add-on check results. Range N/A |
riskList |
Array of CheckTaskRisk objects |
Definition List of risk items during an add-on check. The risk items vary according to add-ons. Constraints N/A |
Create a CoreDNS add-on check task and set the check type to add-on inspection.
POST /api/v3/projects/{project_id}/clusters/{cluster_id}/addons/precheck
{
"kind" : "AddonCheck",
"apiVersion" : "v3",
"spec" : {
"clusterID" : "6b400e1c-4368-11f0-ba56-0255ac100037",
"addonList" : [ {
"addonTemplateName" : "coredns",
"addonInstanceID" : "8fcaa506-809d-4f33-91b3-b27efcbeb540",
"type" : "addonStatic"
} ]
}
}
Status code: 201
The add-on check tasks have been created in batches in the cluster.
{
"kind" : "AddonCheck",
"apiVersion" : "v3",
"spec" : {
"clusterID" : "6b400e1c-4368-11f0-ba56-0255ac100037",
"addonList" : [ {
"addonTemplateName" : "coredns",
"addonInstanceID" : "8fcaa506-809d-4f33-91b3-b27efcbeb540",
"type" : "addonUpgrade",
"values" : {
"basic" : {
"cluster_ip" : "10.247.3.10",
"image_version" : "1.17.15",
"platform" : "linux-amd64",
"rbac_enabled" : true,
"swr_addr" : "",
"swr_user" : "hwofficial"
},
"custom" : {
"cluster_id" : "8fcaa506-809d-4f33-91b3-b27efcbeb540",
"stub_domains" : { },
"tenant_id" : "0504201b6c80256b2f08c0099f0c8fe4",
"upstream_nameservers" : [ ]
},
"flavor" : {
"name" : 2500,
"replicas" : 2,
"resources" : [ {
"limitsCpu" : "500m",
"limitsMem" : "512Mi",
"name" : "coredns",
"requestsCpu" : "500m",
"requestsMem" : "512Mi"
} ]
}
}
} ]
},
"status" : {
"items" : [ {
"metadata" : {
"type" : "addonUpgrade",
"taskID" : "22386048-d955-4409-bc71-20cc2b774245",
"addonTemplateName" : "coredns",
"addonInstanceName" : "cceaddon-coredns",
"addonInstanceID" : "8fcaa506-809d-4f33-91b3-b27efcbeb540",
"createTimeStamp" : "2025-08-13T11:24:37.312017086+08:00"
},
"spec" : {
"addonTargetVersion" : "1.27.1"
},
"status" : {
"status" : "Init",
"riskList" : [ {
"riskName" : "K8sResourceModified",
"status" : "Init",
"level" : "Warning"
}, {
"riskName" : "AddonValidate",
"status" : "Init",
"level" : "Warning"
}, {
"riskName" : "AddonStatus",
"status" : "Init",
"level" : "Warning"
} ]
}
} ]
}
}
Status Code |
Description |
|---|---|
201 |
The add-on check tasks have been created in batches in the cluster. |
See Error Codes.