Files
doc-exports/docs/taurusdb/api-ref/gaussdb_11_0015.html
wangdengke2 ee9f8aa0b6 taurusdb_api
Reviewed-by: Gladkov, Maksim <mgladkov@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: wangdengke2 <wangdengke2@huawei.com>
Co-committed-by: wangdengke2 <wangdengke2@huawei.com>
2025-10-30 15:48:33 +00:00

227 lines
17 KiB
HTML

<a name="gaussdb_11_0015"></a><a name="gaussdb_11_0015"></a>
<h1 class="topictitle1">Creating a Read Replica</h1>
<div id="body8662426"><div class="section" id="gaussdb_11_0015__en-us_topic_0000001297545185_section4284989"><h4 class="sectiontitle">Function</h4><p id="gaussdb_11_0015__en-us_topic_0000001297545185_p0506143014918">This API is used to create a read replica. Before calling this API:</p>
<ul id="gaussdb_11_0015__en-us_topic_0000001297545185_ul924420236520"><li id="gaussdb_11_0015__en-us_topic_0000001267522832_en-us_topic_0000001250985350_li136356359522">Learn how to <a href="gaussdb_03_0001.html">authorize and authenticate</a> it.</li><li id="gaussdb_11_0015__en-us_topic_0000001267522832_en-us_topic_0000001250985350_li1991981933613">Obtain the required <a href="gaussdb_00_0003.html">region and endpoint</a>.</li></ul>
</div>
<div class="section" id="gaussdb_11_0015__en-us_topic_0000001297545185_section38564907"><h4 class="sectiontitle">URI</h4><ul id="gaussdb_11_0015__en-us_topic_0000001297545185_ul13194498"><li id="gaussdb_11_0015__en-us_topic_0000001297545185_li51641620">URI format<p id="gaussdb_11_0015__en-us_topic_0000001297545185_p819462816594"><a name="gaussdb_11_0015__en-us_topic_0000001297545185_li51641620"></a><a name="en-us_topic_0000001297545185_li51641620"></a>POST https://{endpoint}/mysql/v3/{project_id}/instances/{instance_id}/nodes/enlarge</p>
</li><li id="gaussdb_11_0015__en-us_topic_0000001297545185_li4411135064210">URI example<p id="gaussdb_11_0015__p11417181546"><a name="gaussdb_11_0015__en-us_topic_0000001297545185_li4411135064210"></a><a name="en-us_topic_0000001297545185_li4411135064210"></a>POST https://gaussdb-mysql.eu-de.otc.t-systems.com/mysql/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/nodes/enlarge</p>
</li><li id="gaussdb_11_0015__en-us_topic_0000001297545185_li22221662">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="gaussdb_11_0015__en-us_topic_0000001297545185_table65777232" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="gaussdb_11_0015__en-us_topic_0000001297545185_row46529701"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.2.2.3.1.2.4.1.1"><p id="gaussdb_11_0015__en-us_topic_0000001297545185_p10809459"><strong id="gaussdb_11_0015__en-us_topic_0000001297545185_b1423013135011">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.2.2.3.1.2.4.1.2"><p id="gaussdb_11_0015__en-us_topic_0000001297545185_p3150961">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.2.2.3.1.2.4.1.3"><p id="gaussdb_11_0015__en-us_topic_0000001297545185_p53901255"><strong id="gaussdb_11_0015__en-us_topic_0000001297545185_b18634141515020">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="gaussdb_11_0015__en-us_topic_0000001297545185_row3925534"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.3.1.2.4.1.1 "><p id="gaussdb_11_0015__en-us_topic_0000001297545185_p49532829">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.3.1.2.4.1.2 "><p id="gaussdb_11_0015__en-us_topic_0000001297545185_p52736237">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.3.1.2.4.1.3 "><p id="gaussdb_11_0015__en-us_topic_0000001297545185_p43776822">Project ID of a tenant in a region.</p>
<p id="gaussdb_11_0015__en-us_topic_0000001297545185_p178064411566">To obtain this value, see <a href="gaussdb_10_0004.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
<tr id="gaussdb_11_0015__en-us_topic_0000001297545185_row19402550154517"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.3.1.2.4.1.1 "><p id="gaussdb_11_0015__en-us_topic_0000001297545185_p1046217474614">instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.3.1.2.4.1.2 "><p id="gaussdb_11_0015__en-us_topic_0000001297545185_p246284104619">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.3.1.2.4.1.3 "><p id="gaussdb_11_0015__en-us_topic_0000001297545185_p18462124174611">Instance ID, which is compliant with the UUID format.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="gaussdb_11_0015__section1991918216116"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="gaussdb_11_0015__en-us_topic_0000001181402748_HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="gaussdb_11_0015__row99191421112"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="gaussdb_11_0015__p691912211119">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="gaussdb_11_0015__p1391913212118">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="gaussdb_11_0015__p129191926111">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="gaussdb_11_0015__p179208211119">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="gaussdb_11_0015__row79199211112"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="gaussdb_11_0015__p65521043542">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="gaussdb_11_0015__p15920152151117">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="gaussdb_11_0015__p092082131113">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="gaussdb_11_0015__p392032151116">User token.</p>
</td>
</tr>
<tr id="gaussdb_11_0015__row2091916219115"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="gaussdb_11_0015__p129202261112">X-Language</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="gaussdb_11_0015__p1692018201118">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="gaussdb_11_0015__p79200261118">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="gaussdb_11_0015__p189203216116">Language.</p>
</td>
</tr>
<tr id="gaussdb_11_0015__row185259290471"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="gaussdb_11_0015__p15665114311157">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="gaussdb_11_0015__p36651643101518">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="gaussdb_11_0015__p10665443181514">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="gaussdb_11_0015__p1866504318159">MIME type of the request body. You are advised to use the default value <strong id="gaussdb_11_0015__b186697559073521">application/json</strong>. For APIs used to upload objects or images, the value can vary depending on the flow type.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="gaussdb_11_0015__en-us_topic_0000001181402748_request_MysqlCreateReadonlyNodeRequest" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request body parameters</caption><thead align="left"><tr id="gaussdb_11_0015__row1492117210117"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="gaussdb_11_0015__p1792112251112">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p id="gaussdb_11_0015__p1492172161116">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p id="gaussdb_11_0015__p139211029118">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p id="gaussdb_11_0015__p79212211116">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="gaussdb_11_0015__row392113211114"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="gaussdb_11_0015__p13921152131116">priorities</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="gaussdb_11_0015__p179213220112">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="gaussdb_11_0015__p492212217114">Array of integers</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="gaussdb_11_0015__p195191056102519">Read replica failover priority ranging from 1 to 16. The total number of the primary node and read replicas is up to 16.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="gaussdb_11_0015__section109238251112"><h4 class="sectiontitle">Response Parameters</h4><p id="gaussdb_11_0015__p1392332171118"><strong id="gaussdb_11_0015__b61273959173346">Status code: 201</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="gaussdb_11_0015__en-us_topic_0000001181402748_response_MysqlCreateReadonlyNodeResponse" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Response body parameters</caption><thead align="left"><tr id="gaussdb_11_0015__row2092317211114"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.1"><p id="gaussdb_11_0015__p1892319271111">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.2"><p id="gaussdb_11_0015__p1692392131112">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.3.2.4.1.3"><p id="gaussdb_11_0015__p119241326114">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="gaussdb_11_0015__row792311212117"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p id="gaussdb_11_0015__p199241122115">instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p id="gaussdb_11_0015__p992416281116">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p id="gaussdb_11_0015__p6924162101118">DB instance ID.</p>
</td>
</tr>
<tr id="gaussdb_11_0015__row1592392111110"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p id="gaussdb_11_0015__p1092419210117">node_names</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p id="gaussdb_11_0015__p1792413231112">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p id="gaussdb_11_0015__p1092413241119">Node name list</p>
</td>
</tr>
<tr id="gaussdb_11_0015__row189239212115"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p id="gaussdb_11_0015__p89241427119">job_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p id="gaussdb_11_0015__p119241726115">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p id="gaussdb_11_0015__p1792516251120">ID of the task for creating a DB instance.</p>
<p id="gaussdb_11_0015__p1592592141112">This parameter is returned only when pay-per-use DB instances are created.</p>
</td>
</tr>
<tr id="gaussdb_11_0015__row792317221111"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p id="gaussdb_11_0015__p6925829111">order_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p id="gaussdb_11_0015__p1925172101114">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p id="gaussdb_11_0015__p13925726118">Order ID. This parameter is returned only when yearly/monthly instances are created.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="gaussdb_11_0015__p179252271115"><strong id="gaussdb_11_0015__b154159347572458">Status code: 400</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="gaussdb_11_0015__en-us_topic_0000001181402748_response_MysqlErrorResponse" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Response body parameters</caption><thead align="left"><tr id="gaussdb_11_0015__row14927202181114"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.5.2.4.1.1"><p id="gaussdb_11_0015__p109272271116">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.5.2.4.1.2"><p id="gaussdb_11_0015__p392732181111">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.5.2.4.1.3"><p id="gaussdb_11_0015__p692732151110">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="gaussdb_11_0015__row1992732151110"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.5.2.4.1.1 "><p id="gaussdb_11_0015__p17927132171117">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.5.2.4.1.2 "><p id="gaussdb_11_0015__p49281028112">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.5.2.4.1.3 "><p id="gaussdb_11_0015__p13928724115">Error code.</p>
</td>
</tr>
<tr id="gaussdb_11_0015__row6927152181111"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.5.2.4.1.1 "><p id="gaussdb_11_0015__p139281224117">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.5.2.4.1.2 "><p id="gaussdb_11_0015__p149283210113">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.5.2.4.1.3 "><p id="gaussdb_11_0015__p14928525113">Error message.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="gaussdb_11_0015__p1928152141115"><strong id="gaussdb_11_0015__b18112229156405">Status code: 500</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="gaussdb_11_0015__table79281728114" frame="border" border="1" rules="all"><caption><b>Table 6 </b>Response body parameters</caption><thead align="left"><tr id="gaussdb_11_0015__row29287211110"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.7.2.4.1.1"><p id="gaussdb_11_0015__p09291528115">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.7.2.4.1.2"><p id="gaussdb_11_0015__p139291291114">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.7.2.4.1.3"><p id="gaussdb_11_0015__p13929102161110">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="gaussdb_11_0015__row1492818217114"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.7.2.4.1.1 "><p id="gaussdb_11_0015__p692910217113">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.7.2.4.1.2 "><p id="gaussdb_11_0015__p892918212112">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.7.2.4.1.3 "><p id="gaussdb_11_0015__p1892916221117">Error code.</p>
</td>
</tr>
<tr id="gaussdb_11_0015__row49281329115"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.7.2.4.1.1 "><p id="gaussdb_11_0015__p19929112111115">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.7.2.4.1.2 "><p id="gaussdb_11_0015__p129291023115">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.7.2.4.1.3 "><p id="gaussdb_11_0015__p16929192191110">Error message.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="gaussdb_11_0015__section793017241116"><h4 class="sectiontitle">Example Request</h4><p id="gaussdb_11_0015__p1993062151115">Creating a read replica</p>
<pre class="screen" id="gaussdb_11_0015__screen8930028113">
POST https://gaussdb-mysql.eu-de.otc.t-systems.com/mysql/v3/0483b6b16e954cb88930a360d2c4e663/instances/ba62a0b83a1b42bfab275829d86ac0fdin07/nodes/enlarge
{
"priorities" : [ 1, 2 ]
}</pre>
</div>
<div class="section" id="gaussdb_11_0015__section119305221112"><h4 class="sectiontitle">Example Response</h4><p id="gaussdb_11_0015__p11930132101113"><strong id="gaussdb_11_0015__b186222901173346">Status code: 201</strong></p>
<p id="gaussdb_11_0015__p12930223115">Success.</p>
<pre class="screen" id="gaussdb_11_0015__screen129317261119">{
"instance_id" : "f381d0b539e644df8f5b0d3a62129515in07",
"node_names" : [ "taurusdb-ccf5_node03" ],
"job_id" : "dff1d289-4d03-4942-8b9f-463ea07c000d"
}</pre>
</div>
<div class="section" id="gaussdb_11_0015__section4778540915440"><h4 class="sectiontitle">Status Code</h4><p id="gaussdb_11_0015__p0723374409">For details, see <a href="gaussdb_10_0002.html">Status Codes</a>.</p>
</div>
<div class="section" id="gaussdb_11_0015__section2557116171718"><h4 class="sectiontitle">Error Code</h4><p id="gaussdb_11_0015__p855716160178">For details, see <a href="gaussdb_10_0003.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="gaussdb_11_0003.html">Instance Management</a></div>
</div>
</div>