doc-exports/docs/dds/api-ref/dds_api_0026.html
Ru, Li Yi a6e39ff5b3 DDS_API
Reviewed-by: Boka, Ladislav <ladislav.boka@t-systems.com>
Co-authored-by: Ru, Li Yi <liyiru7@huawei.com>
Co-committed-by: Ru, Li Yi <liyiru7@huawei.com>
2024-05-27 08:52:30 +00:00

177 lines
14 KiB
HTML

<a name="dds_api_0026"></a><a name="dds_api_0026"></a>
<h1 class="topictitle1">Modifying DB Instance Specifications</h1>
<div id="body1473237538157"><div class="section" id="dds_api_0026__section4850156117316"><h4 class="sectiontitle">Function</h4><p id="dds_api_0026__p3631239417316">This API is used to modify the instance specifications.</p>
<div class="notice" id="dds_api_0026__note1582824921410"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="dds_api_0026__p757016191831">Services will be interrupted for 5 to 10 minutes when you modify DB instance specifications. Exercise caution when performing this operation.</p>
</div></div>
</div>
<div class="section" id="dds_api_0026__section1239972118494"><h4 class="sectiontitle">Constraints</h4><ul id="dds_api_0026__ul082311820560"><li id="dds_api_0026__li1982521814564">If you want to change the specifications to other specifications of the same series, the new specifications cannot be the same as the original specifications.</li><li id="dds_api_0026__li882561816563">Specifications can be modified only when the DB instance status is normal.</li></ul>
</div>
<div class="section" id="dds_api_0026__section28961517113719"><h4 class="sectiontitle">URI</h4><ul id="dds_api_0026__ul3084351717316"><li id="dds_api_0026__li915620217316">URI format<p id="dds_api_0026__p912862005412"><a name="dds_api_0026__li915620217316"></a><a name="li915620217316"></a>POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/resize</p>
</li><li id="dds_api_0026__li15430535">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0026__table4657088" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="dds_api_0026__row60083059"><th align="left" class="cellrowborder" valign="top" width="21.3%" id="mcps1.3.3.2.2.1.2.4.1.1"><p id="dds_api_0026__p34889605">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="28.08%" id="mcps1.3.3.2.2.1.2.4.1.2"><p id="dds_api_0026__p7485743">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50.62%" id="mcps1.3.3.2.2.1.2.4.1.3"><p id="dds_api_0026__p2775334615440">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dds_api_0026__row57385070"><td class="cellrowborder" valign="top" width="21.3%" headers="mcps1.3.3.2.2.1.2.4.1.1 "><p id="dds_api_0026__p17679057">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="28.08%" headers="mcps1.3.3.2.2.1.2.4.1.2 "><p id="dds_api_0026__p22717550">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="50.62%" headers="mcps1.3.3.2.2.1.2.4.1.3 "><p id="dds_api_0026__p57877484163525">Specifies the project ID of a tenant in a region.</p>
</td>
</tr>
<tr id="dds_api_0026__row2864326155157"><td class="cellrowborder" valign="top" width="21.3%" headers="mcps1.3.3.2.2.1.2.4.1.1 "><p id="dds_api_0026__p41557789155220">instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="28.08%" headers="mcps1.3.3.2.2.1.2.4.1.2 "><p id="dds_api_0026__p10737742155220">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="50.62%" headers="mcps1.3.3.2.2.1.2.4.1.3 "><p id="dds_api_0026__p64450739155220">Specifies the instance ID, which can be obtained by calling the API for querying instances. If you do not have an instance, you can call the API used for creating an instance.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="dds_api_0026__section3074340117316"><h4 class="sectiontitle">Requests</h4><ul id="dds_api_0026__ul5099287616954"><li id="dds_api_0026__li5628270116954">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0026__table3678226816954" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="dds_api_0026__row1340482316954"><th align="left" class="cellrowborder" valign="top" width="22%" id="mcps1.3.4.2.1.1.2.5.1.1"><p id="dds_api_0026__p1204887716954">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.4.2.1.1.2.5.1.2"><p id="dds_api_0026__p15184124818564">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.4.2.1.1.2.5.1.3"><p id="dds_api_0026__p3643495116954">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.4.2.1.1.2.5.1.4"><p id="dds_api_0026__p222501215320">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dds_api_0026__row794180116954"><td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.4.2.1.1.2.5.1.1 "><p id="dds_api_0026__p0848163619569">resize</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.1.1.2.5.1.2 "><p id="dds_api_0026__p3468118145718">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.4.2.1.1.2.5.1.3 "><p id="dds_api_0026__p18159083521">Object</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.1.1.2.5.1.4 "><p id="dds_api_0026__p19721532173110">Specifies the specification information. For more information, see <a href="#dds_api_0026__table5971833216954">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="dds_api_0026__table5971833216954"></a><a name="table5971833216954"></a><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0026__table5971833216954" frame="border" border="1" rules="all"><caption><b>Table 3 </b>resize field data structure description</caption><thead align="left"><tr id="dds_api_0026__row3797548116954"><th align="left" class="cellrowborder" valign="top" width="22.507749225077493%" id="mcps1.3.4.2.1.2.2.5.1.1"><p id="dds_api_0026__p5611509816954">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15.838416158384163%" id="mcps1.3.4.2.1.2.2.5.1.2"><p id="dds_api_0026__p1556992115816">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.64793520647935%" id="mcps1.3.4.2.1.2.2.5.1.3"><p id="dds_api_0026__p4902912116954">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="41.005899410059%" id="mcps1.3.4.2.1.2.2.5.1.4"><p id="dds_api_0026__p5227016339">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dds_api_0026__row5692111316422"><td class="cellrowborder" valign="top" width="22.507749225077493%" headers="mcps1.3.4.2.1.2.2.5.1.1 "><p id="dds_api_0026__p6489202502414">target_type</p>
</td>
<td class="cellrowborder" valign="top" width="15.838416158384163%" headers="mcps1.3.4.2.1.2.2.5.1.2 "><p id="dds_api_0026__p71112011425">No</p>
</td>
<td class="cellrowborder" valign="top" width="20.64793520647935%" headers="mcps1.3.4.2.1.2.2.5.1.3 "><p id="dds_api_0026__p101192020425">String</p>
</td>
<td class="cellrowborder" valign="top" width="41.005899410059%" headers="mcps1.3.4.2.1.2.2.5.1.4 "><p id="dds_api_0026__p18172054214">Specifies the object type:</p>
<ul id="dds_api_0026__ul0680444154412"><li id="dds_api_0026__li13680244174410">This parameter is mandatory for a cluster instance. If you modify the specifications of a mongos node, the value is <strong id="dds_api_0026__b53682020213">mongos</strong>. If you modify the specifications of a shard node, the value is <strong id="dds_api_0026__b108121713717">shard</strong>.</li><li id="dds_api_0026__li46801044204414">This parameter is not transferred for replica set and single node instances.</li></ul>
</td>
</tr>
<tr id="dds_api_0026__row335485185712"><td class="cellrowborder" valign="top" width="22.507749225077493%" headers="mcps1.3.4.2.1.2.2.5.1.1 "><p id="dds_api_0026__p13493923105818">target_id</p>
</td>
<td class="cellrowborder" valign="top" width="15.838416158384163%" headers="mcps1.3.4.2.1.2.2.5.1.2 "><p id="dds_api_0026__p1493112315588">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20.64793520647935%" headers="mcps1.3.4.2.1.2.2.5.1.3 "><p id="dds_api_0026__p203542513574">String</p>
</td>
<td class="cellrowborder" valign="top" width="41.005899410059%" headers="mcps1.3.4.2.1.2.2.5.1.4 "><p id="dds_api_0026__p187239512216">Specifies the ID of the node or instance whose specifications are to be modified. You can obtain the ID by calling the API for querying instances. If you do not have an instance, you can call the API used for creating an instance.</p>
<ul id="dds_api_0026__ul6827259247"><li id="dds_api_0026__li082712591419">If you modify the specifications of a mongos node, the value is the mongos node ID. If you modify the specifications of a shard node, the value is the shard node ID.</li><li id="dds_api_0026__li782785912410">For a replica set instance, the value is the DB instance ID.</li><li id="dds_api_0026__li1782795910415">For a single node instance, the value is the DB instance ID.</li></ul>
</td>
</tr>
<tr id="dds_api_0026__row2727794616954"><td class="cellrowborder" valign="top" width="22.507749225077493%" headers="mcps1.3.4.2.1.2.2.5.1.1 "><p id="dds_api_0026__p1240583194216">target_spec_code</p>
</td>
<td class="cellrowborder" valign="top" width="15.838416158384163%" headers="mcps1.3.4.2.1.2.2.5.1.2 "><p id="dds_api_0026__p1840518316425">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20.64793520647935%" headers="mcps1.3.4.2.1.2.2.5.1.3 "><p id="dds_api_0026__p2405831184219">String</p>
</td>
<td class="cellrowborder" valign="top" width="41.005899410059%" headers="mcps1.3.4.2.1.2.2.5.1.4 "><p id="dds_api_0026__p50035813161416">Specifies the resource specification code of the new specification. For details about how to obtain the value, see the response values of <strong id="dds_api_0026__b11552515145512">flavors.spec_code</strong> in <a href="dds_instance_specification.html">Querying Database Specifications</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="dds_api_0026__ul1041877316954"><li id="dds_api_0026__li2666010016954">Example request<p id="dds_api_0026__p8244513456"><a name="dds_api_0026__li2666010016954"></a><a name="li2666010016954"></a>POST https://dds.eu-de.otc.t-systems.com/v3/0549b4a43100d4f32f51c01c2fe4acdb/instances/9136fd2a9fcd405ea4674276ce36dae8in02/resize</p>
<div class="p" id="dds_api_0026__p92111121752">Modify the mongos node specifications.<pre class="codeblock" id="dds_api_0026__codeblock121114121550">{
"resize": {
"target_type": "mongos",
"target_id": "a742c13a284949adad177672e8a0f01cno02",
"target_spec_code": "dds.mongodb.c3.large.4.mongos"
}
}</pre>
</div>
<p id="dds_api_0026__p321110126516">Modify the shard node specifications.</p>
<pre class="codeblock" id="dds_api_0026__codeblock11212151216513">{
"resize": {
"target_type": "shard",
"target_id": "aeeb40a704904977ad78993d138ec942gr02",
"target_spec_code": "dds.momgodb.c3.large.4.shard"
}
}</pre>
<p id="dds_api_0026__p18212121216512">Modify the config node specifications.</p>
<pre class="codeblock" id="dds_api_0026__codeblock1521221217510">{
"resize": {
"target_type": "config",
"target_id": "10a1c330537b42c1a9b3f7a5ebcda35egr02",
"target_spec_code": "dds.momgodb.c3.xlarge.2.config"
}
}</pre>
<div class="p" id="dds_api_0026__p1821291212518">Modify specifications of a replica set or a single node instance.<pre class="codeblock" id="dds_api_0026__codeblock82121012756">{
"resize": {
"target_id": "aeeb40a704904977ad78993d138ec942in02",
"target_spec_code": "dds.mongodb.c3.medium.4.repset"
}
}</pre>
</div>
</li></ul>
</div>
<div class="section" id="dds_api_0026__section28521534113742"><h4 class="sectiontitle">Responses</h4><ul id="dds_api_0026__ul12573920"><li id="dds_api_0026__li46056421">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0026__table32267243" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Parameter description</caption><thead align="left"><tr id="dds_api_0026__row9230088"><th align="left" class="cellrowborder" valign="top" width="24.242424242424242%" id="mcps1.3.5.2.1.1.2.4.1.1"><p id="dds_api_0026__p9439626">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="31.313131313131315%" id="mcps1.3.5.2.1.1.2.4.1.2"><p id="dds_api_0026__p26412257">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.44444444444445%" id="mcps1.3.5.2.1.1.2.4.1.3"><p id="dds_api_0026__p327014214317">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dds_api_0026__row15736877"><td class="cellrowborder" valign="top" width="24.242424242424242%" headers="mcps1.3.5.2.1.1.2.4.1.1 "><p id="dds_api_0026__p6751103117513">job_id</p>
</td>
<td class="cellrowborder" valign="top" width="31.313131313131315%" headers="mcps1.3.5.2.1.1.2.4.1.2 "><p id="dds_api_0026__p157511931653">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.44444444444445%" headers="mcps1.3.5.2.1.1.2.4.1.3 "><p id="dds_api_0026__p48259009">Indicates the task ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="dds_api_0026__ul16665627"><li id="dds_api_0026__li15772917">Response example<pre class="codeblock" id="dds_api_0026__codeblock660937479172">{
"job_id": "3711e2ad-5787-49bc-a47f-3f0b066af9f5"
}</pre>
</li></ul>
</div>
<div class="section" id="dds_api_0026__section5382712154838"><h4 class="sectiontitle">Status Code</h4><p id="dds_api_0026__en-us_topic_0000001387505349_p16131712193312">Status Code:202.</p>
<p id="dds_api_0026__en-us_topic_0000001387505349_p480617135329">For more information, see <a href="dds_status_code.html">Status Code</a>.</p>
</div>
<div class="section" id="dds_api_0026__section6522193710339"><h4 class="sectiontitle">Error Code</h4><p id="dds_api_0026__dds_api_0018_p20466124120334">For more information, see <a href="dds_error_code.html">Error Code</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dds_instance_mgmt.html">DB Instance Management</a></div>
</div>
</div>