Files
doc-exports/docs/ecs/api-ref/en-us_topic_0020212653.html
wanghuijuan738 8f024b87ae ECS API 20251204 version. Adding an API Document.
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com>
Co-authored-by: wanghuijuan738 <wanghuijuan738@huawei.com>
Co-committed-by: wanghuijuan738 <wanghuijuan738@huawei.com>
2025-12-17 11:05:14 +00:00

168 lines
15 KiB
HTML

<a name="EN-US_TOPIC_0020212653"></a><a name="EN-US_TOPIC_0020212653"></a>
<h1 class="topictitle1">Modifying the Specifications of an <span id="text17988164611250">ECS</span></h1>
<div id="body28932175"><div class="section" id="EN-US_TOPIC_0020212653__section5379216"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0020212653__p5596104012214"><span id="EN-US_TOPIC_0020212653__text71951219496">ECS</span> specifications can be modified, for example, upgrading the vCPUs and memory, to meet service requirements. This API is used to modify <span id="EN-US_TOPIC_0020212653__text107161833175810">ECS</span> specifications.</p>
<p id="EN-US_TOPIC_0020212653__p4263113112566">This API is an asynchronous API. After the specifications modification request is successfully delivered, a job ID is returned. This does not mean the modification is complete. You need to call the API by referring to <a href="en-us_topic_0022225398.html">Querying Job Execution Status</a> to query the job status. The SUCCESS status indicates that the modification is successful.</p>
<p id="EN-US_TOPIC_0020212653__p65611548195111">An ECS flavor cannot be changed to certain flavors. For details, see <a href="en-us_topic_0110472767.html">Querying the Target Flavors to Which an ECS Flavor Can Be Changed</a>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0020212653__section10197106104013"><h4 class="sectiontitle">Constraints</h4><ul id="EN-US_TOPIC_0020212653__ul2178142918719"><li id="EN-US_TOPIC_0020212653__li31785299713">You can modify the <span id="EN-US_TOPIC_0020212653__text1319665212519">ECS</span> specifications only when the <span id="EN-US_TOPIC_0020212653__text1873103611716">ECS</span> is stopped.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0020212653__section48412952"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0020212653__p40996912155429">POST /v1/{project_id}/cloudservers/{server_id}/resize</p>
<div class="p" id="EN-US_TOPIC_0020212653__p1267005325417"><a href="#EN-US_TOPIC_0020212653__table29396722">Table 1</a> describes the parameters in the URI.
<div class="tablenoborder"><a name="EN-US_TOPIC_0020212653__table29396722"></a><a name="table29396722"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0020212653__table29396722" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0020212653__row15658103"><th align="left" class="cellrowborder" valign="top" width="16.831683168316832%" id="mcps1.3.3.3.2.2.4.1.1"><p id="EN-US_TOPIC_0020212653__p60346796">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.831683168316832%" id="mcps1.3.3.3.2.2.4.1.2"><p id="EN-US_TOPIC_0020212653__p56252285">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="66.33663366336634%" id="mcps1.3.3.3.2.2.4.1.3"><p id="EN-US_TOPIC_0020212653__p60141268">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0020212653__row39604502"><td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.3.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0020212653__p53848109">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.3.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0020212653__p66729601">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="66.33663366336634%" headers="mcps1.3.3.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0020212653__p37593705">Specifies the project ID.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0020212653__row59061958"><td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.3.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0020212653__p19289328">server_id</p>
</td>
<td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.3.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0020212653__p18931763">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="66.33663366336634%" headers="mcps1.3.3.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0020212653__p57077814">Specifies the <span id="EN-US_TOPIC_0020212653__text1728017317212">ECS</span> ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0020212653__section33063388"><h4 class="sectiontitle">Request</h4><div class="p" id="EN-US_TOPIC_0020212653__p9784122915554"><a href="#EN-US_TOPIC_0020212653__table6742880">Table 2</a> describes the request parameters.
<div class="tablenoborder"><a name="EN-US_TOPIC_0020212653__table6742880"></a><a name="table6742880"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0020212653__table6742880" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0020212653__row13072760"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.4.2.2.2.5.1.1"><p id="EN-US_TOPIC_0020212653__p52260639">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.4.2.2.2.5.1.2"><p id="EN-US_TOPIC_0020212653__p5253358">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12%" id="mcps1.3.4.2.2.2.5.1.3"><p id="EN-US_TOPIC_0020212653__p22868878">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="54%" id="mcps1.3.4.2.2.2.5.1.4"><p id="EN-US_TOPIC_0020212653__p40439847">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0020212653__row54402144"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.2.2.5.1.1 "><p id="EN-US_TOPIC_0020212653__p44497505">resize</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.2.2.5.1.2 "><p id="EN-US_TOPIC_0020212653__p47528147">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.4.2.2.2.5.1.3 "><p id="EN-US_TOPIC_0020212653__p24574685">Object</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.4.2.2.2.5.1.4 "><p id="EN-US_TOPIC_0020212653__p964810282718"><strong id="EN-US_TOPIC_0020212653__b102322693832433">Definition</strong></p>
<p id="EN-US_TOPIC_0020212653__p63988077">Specifies the operation to modify <span id="EN-US_TOPIC_0020212653__text1482818562613">ECS</span> specifications. For details, see <a href="#EN-US_TOPIC_0020212653__table7657338">Table 3</a>.</p>
<p id="EN-US_TOPIC_0020212653__p1885955711511"><strong id="EN-US_TOPIC_0020212653__b100001386832721">Constraints</strong></p>
<p id="EN-US_TOPIC_0020212653__p98591577516">N/A</p>
<p id="EN-US_TOPIC_0020212653__p118594573513"><strong id="EN-US_TOPIC_0020212653__b28704499532224">Range</strong></p>
<p id="EN-US_TOPIC_0020212653__p198599573510">N/A</p>
<p id="EN-US_TOPIC_0020212653__p48596578519"><strong id="EN-US_TOPIC_0020212653__b128783420732843">Default Value</strong></p>
<p id="EN-US_TOPIC_0020212653__p14859115755116">N/A</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0020212653__row148844178188"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.2.2.5.1.1 "><p id="EN-US_TOPIC_0020212653__p2014411381156">dry_run</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.2.2.5.1.2 "><p id="EN-US_TOPIC_0020212653__p121440380151">No</p>
</td>
<td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.4.2.2.2.5.1.3 "><p id="EN-US_TOPIC_0020212653__p1614493811514">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.4.2.2.2.5.1.4 "><p id="EN-US_TOPIC_0020212653__p331254134411"><strong id="EN-US_TOPIC_0020212653__b17878255596">Definition</strong></p>
<p id="EN-US_TOPIC_0020212653__p935233824220">Specifies whether to check the request. If this parameter is set to <strong id="EN-US_TOPIC_0020212653__b1173414581890">true</strong>, no instance is created.</p>
<p id="EN-US_TOPIC_0020212653__p1947651444410"><strong id="EN-US_TOPIC_0020212653__b12667427032721">Constraints</strong></p>
<p id="EN-US_TOPIC_0020212653__p9113191017818">N/A</p>
<p id="EN-US_TOPIC_0020212653__p134115232817"><strong id="EN-US_TOPIC_0020212653__b134798143832224">Range</strong></p>
<ul id="EN-US_TOPIC_0020212653__ul16884162818139"><li id="EN-US_TOPIC_0020212653__li47643211376"><strong id="EN-US_TOPIC_0020212653__b58476151011">true</strong>: Check the request. Check items include the mandatory parameters and request format.<ul id="EN-US_TOPIC_0020212653__ul14785162314512"><li id="EN-US_TOPIC_0020212653__li166117194456">If the check fails, the system returns an error.</li><li id="EN-US_TOPIC_0020212653__li7618819164517">If the check is successful, the system returns status code 202.</li></ul>
</li></ul>
<ul id="EN-US_TOPIC_0020212653__ul10553175316137"><li id="EN-US_TOPIC_0020212653__li151121824311"><strong id="EN-US_TOPIC_0020212653__b5430172314014">false</strong>: Send the request without checking the request body.</li></ul>
<p id="EN-US_TOPIC_0020212653__p0419830144411"><strong id="EN-US_TOPIC_0020212653__b152048896532843">Default Value</strong></p>
<p id="EN-US_TOPIC_0020212653__p17340203120436">false</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0020212653__table7657338"></a><a name="table7657338"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0020212653__table7657338" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="EN-US_TOPIC_0020212653__b8423527061138">resize</strong> field description</caption><thead align="left"><tr id="EN-US_TOPIC_0020212653__row17725233"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.4.2.3.2.5.1.1"><p id="EN-US_TOPIC_0020212653__p1733218125569">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16%" id="mcps1.3.4.2.3.2.5.1.2"><p id="EN-US_TOPIC_0020212653__p203321912145616">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13%" id="mcps1.3.4.2.3.2.5.1.3"><p id="EN-US_TOPIC_0020212653__p1633291212566">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="54%" id="mcps1.3.4.2.3.2.5.1.4"><p id="EN-US_TOPIC_0020212653__p733241219565">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0020212653__row40163483"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.3.2.5.1.1 "><p id="EN-US_TOPIC_0020212653__p32016662">flavorRef</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.4.2.3.2.5.1.2 "><p id="EN-US_TOPIC_0020212653__p43212834">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.4.2.3.2.5.1.3 "><p id="EN-US_TOPIC_0020212653__p10578662">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.4.2.3.2.5.1.4 "><p id="EN-US_TOPIC_0020212653__p87861739902"><strong id="EN-US_TOPIC_0020212653__b208227836832433">Definition</strong></p>
<p id="EN-US_TOPIC_0020212653__p61434729">Specifies the flavor ID of the <span id="EN-US_TOPIC_0020212653__text10373711262">ECS</span> after the modification.</p>
<p id="EN-US_TOPIC_0020212653__p2490818142816"><strong id="EN-US_TOPIC_0020212653__b177157803432721">Constraints</strong></p>
<p id="EN-US_TOPIC_0020212653__p8106229132812">N/A</p>
<p id="EN-US_TOPIC_0020212653__p13358193112813"><strong id="EN-US_TOPIC_0020212653__b8455040432224">Range</strong></p>
<p id="EN-US_TOPIC_0020212653__p1386173732819">N/A</p>
<p id="EN-US_TOPIC_0020212653__p1140512468289"><strong id="EN-US_TOPIC_0020212653__b5068621032843">Default Value</strong></p>
<p id="EN-US_TOPIC_0020212653__p1382285292816">N/A</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0020212653__section29135036"><h4 class="sectiontitle">Response</h4><p id="EN-US_TOPIC_0020212653__p583313195412"><a href="#EN-US_TOPIC_0020212653__table2824153181913">Table 4</a> describes the response parameters.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0020212653__table2824153181913"></a><a name="table2824153181913"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0020212653__table2824153181913" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Response parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0020212653__row11825193111915"><th align="left" class="cellrowborder" valign="top" width="16.85%" id="mcps1.3.5.3.2.4.1.1"><p id="EN-US_TOPIC_0020212653__p135632102272">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.98%" id="mcps1.3.5.3.2.4.1.2"><p id="EN-US_TOPIC_0020212653__p55632010102714">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="65.16999999999999%" id="mcps1.3.5.3.2.4.1.3"><p id="EN-US_TOPIC_0020212653__p125631410152717">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0020212653__row382615381910"><td class="cellrowborder" valign="top" width="16.85%" headers="mcps1.3.5.3.2.4.1.1 "><p id="EN-US_TOPIC_0020212653__p1882713151914">job_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.98%" headers="mcps1.3.5.3.2.4.1.2 "><p id="EN-US_TOPIC_0020212653__p1182723161913">String</p>
</td>
<td class="cellrowborder" valign="top" width="65.16999999999999%" headers="mcps1.3.5.3.2.4.1.3 "><p id="EN-US_TOPIC_0020212653__p79774531157"><strong id="EN-US_TOPIC_0020212653__b607831240">Definition</strong></p>
<p id="EN-US_TOPIC_0020212653__p12827133121914">Specifies the job ID returned after a job is delivered. The job ID can be used to query the job execution progress. For details about how to query the job execution status based on <strong id="EN-US_TOPIC_0020212653__b173436337624634">job_id</strong>, see <a href="en-us_topic_0022225397.html">Job Status Management</a>.</p>
<p id="EN-US_TOPIC_0020212653__p10609556134619"><strong id="EN-US_TOPIC_0020212653__b326236636">Range</strong></p>
<p id="EN-US_TOPIC_0020212653__p8453833853">N/A</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="EN-US_TOPIC_0020212653__p827131024410">For details about abnormal responses, see <a href="en-us_topic_0022067714.html">Responses (Jobs)</a>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0020212653__section1183192295620"><h4 class="sectiontitle">Example Request</h4><p id="EN-US_TOPIC_0020212653__p7314123574120">Change the ECS flavor to c3.15xlarge.2.</p>
<pre class="screen" id="EN-US_TOPIC_0020212653__screen10956347143412">POST https://{endpoint}/v1/{project_id}/cloudservers/{server_id}/resize
{
"resize": {
"flavorRef": "c3.15xlarge.2"
}
}</pre>
</div>
<div class="section" id="EN-US_TOPIC_0020212653__section1923071117499"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="EN-US_TOPIC_0020212653__screen19417185413">{
"job_id": "ff80808288d41e1b018990260955686a"
} </pre>
</div>
<div class="section" id="EN-US_TOPIC_0020212653__section27037160"><h4 class="sectiontitle">Returned Values</h4><p id="EN-US_TOPIC_0020212653__p23224207">See <a href="en-us_topic_0022067716.html">Returned Values for General Requests</a>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0020212653__section85821649202813"><h4 class="sectiontitle">Error Codes</h4><p id="EN-US_TOPIC_0020212653__p7233105282813">See <a href="en-us_topic_0022067717.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0020212691.html">Status Management</a></div>
</div>
</div>