doc-exports/docs/cce/api-ref/cce_02_0245.html
Dong, Qiu Jian a08f68fbc7 CCE API 20230213 version
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com>
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
Co-committed-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
2023-04-18 18:52:05 +00:00

237 lines
14 KiB
HTML

<a name="cce_02_0245"></a><a name="cce_02_0245"></a>
<h1 class="topictitle1">Updating a Specified Node</h1>
<div id="body1521448221833"><div class="section" id="cce_02_0245__section1686113493165"><h4 class="sectiontitle">Function</h4><p id="cce_02_0245__p209621357141610">This API is used to update information about a specified node.</p>
</div>
<div class="section" id="cce_02_0245__section8403243161416"><h4 class="sectiontitle">URI</h4><p id="cce_02_0245__p23575517439">PUT /api/v3/projects/{project_id}/clusters/{cluster_id}/nodes/{node_id}</p>
<p id="cce_02_0245__p2037362514220"><a href="#cce_02_0245__table2027961241820">Table 1</a> describes the parameters of the API.</p>
<div class="tablenoborder"><a name="cce_02_0245__table2027961241820"></a><a name="table2027961241820"></a><table cellpadding="4" cellspacing="0" summary="" id="cce_02_0245__table2027961241820" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="cce_02_0245__row122809120186"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.4.1.1"><p id="cce_02_0245__p91421758131813">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12%" id="mcps1.3.2.4.2.4.1.2"><p id="cce_02_0245__p101421758131816">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="68%" id="mcps1.3.2.4.2.4.1.3"><p id="cce_02_0245__p19143115818187">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_02_0245__row32801312121810"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.4.1.1 "><p id="cce_02_0245__p1714415589184">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.2.4.2.4.1.2 "><p id="cce_02_0245__p814518580186">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="68%" headers="mcps1.3.2.4.2.4.1.3 "><p id="cce_02_0245__p5145175891811">Project ID. For details about how to obtain the project ID, see <a href="cce_02_0271.html">How to Obtain Parameters in the API URI</a>.</p>
</td>
</tr>
<tr id="cce_02_0245__row1649094164612"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.4.1.1 "><p id="cce_02_0245__p749015414462">cluster_id</p>
</td>
<td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.2.4.2.4.1.2 "><p id="cce_02_0245__p1849084134615">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="68%" headers="mcps1.3.2.4.2.4.1.3 "><p id="cce_02_0245__p8491141114617">Cluster ID. For details about how to obtain the cluster ID, see <a href="cce_02_0271.html">How to Obtain Parameters in the API URI</a>.</p>
</td>
</tr>
<tr id="cce_02_0245__row256414484464"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.4.1.1 "><p id="cce_02_0245__p1856454818463">node_id</p>
</td>
<td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.2.4.2.4.1.2 "><p id="cce_02_0245__p2564134816468">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="68%" headers="mcps1.3.2.4.2.4.1.3 "><p id="cce_02_0245__p0564048184619">Cluster ID. For details about how to obtain the cluster ID, see <a href="cce_02_0271.html">How to Obtain Parameters in the API URI</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="cce_02_0245__section947084713911"><h4 class="sectiontitle">Request</h4><p id="cce_02_0245__en-us_topic_0079614900_p54374860"><strong id="cce_02_0245__b65693974">Request parameters</strong>:</p>
<p id="cce_02_0245__p893071112710"><a href="#cce_02_0245__table34821245101211">Table 2</a> and <a href="#cce_02_0245__table185578532300">Table 3</a> describe the request parameters.</p>
<div class="tablenoborder"><a name="cce_02_0245__table34821245101211"></a><a name="table34821245101211"></a><table cellpadding="4" cellspacing="0" summary="" id="cce_02_0245__table34821245101211" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameters in the request header</caption><thead align="left"><tr id="cce_02_0245__en-us_topic_0102499074_row55001954122614"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.4.1.1"><p id="cce_02_0245__en-us_topic_0102499074_p115009545264">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19%" id="mcps1.3.3.4.2.4.1.2"><p id="cce_02_0245__en-us_topic_0102499074_p175001547265">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="61%" id="mcps1.3.3.4.2.4.1.3"><p id="cce_02_0245__en-us_topic_0102499074_p16500154162611">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_02_0245__en-us_topic_0102499074_row199801811203412"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.4.1.1 "><p id="cce_02_0245__en-us_topic_0102499074_p69808112344">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="19%" headers="mcps1.3.3.4.2.4.1.2 "><p id="cce_02_0245__en-us_topic_0102499074_p3980111103414">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="61%" headers="mcps1.3.3.4.2.4.1.3 "><p id="cce_02_0245__en-us_topic_0102499074_p169801011203416">Message body type (format). Possible values:</p>
<ul id="cce_02_0245__en-us_topic_0102499074_ul7385444163617"><li id="cce_02_0245__en-us_topic_0102499074_li18385114483612">application/json;charset=utf-8</li><li id="cce_02_0245__en-us_topic_0102499074_li3516132853714">application/json</li></ul>
</td>
</tr>
<tr id="cce_02_0245__en-us_topic_0102499074_row3500125412260"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.4.1.1 "><p id="cce_02_0245__en-us_topic_0102499074_p105001654202618">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="19%" headers="mcps1.3.3.4.2.4.1.2 "><p id="cce_02_0245__en-us_topic_0102499074_p20500954182618">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="61%" headers="mcps1.3.3.4.2.4.1.3 "><p id="cce_02_0245__p18824197845">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 on how to obtain a user token, see <a href="cce_02_0344.html">API Usage Guidelines</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="cce_02_0245__table185578532300"></a><a name="table185578532300"></a><table cellpadding="4" cellspacing="0" summary="" id="cce_02_0245__table185578532300" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameters in the request body</caption><thead align="left"><tr id="cce_02_0245__row16557175343012"><th align="left" class="cellrowborder" valign="top" width="19.607843137254903%" id="mcps1.3.3.5.2.5.1.1"><p id="cce_02_0245__p125571753143013">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15.686274509803921%" id="mcps1.3.3.5.2.5.1.2"><p id="cce_02_0245__p12512124873118">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.54901960784314%" id="mcps1.3.3.5.2.5.1.3"><p id="cce_02_0245__p15574534307">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="42.15686274509804%" id="mcps1.3.3.5.2.5.1.4"><p id="cce_02_0245__p15557653163010">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_02_0245__row10557135318308"><td class="cellrowborder" valign="top" width="19.607843137254903%" headers="mcps1.3.3.5.2.5.1.1 "><p id="cce_02_0245__p1655795323010">metadata</p>
</td>
<td class="cellrowborder" valign="top" width="15.686274509803921%" headers="mcps1.3.3.5.2.5.1.2 "><p id="cce_02_0245__p6512184811310">No</p>
</td>
<td class="cellrowborder" valign="top" width="22.54901960784314%" headers="mcps1.3.3.5.2.5.1.3 "><p id="cce_02_0245__p845414161333"><a href="#cce_02_0245__table915314146321">metadata</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="42.15686274509804%" headers="mcps1.3.3.5.2.5.1.4 "><p id="cce_02_0245__p555711530309">Node's metadata, which is a collection of attributes.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="cce_02_0245__table915314146321"></a><a name="table915314146321"></a><table cellpadding="4" cellspacing="0" summary="" id="cce_02_0245__table915314146321" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Data structure of the <strong id="cce_02_0245__b1781132473817">metadata</strong> field</caption><thead align="left"><tr id="cce_02_0245__row8168191414320"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.6.2.5.1.1"><p id="cce_02_0245__p2168121417329">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.3.6.2.5.1.2"><p id="cce_02_0245__p13168181463219">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22%" id="mcps1.3.3.6.2.5.1.3"><p id="cce_02_0245__p31681148326">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="43%" id="mcps1.3.3.6.2.5.1.4"><p id="cce_02_0245__p1116811148325">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_02_0245__row11168614103217"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.6.2.5.1.1 "><p id="cce_02_0245__p161689145326">name</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.6.2.5.1.2 "><p id="cce_02_0245__p17168131415329">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.3.6.2.5.1.3 "><p id="cce_02_0245__p111689149323">String</p>
</td>
<td class="cellrowborder" valign="top" width="43%" headers="mcps1.3.3.6.2.5.1.4 "><p id="cce_02_0245__p8168181423215">Node name. After the node name is changed, the ECS name (VM name) is changed accordingly.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="cce_02_0245__p1129813311269"><strong id="cce_02_0245__b562002">Example request</strong>:</p>
<pre class="screen" id="cce_02_0245__screen192771630132611">{
"metadata": {
"name": "new-hostname"
}
}</pre>
</div>
<div class="section" id="cce_02_0245__section61819725020"><h4 class="sectiontitle">Response</h4><p id="cce_02_0245__en-us_topic_0079614900_p2018733"><strong id="cce_02_0245__b1124319491816">Response parameters</strong>:</p>
<p id="cce_02_0245__p16966318249">For the description of the response parameters, see <a href="cce_02_0243.html#cce_02_0243__en-us_topic_0079616779_en-us_topic_0079614912_ref458774242">Table 4</a>.</p>
<p id="cce_02_0245__p4981205823916"><strong id="cce_02_0245__b769855331116">Example response</strong>:</p>
</div>
<pre class="screen" id="cce_02_0245__screen159211141183010">{
"kind": "Node",
"apiVersion": "v3",
"metadata": {
"name": "new-hostname",
"uid": "4d1ecb2c-229a-11e8-9c75-0255ac100ceb",
"creationTimestamp": " 2020-02-20T21:11:09Z",
"updateTimestamp": "2020-02-20T21:11:09Z",
"annotations": {
"kubernetes.io/node-pool.id": "eu-de-01#s1.medium#EulerOS 2.5"
}
},
"spec": {
"flavor": "s1.medium",
"az": "eu-de-01",
"os": "EulerOS 2.5",
"login": {
"sshKey": "KeyPair-demo",
},
"rootVolume": {
"volumeType": "SAS",
"diskSize": 40
},
"dataVolumes": [
{
"volumeType": "SAS",
"diskSize": 100
}
],
"storage": {
"storageSelectors": [
{
"name": "cceUse",
"storageType": "evs",
"matchLabels": {
"size": "100",
"volumeType": "SAS",
"count": "1"
}
}
],
"storageGroups": [
{
"name": "vgpaas",
"selectorNames": [
"cceUse"
],
"cceManaged": true,
"virtualSpaces": [
{
"name": "runtime",
"size": "90%"
},
{
"name": "kubernetes",
"size": "10%"
}
]
}
]
},
"publicIP": {
"eip": {
"bandwidth": {}
}
},
"nodeNicSpec": {
"primaryNic": {
"subnetId": "c90b3ce5-e1f1-4c87-a006-644d78846438"
}
},
"billingMode": 0
"publicIP": {
"eip": {
}
}
},
"status": {
"phase": "Active",
"serverId": "456789abc-9368-46f3-8f29-d1a95622a568",
"publicIP": "10.34.56.78",
"privateIP": "192.168.1.23"
}
}</pre>
<div class="section" id="cce_02_0245__s50f1049a6a4d404c895cf636eb8f3bf1"><h4 class="sectiontitle">Status Code</h4><p id="cce_02_0245__en-us_topic_0079614900_p21869221"><a href="#cce_02_0245__en-us_topic_0079614900_table46761928">Table 5</a> describes the status code of this API.</p>
<div class="tablenoborder"><a name="cce_02_0245__en-us_topic_0079614900_table46761928"></a><a name="en-us_topic_0079614900_table46761928"></a><table cellpadding="4" cellspacing="0" summary="" id="cce_02_0245__en-us_topic_0079614900_table46761928" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Status code</caption><thead align="left"><tr id="cce_02_0245__en-us_topic_0079614900_row33254664"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.6.3.2.3.1.1"><p id="cce_02_0245__p55616028205955">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.6.3.2.3.1.2"><p id="cce_02_0245__p8604418205955">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_02_0245__en-us_topic_0079614900_row41084259"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.3.2.3.1.1 "><p id="cce_02_0245__en-us_topic_0079614900_p39490674">200</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.3.2.3.1.2 "><p id="cce_02_0245__en-us_topic_0079614900_p44628050">Information about the specified node is successfully updated.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="cce_02_0245__p347213715512">For details about error status codes, see <a href="cce_02_0084.html">Status Code</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="cce_02_0092.html">Cluster Management</a></div>
</div>
</div>