Updating a Specified Node
Function
This API is used to update information about a specified node.

-
Currently, only the name field in metadata can be updated. This field indicates the node name.
-
The URL for cluster management is in the format of https://Endpoint/uri. In the URL, uri indicates the resource path, that is, the path for API access.
Calling Method
For details, see Calling APIs.
URI
PUT /api/v3/projects/{project_id}/clusters/{cluster_id}/nodes/{node_id}
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 |
node_id |
Yes |
String |
Definition Node ID. For details about how to obtain the value, see How to Obtain Parameters in the API URI. Constraints N/A Range N/A Default Value N/A |
Request Parameters
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 |
---|---|---|---|
metadata |
Yes |
Definition Metadata of a node, which is a collection of attributes Constraints N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Definition Node name Constraints The node name must contain 1 to 56 characters that start with a lowercase letter and not end with a hyphen (-). Only lowercase letters, digits, hyphens (-), and periods (.) are allowed. Range N/A Default Value N/A
NOTE:
After the node name is changed, the ECS name (VM name) will be changed accordingly.
|
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
kind |
String |
Definition API type Constraints The value cannot be changed. Range N/A Default Value Node |
apiVersion |
String |
Definition API version Constraints The value cannot be changed. Range N/A Default Value v3 |
metadata |
NodeMetadata object |
Definition Metadata of a node, which is a collection of attributes Constraints N/A |
spec |
NodeSpec object |
Definition Details about a node. CCE creates or updates objects by defining or updating spec. Constraints N/A |
status |
NodeStatus object |
Definition Node status, which is dynamically recorded. Specifying node status during creation or modification is unnecessary and has no effect. Constraints N/A |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Definition Node name Constraints If the number of nodes (count) is greater than 1, some random characters are added to the end of the entered node name according to the default rule, which is entered-name-random-characters. If the length of the entered node name exceeds 50 characters, CCE uses the first 50 characters and adds random characters to the end of the node name. Range The node name must contain 1 to 56 characters that start with a lowercase letter and not end with a hyphen (-). Only lowercase letters, digits, hyphens (-), and periods (.) are allowed. Default Value If name is not specified or is set to an empty string, the node name is generated based on the default rule, which is cluster-name-random-characters. If the cluster name is too long, only the first 36 characters are used. |
uid |
String |
Definition Node ID, which uniquely identifies a node Constraints The value is automatically generated after the object is created. A user-defined value will not take effect. Range N/A Default Value N/A |
annotations |
Map<String,String> |
Definition CCE node annotations, in key-value pairs (not the native Kubernetes annotations) Example: "annotations": { "key1" : "value1", "key2" : "value2" } Constraints This parameter is only used for query and cannot be input through a request. Entered data of this parameter is invalid. Range Annotations are not used to identify or select objects. The metadata in annotations may be small or large, structured or unstructured, and may include characters that are not allowed in labels. Default Value N/A |
creationTimestamp |
String |
Definition Time when a node was created Constraints The value is automatically generated after the object is created. A user-defined value will not take effect. Range N/A Default Value N/A |
updateTimestamp |
String |
Definition Time when a node was updated Constraints The value is automatically generated after the object is created. A user-defined value will not take effect. Range N/A Default Value N/A |
ownerReferences |
ownerReferences object |
Definition Owner object Constraints
Range N/A Default Value N/A |
Parameter |
Type |
Description |
---|---|---|
nodepoolName |
String |
Definition Node pool name Constraints The value is automatically generated after the object is created. A user-defined value will not take effect. Range N/A Default Value N/A |
nodepoolID |
String |
Definition Node pool ID Constraints The value is automatically generated after the object is created. A user-defined value will not take effect. Range N/A Default Value N/A |
Parameter |
Type |
Description |
---|---|---|
flavor |
String |
Details: Node flavors. For details about the node flavors supported by CCE clusters, see Node Specifications. Constraints: None Options: N/A Default value: N/A |
az |
String |
Details: AZ where the node to be created is located. You need to specify the AZ name. Random AZs will not be allocated to a node created using APIs. For details about AZs supported by CCE, see Regions and Endpoints. Constraints: When you are creating a node pool and configuring a scaling group, this parameter cannot be set to random. Options: N/A Default value: N/A |
os |
String |
Details: OS type of a node. For details about the supported OSs, see Node OSs. Constraints:
Options: N/A Default value: N/A |
login |
Login object |
Definition How to log in to a node. If this parameter is not specified, the password of the selected image will be kept. Ensure that you have set a password for the image. Constraints N/A |
rootVolume |
Volume object |
Details: Disk information of a node Constraints: None |
dataVolumes |
Array of Volume objects |
Details: Data disk parameters of a node. For DeC nodes, the parameter details are the same as those in rootVolume. Constraints:
|
storage |
Storage object |
Details: Disk initialization management parameter. This parameter is complex to configure. For details, see Attaching Disks to a Node. Constraints:
|
publicIP |
NodePublicIP object |
Details: EIP of a node Constraints: This parameter is not supported when you add a node during node pool creation. |
nodeNicSpec |
NodeNicSpec object |
Details: ENI of a node Constraints: None |
count |
Integer |
Definition Number of nodes that can be created at a time Constraints
Range Positive integers that are greater than or equal to 1 and less than or equal to the maximum limit Default Value N/A |
billingMode |
Integer |
Definition Billing mode of a node Constraints N/A Range
Default Value 0 |
taints |
Array of Taint objects |
Details: Taints, which can be added to nodes for anti-affinity configuration. Each taint contains the following parameters:
When creating a node, you can specify the initial value for this parameter and this field is not returned during query. In node pools, the initial value can be specified in the node template and this field is returned during query. In other scenarios, this field is not returned during query. Example: "taints": [{ "key": "status", "value": "unavailable", "effect": "NoSchedule" }, { "key": "looks", "value": "bad", "effect": "NoSchedule" }] Constraints: A maximum of 20 taints can be configured. |
waitPostInstallFinish |
Boolean |
Definition Whether pods can be scheduled onto a node before the post-installation script has completed execution during node creation. If this parameter is not specified or is set to false, pods can be scheduled to an available node after the Kubernetes node is ready. If this parameter is set to true, pods can be scheduled to an available node only after the Kubernetes node is ready and the post-installation script has been executed. Constraints N/A Range
Default Value false |
k8sTags |
Map<String,String> |
Details: Defined in key-value pairs.
When creating a node, you can specify the initial value for this parameter and this field is not returned during query. In node pools, the initial value can be specified in the node template and this field is returned during query. In other scenarios, this field is not returned during query. Example: "k8sTags": { "key": "value" } Constraints: A maximum of 20 key-value pairs are allowed. |
ecsGroupId |
String |
Definition ECS group ID. If this parameter is specified, nodes will be created in the specific ECS group. Constraints This configuration does not take effect during node pool creation or updates. To ensure that all nodes in a node pool are in the same ECS group, configure nodeManagement in the node pool. Range N/A Default Value N/A |
dedicatedHostId |
String |
Definition ID of the DeH to which nodes will be scheduled Constraints This parameter is not supported when you add a node during node pool creation. Range N/A Default Value N/A |
userTags |
Array of UserTag objects |
Details: Cloud server resource tags. When creating a node, you can specify an initial value for this field and this field is not returned during query. In node pools, the initial value can be specified in the node template and this field is returned during query. In other scenarios, this field is not returned during query. Constraints:
|
runtime |
Runtime object |
Details: Container runtime
Constraints: None |
initializedConditions |
Array of strings |
Details: Custom initialization flag, which is left blank by default. Before CCE nodes are initialized, they are tainted with node.cloudprovider.kubernetes.io/uninitialized to prevent pods from being scheduled to them. When creating a node, you can specify the initializedConditions parameter to control the taint removal time. By default, the timeout interval is not configured. Example:
status: conditions: - type: CCEInitial status: 'True' - type: CustomedInitial status: 'True' Constraints:
|
extendParam |
NodeExtendParam object |
Details: Extended parameters for creating a node Constraints: None |
hostnameConfig |
HostnameConfig object |
Details: Kubernetes node name configuration parameter Constraints: The supported cluster version is v1.23.6-r0 to v1.25 or v1.25.2-r0 or later. |
serverEnterpriseProjectID |
String |
Details: Enterprise project ID of a server. CCE does not support features provided by EPS. This field is used only for synchronizing enterprise project IDs of servers. Constraints: To create a node or node pool, you can specify an existing enterprise project for it. If this field is left blank, it inherits the enterprise project attributes of the cluster that runs the node or node pool. When updating a node pool, any configuration modifications you made will apply only to new nodes. You need to modify the enterprise projects of existing nodes on the EPS console. Options: N/A Default value: If no value is specified during the update, this field will not be updated. If this parameter is left blank, the cluster enterprise project is returned. |
partition |
String |
Details: Zone that a node belongs to. It can be the central cloud or an edge site. Constraints: This field can be specified only for CCE Turbo clusters that support distributed clouds. Options:
Default value: N/A |
nodeNameTemplate |
nodeNameTemplate object |
Details: Fixed prefix and suffix of node names. Assume that different node pools in a cluster are used by different departments of a company. You can use the prefix and suffix to distinguish the departments and how they use the nodes. For example, you can set nodeNamePrefix to finance- to indicate the department name, set nodeNameSuffix to -product to indicate the production usage, and set the node pool name to gpu to indicate the service type. The nodes will have names in the format of finance-gpu(Five random digits)-product. Constraints: This function is only supported by clusters of v1.28.1, v1.27.3, v1.25.6, v1.23.11, v1.21.12, or later. This parameter is only valid for node pools. Options: N/A Default value: N/A |
Parameter |
Type |
Description |
---|---|---|
sshKey |
String |
Details: Name of the key pair used for login Constraints: None Options: N/A Default value: N/A |
userPassword |
UserPassword object |
Details: Password used for node login Constraints: None |
removeUserPassword |
Boolean |
Definition Whether to remove the password login setting of a node pool during the node pool update Constraints This parameter is supported only during node pool updates. If it is set to true, no user password can be specified. Range N/A Default Value false |
removeSSHKey |
Boolean |
Definition Whether to remove the key pair login setting of a node pool during the node pool update Constraints This parameter is supported only during node pool updates. If it is set to true, no SSH key can be specified. Range N/A Default Value false |
Parameter |
Type |
Description |
---|---|---|
username |
String |
Details: Login account. The default value is root. Constraints: None Options: N/A Default value: root |
password |
String |
Details: Login password. If a username and password are used when a node is created, this field is shielded in the response body. Constraints: The password field must be salted during node creation. For details, see Adding a Salt in the password Field When Creating a Node. Options: A password must:
Default value: N/A |
Parameter |
Type |
Description |
---|---|---|
size |
Integer |
Details: Disk size, in GiB Constraints: None Options:
Default value: N/A |
volumetype |
String |
Details: Disk type. For details about possible values, see the root_volume parameter in the API used to create an ECS. Constraints: None Options:
NOTE:
For details about disk types, see Disk Types and Performance.
Default value: N/A |
extendParam |
Map<String,Object> |
Details: Extended disk parameters, defined in extendparam in the API used to create an ECS. For details, see extendparam Field Description for Creating Disks. Constraints: None |
cluster_id |
String |
Details: ID of the storage pool used by the ECS system disk. This field is used only for DeC clusters and functions as dssPoolID, that is, the ID of the DSS storage pool. To obtain the value, see the ID field in the API used to obtain details of a DSS storage pool. Constraints: None Options: N/A Default value: N/A |
cluster_type |
String |
Details: Storage class of the ECS system disk Constraints: None Options: This field is used only for DeC clusters, and the value is always dss. Default value: N/A |
hw:passthrough |
Boolean |
Details:
Constraints: None Options: N/A Default value: N/A |
metadata |
VolumeMetadata object |
Details: EVS disk encryption information. This parameter is mandatory only when the system disk or data disk of the node to be created needs to be encrypted. Constraints: None |
Parameter |
Type |
Description |
---|---|---|
__system__encrypted |
String |
Details: Whether an EVS disk is encrypted. The value 0 indicates that the EVS disk is not encrypted, and the value 1 indicates that the EVS disk is encrypted. Constraints: None Options: N/A Default value: If this parameter does not appear, the disk is not encrypted. |
__system__cmkid |
String |
Details: CMK ID, which indicates encryption in metadata. This field is used with __system__encrypted. Constraints: None Options: N/A Default value: N/A |
Parameter |
Type |
Description |
---|---|---|
storageSelectors |
Array of StorageSelectors objects |
Details: Disk selection. Matched disks are managed based on matchLabels and storageType settings. Disks are matched in sequence. The matching rule in the front is matched first. Constraints: None |
storageGroups |
Array of StorageGroups objects |
Details: A storage group consisting of multiple storage devices, which are used to divide storage space. Constraints: None |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Details: Name of a selector, which is used as the index of selectorNames in storageGroup. Constraints: The name of each selector must be unique. Options: N/A Default value: N/A |
storageType |
String |
Details: Storage type Constraints:
Options: Only evs (EVS disks), local (local disks), and system (system disks) are supported. Default value: N/A |
matchLabels |
matchLabels object |
Details: Matching field of an EVS disk Constraints: If storageType is set to system (system disk), you do not need to configure this parameter. Options: The size, volumeType, metadataEncrypted, metadataCmkid, and count fields in DataVolume are supported. Default value: N/A |
Parameter |
Type |
Description |
---|---|---|
size |
String |
Details: Matched disk size, for example, 100. If this parameter is left blank, the disk size is not limited. Constraints: None Options: N/A Default value: N/A |
volumeType |
String |
Definition EVS disk type. Supported types include SSD, GPSSD, SAS, ESSD, and SATA. If this parameter is left empty, there is no restriction on the EVS disk type. Constraints N/A Range N/A Default Value N/A |
metadataEncrypted |
String |
Details: Disk encryption identifier. If this parameter is set to 0, it specifies that the disk is not encrypted. If this parameter is set to 1, it specifies that the disk is encrypted. If this parameter is left blank, there is no restriction on the disk encryption identifier. Constraints: None Options: N/A Default value: N/A |
metadataCmkid |
String |
Details: CMK ID of an encrypted disk. The value is a string of 36 bytes. If this parameter is left blank, there is no restriction on the disk key ID. Constraints: None Options: N/A Default value: N/A |
count |
String |
Details: Number of disks to be selected. If this parameter is left blank, all disks of this type are selected. Constraints: None Options: N/A Default value: N/A |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Details: Name of a virtual storage group, which must be unique Constraints: None Options:
Default value: N/A |
cceManaged |
Boolean |
Details: Storage space to which Kubernetes and runtime belong. Only one group is set to true. If this parameter is left blank, the default value false is used. Constraints: None Options: N/A Default value: N/A |
selectorNames |
Array of strings |
Details: Corresponds to name in storageSelectors. One group can select multiple selectors, but one selector can be selected by only one group. Constraints: System components cannot be separately stored in the system disk and data disks. Therefore, when the selector type is set to system, only one selector can be selected for a group. |
virtualSpaces |
Array of VirtualSpace objects |
Details: Detailed management of space configurations in a group Constraints: None |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Details: Name of a virtualSpace. Only types of share, kubernetes, runtime, and user are supported. Constraints: None Options:
Default value: N/A |
size |
String |
Details: Size of a virtualSpace. The value must be an integer in percentage, for example, 90%. Constraints: None Options: 10 to 90. The sum of percentages of all virtualSpaces in a group cannot exceed 100%. Default value: N/A |
lvmConfig |
LVMConfig object |
Details: LVM configuration management, which is applicable to share, Kubernetes, and user space configuration Constraints: One virtualSpace supports only one config. |
runtimeConfig |
RuntimeConfig object |
Details: Runtime configuration management, which is applicable to runtime space configuration Constraints: One virtualSpace supports only one config. |
Parameter |
Type |
Description |
---|---|---|
lvType |
String |
Details: LVM write mode. linear indicates the linear mode. striped indicates the striped mode, in which multiple disks are used to form a strip to improve disk performance. Constraints: None Options: N/A Default value: N/A |
path |
String |
Details: Disk mount path. This parameter only takes effect in user configuration. The value can be an absolute path containing digits, uppercase letters, lowercase letters, periods (.), hyphens (-), and underscores (_). Constraints: Do not leave the path empty or set it to a key OS path such as the root directory. Key OS paths that cannot be entered: /, /home, /home/, /bin, /bin/, /lib, /lib/, /root, /root/, /boot, /boot/, /dev, /dev/, /etc, /etc/, /lost+found, /lost+found/, /mnt, /mnt/, /proc, /proc/,/sbin, /sbin/, /srv, /srv/, /tmp, /tmp/, /var, /var/, /media, /media/, /opt, /opt/, /selinux, /selinux/, /sys, /sys/, /usr, /usr/, /opt/cloud/, /mnt/paas/, /home/paas/, /var/paas/, /var/lib/, /var/script/ Options: N/A Default value: N/A |
Parameter |
Type |
Description |
---|---|---|
lvType |
String |
Details: LVM write mode. linear indicates the linear mode. striped indicates the striped mode, in which multiple disks are used to form a strip to improve disk performance. Constraints: None Options: N/A Default value: N/A |
Parameter |
Type |
Description |
---|---|---|
ids |
Array of strings |
Details: IDs of existing EIPs Constraints:
|
count |
Integer |
Details: Number of EIPs to be dynamically created Constraints: count and eip must be configured simultaneously. Options: N/A Default value: N/A |
eip |
NodeEIPSpec object |
Details: EIP configuration Constraints: This parameter is not supported when you create a node pool. |
Parameter |
Type |
Description |
---|---|---|
iptype |
String |
Details: EIP type, specified in publicip.type in the API for assigning an EIP. For details, see Assigning an EIP. Constraints: None Options: N/A Default value: N/A |
bandwidth |
NodeBandwidth object |
Details: Bandwidth parameters of the EIP Constraints: None |
Parameter |
Type |
Description |
---|---|---|
chargemode |
String |
Details: Bandwidth billing mode
NOTE:
Constraints: None Options:
Default value: N/A |
size |
Integer |
Details: Bandwidth size, specified in bandwidth.size in the API for assigning an EIP. For details, see Assigning an EIP. Constraints: None Options: N/A Default value: N/A |
sharetype |
String |
Details: Bandwidth sharing type. Dedicated bandwidth is supported only. PER specifies dedicated bandwidth. Constraints: None Options: N/A Default value: N/A |
Parameter |
Type |
Description |
---|---|---|
primaryNic |
NicSpec object |
Details: Description of the primary ENI Constraints: None |
extNics |
Array of NicSpec objects |
Details: Extension ENI Constraints: This parameter is not supported when you add a node during node pool creation. |
Parameter |
Type |
Description |
---|---|---|
subnetId |
String |
Details: Network ID of the subnet to which an ENI belongs. If subnetList is also configured for a node pool, the subnetList field is used for adding subnets to the node pool. Constraints:
Options: N/A Default value: N/A |
fixedIps |
Array of strings |
Definition The IP address of a primary network interface is specified using fixedIps. The number of IP addresses cannot be greater than the number of created nodes. Constraints
|
ipBlock |
String |
Definition CIDR format of the IP address range of the primary network interface. The IP address of a created node falls in this range. Constraints
Range N/A Default Value N/A |
subnetList |
Array of strings |
Details: Network ID list of the subnet where the ENI resides. Multiple subnets can be configured for a node pool. Constraints: A maximum of 20 subnets can be configured. |
Parameter |
Type |
Description |
---|---|---|
key |
String |
Definition Key of a Kubernetes taint Constraints The value must contain 1 to 63 characters starting and ending with a letter or digit. Only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed. Range N/A Default Value N/A |
value |
String |
Definition Value of a Kubernetes taint Constraints The value must contain 1 to 63 characters starting and ending with a letter or digit. Only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed. Range N/A Default Value N/A |
effect |
String |
Definition Effect of a Kubernetes taint Constraints N/A Range NoSchedule, PreferNoSchedule, and NoExecute Default Value N/A |
Parameter |
Type |
Description |
---|---|---|
key |
String |
Details: Key of the cloud server tag Constraints: The value cannot start with CCE-, __type_baremetal, or sys. Options: The value contains a maximum of 128 characters. The tag key must be unique and cannot start or end with a space. It cannot contain non-printable ASCII characters (0–31) or the following special characters: =*<>,|/ Default value: N/A |
value |
String |
Details: Value of the cloud server tag Constraints: None Options: The value contains a maximum of 255 characters. The tag value cannot start or end with a space. It cannot contain non-printable ASCII characters (0–31) or the following special characters: =*<>,| Default value: N/A |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Details: Container runtime Constraints: None Options: N/A Default value:
|
Parameter |
Type |
Description |
---|---|---|
ecs:performancetype |
String |
Details: ECS flavor types. This field is returned in the response. Constraints: None Options: N/A Default value: N/A |
orderID |
String |
Definition Order ID Constraints This parameter is included in the responses only during node creation if the node is billed on a yearly/monthly basis with auto payment enabled. It is not returned in the responses related to node pools. Range N/A Default Value N/A |
productID |
String |
Definition Product ID Constraints This parameter is included in the responses if the node is billed on a yearly/monthly basis with auto payment enabled or the node pool is billed on a yearly/monthly basis. Range N/A Default Value N/A |
maxPods |
Integer |
Details: Maximum number of pods that can be created on a node, including the default system pods. This limit prevents the node from being overloaded with pods. The number of pods that can be created on a node is determined by multiple parameters. For details, see Maximum Number of Pods That Can Be Created on a Node. Constraints: None Options: 16 to 256 Default value: N/A |
periodType |
String |
Details: Subscription term unit Constraints:
Options:
Default value: N/A |
periodNum |
Integer |
Details: Number of subscription periods Constraints:
Options:
Default value: N/A |
isAutoRenew |
String |
Details: Whether auto-renewal is enabled Constraints: This field is valid when billingMode is set to 1 or 2 (deprecated). If not specified, auto-renewal is not enabled. Options:
Default value: N/A |
isAutoPay |
String |
Details: Whether an order is automatically or manually paid Constraints: This field is valid when billingMode is set to 1 or 2 (deprecated). If not specified when billingMode is set to 1, auto payment is not enabled. If not specified when billingMode is set to 2 (deprecated), auto payment is enabled. Options:
Default value: N/A |
DockerLVMConfigOverride |
String |
Details: Docker data disk configuration item. (This parameter has been deprecated. Use the storage field instead.) Example of the default configuration: "DockerLVMConfigOverride":"dockerThinpool=vgpaas/90%VG;kubernetesLV=vgpaas/10%VG;diskType=evs;lvType=linear" By default, if no VD disk is available, an error occurs because the data disk fails to be found. Specify diskType based on the actual drive letter type. Constraints: None Options: The following fields are included:
Default value: N/A |
dockerBaseSize |
Integer |
Definition Available disk space of a single container on a node (unit: G). This parameter has been deprecated. Use containerBaseSize. For details about how to allocate the space for the container runtime, see Data Disk Space Allocation. Constraints
Range 10 to 500 Default Value If the value is not specified or is set to 0, the default value is used.
|
containerBaseSize |
Integer |
Details: Available disk space of a single container on a node (unit: G). For details about how to allocate the space for the container runtime, see Space Allocation of a Data Disk. Constraints: When Device Mapper is used, it is recommended that containerBaseSize be set to a value less than or equal to 80 GiB. If the value is too large, the container runtime may fail to be started due to long initialization. If there are special requirements for the container disk space, you can mount an external or local storage device. In new versions, the Device Mapper mode is used only by BMSs in the same resource pool and is being deprecated.
Options: 10 to 500 Default value: If the value is not specified or is set to 0, the default value is used.
|
publicKey |
String |
Definition Public key of a node, which is used for SSH key login Constraints
Range N/A Default Value N/A |
alpha.cce/preInstall |
String |
Details: Pre-installation script. The input value must be encoded using Base64. The method is as follows: echo -n "*Content to be encoded*" | base64 Constraints: The characters of both the pre-installation and post-installation scripts are centrally calculated, and the total number of characters after transcoding cannot exceed 10,240. Options: N/A Default value: N/A |
alpha.cce/postInstall |
String |
Details: Post-installation script. The input value must be encoded using Base64. The method is as follows: echo -n "*Content to be encoded*" | base64 Constraints: The characters of both the pre-installation and post-installation scripts are centrally calculated, and the total number of characters after transcoding cannot exceed 10,240. Options: N/A Default value: N/A |
alpha.cce/NodeImageID |
String |
Definition Private image ID of a node, which is obtained from the IMS console. This parameter is required when private images are used. Constraints N/A Range N/A Default Value N/A |
chargingMode |
Integer |
Details: Billing mode of a node. This parameter has been deprecated. Use billingMode in NodeSpec instead. Constraints: None Options: N/A Default value: N/A |
marketType |
String |
Details: When creating a spot ECS, this parameter should be set to spot. Constraints: This parameter is valid only when billingMode is set to 0. Options: N/A Default value: N/A |
spotPrice |
String |
Details: The highest price per hour a user accepts for a spot ECS Constraints:
Options: N/A Default value: N/A |
agency_name |
String |
Details: Agency name. An agency is created by a tenant administrator on Identity and Access Management (IAM) to provide temporary credentials for CCE nodes to access cloud servers. This parameter is returned only when it is transferred during node creation. Constraints: None Options: N/A Default value: N/A |
kubeReservedMem |
Integer |
Details: Reserved node memory, which is reserved for Kubernetes components. Constraints: None Options: N/A Default value: N/A |
systemReservedMem |
Integer |
Details: Reserved node memory, which is reserved for system components. Constraints: None Options: N/A Default value: N/A |
init-node-password |
String |
Definition Node password. If this parameter is used only in a response, asterisks (*) are displayed. It is not returned in the responses related to node pools. Constraints N/A Range N/A Default Value N/A |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Details: Configuration type of the Kubernetes node name. The default value is privateIp. Constraints:
Options:
Default value: privateIp |
Parameter |
Type |
Description |
---|---|---|
nodeNamePrefix |
String |
Definition Node name prefix. If this parameter is left empty or set to the default value, no prefix will be added to the node name. Constraints Only lowercase letters, digits, hyphens (-), and periods (.) are allowed. The value must start with a lowercase letter and comply with the DNS subdomain naming rules defined in RFC 1123. Range N/A Default Value N/A |
nodeNameSuffix |
String |
Definition Node name suffix. If this parameter is left empty or set to the default value, no suffix will be added to the node name. Constraints Only lowercase letters, digits, hyphens (-), and periods (.) are allowed. The suffix must end with a lowercase letter or digit and comply with the DNS subdomain naming rules defined in RFC 1123. Range N/A Default Value N/A |
Parameter |
Type |
Description |
---|---|---|
phase |
String |
Definition Node status Constraints This parameter is not present in the response of the API for creating a node. Range Node resource lifecycle management (such as installation and uninstallation) status and Kubernetes node status in a cluster. The options include:
Default Value N/A |
lastProbeTime |
String |
Definition Last time when the node status was checked. If the cluster is in the abnormal, frozen, or intermediate state (for example, creating), the node status check may be affected. If checking a node's status takes longer than 5 minutes, the result is considered meaningless. Constraints This parameter is not present in the response of the API for creating a node. Range N/A |
jobID |
String |
Definition Job ID during creation or deletion Range N/A |
serverId |
String |
Definition ID of the underlying ECS or BMS node Constraints This parameter is not present in the response of the API for creating a node. Range N/A |
privateIP |
String |
Definition Private IP address of the primary network interface on a node Constraints This parameter is not present in the response of the API for creating a node. Range N/A |
privateIPv6IP |
String |
Definition Private IPv6 address of the primary network interface on a node Constraints This parameter is not present in the response of the API for creating a node. Range N/A |
publicIP |
String |
Definition Node EIP. If the ECS data is not synchronized in real time, you can synchronize the node data through the console. Constraints This parameter is not present in the response of the API for creating a node. Range N/A |
deleteStatus |
DeleteStatus object |
Definition Resource status during resource deletion Constraints This parameter is returned only when a node is deleted. Range N/A |
configurationUpToDate |
Boolean |
Definition Whether the node configuration is consistent with the latest configuration of the node template in the node pool to which the node belongs. When a node pool's OS or runtime is updated, the existing nodes may have a different OS or runtime, causing configurationUpToDate to be false. However, resetting the nodes will synchronize their OSs and runtimes with the node pool, setting configurationUpToDate to true. Constraints This parameter is not present in the response of the API for creating or updating a node. Range N/A |
Parameter |
Type |
Description |
---|---|---|
previous_total |
Integer |
Definition The total number of existing cluster resource records during node deletion Range N/A |
current_total |
Integer |
Definition The latest number of resource records. This number is generated based on the current cluster resource records. Range N/A |
updated |
Integer |
Definition The total number of to-be-deleted resource records updated during node deletion Range N/A |
added |
Integer |
Definition The total number of to-be-deleted resource records added during node deletion Range N/A |
deleted |
Integer |
Definition The total number of resource records deleted during node deletion Range N/A |
Example Requests
Update the name of a specified node.
{ "metadata" : { "name" : "new-hostname" } }
Example Responses
Status code: 200
Information about the specified node is successfully updated.
{ "kind" : "Node", "apiVersion" : "v3", "metadata" : { "name" : "new-hostname", "uid" : "4d1ecb2c-229a-11e8-9c75-0255ac100ceb", "creationTimestamp" : " 2017-08-20T21:11:09Z", "updateTimestamp" : "2017-08-20T21:11:09Z", "annotations" : { "kubernetes.io/node-pool.id" : "az1.dc1#s1.medium#EulerOS 2.2" } }, "spec" : { "flavor" : "s1.medium", "az" : "az1.dc1", "os" : "EulerOS 2.2", "login" : { "sshKey" : "KeyPair-001" }, "rootVolume" : { "volumetype" : "SAS", "size" : 40 }, "dataVolumes" : [ { "volumetype" : "SAS", "size" : 100 } ], "publicIP" : { "eip" : { } }, "billingMode" : 0 }, "status" : { "phase" : "Active", "serverId" : "456789abc-9368-46f3-8f29-d1a95622a568", "publicIP" : "10.34.56.78", "privateIP" : "192.168.1.23" } }
SDK Sample Code
The SDK sample code is as follows.
Update the name of a specified node.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.cce.v3.region.CceRegion; import com.huaweicloud.sdk.cce.v3.*; import com.huaweicloud.sdk.cce.v3.model.*; public class UpdateNodeSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); String projectId = "{project_id}"; ICredential auth = new BasicCredentials() .withProjectId(projectId) .withAk(ak) .withSk(sk); CceClient client = CceClient.newBuilder() .withCredential(auth) .withRegion(CceRegion.valueOf("<YOUR REGION>")) .build(); UpdateNodeRequest request = new UpdateNodeRequest(); request.withClusterId("{cluster_id}"); request.withNodeId("{node_id}"); ClusterNodeInformation body = new ClusterNodeInformation(); ClusterNodeInformationMetadata metadatabody = new ClusterNodeInformationMetadata(); metadatabody.withName("new-hostname"); body.withMetadata(metadatabody); request.withBody(body); try { UpdateNodeResponse response = client.updateNode(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } } |
Update the name of a specified node.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkcce.v3.region.cce_region import CceRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkcce.v3 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] projectId = "{project_id}" credentials = BasicCredentials(ak, sk, projectId) client = CceClient.new_builder() \ .with_credentials(credentials) \ .with_region(CceRegion.value_of("<YOUR REGION>")) \ .build() try: request = UpdateNodeRequest() request.cluster_id = "{cluster_id}" request.node_id = "{node_id}" metadatabody = ClusterNodeInformationMetadata( name="new-hostname" ) request.body = ClusterNodeInformation( metadata=metadatabody ) response = client.update_node(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) |
Update the name of a specified node.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" cce "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cce/v3" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cce/v3/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cce/v3/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") projectId := "{project_id}" auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). WithProjectId(projectId). Build() client := cce.NewCceClient( cce.CceClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.UpdateNodeRequest{} request.ClusterId = "{cluster_id}" request.NodeId = "{node_id}" metadatabody := &model.ClusterNodeInformationMetadata{ Name: "new-hostname", } request.Body = &model.ClusterNodeInformation{ Metadata: metadatabody, } response, err := client.UpdateNode(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.
Status Codes
Status Code |
Description |
---|---|
200 |
Information about the specified node is successfully updated. |
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