forked from docs/doc-exports
Reviewed-by: Boka, Ladislav <ladislav.boka@t-systems.com> Co-authored-by: wangdengke2 <wangdengke2@huawei.com> Co-committed-by: wangdengke2 <wangdengke2@huawei.com>
214 lines
15 KiB
HTML
214 lines
15 KiB
HTML
<a name="gaussdb_04_0015"></a><a name="gaussdb_04_0015"></a>
|
|
|
|
<h1 class="topictitle1">Creating a Read Replica</h1>
|
|
<div id="body1594202140277"><div class="section" id="gaussdb_04_0015__section4284989"><h4 class="sectiontitle">Function</h4><p id="gaussdb_04_0015__p0506143014918">This API is used to create a read replica. Before using this API:</p>
|
|
<ul id="gaussdb_04_0015__ul924420236520"><li id="gaussdb_04_0015__li136356359522">Learn how to <a href="gaussdb_03_0001.html">authorize and authenticate</a> it.</li><li id="gaussdb_04_0015__li1991981933613">Obtain the required <a href="gaussdb_00_0003.html">region and endpoint</a>.</li></ul>
|
|
</div>
|
|
<div class="section" id="gaussdb_04_0015__section12562144312269"><h4 class="sectiontitle">URI</h4><p id="gaussdb_04_0015__p20562104314264">POST /v3/{project_id}/instances/{instance_id}/nodes/enlarge</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="gaussdb_04_0015__table10562104342619" frame="border" border="1" rules="all"><caption><b>Table 1 </b>URI parameters</caption><thead align="left"><tr id="gaussdb_04_0015__row8562144372613"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="gaussdb_04_0015__p13562164319263">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="gaussdb_04_0015__p17562204372617">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="gaussdb_04_0015__p18562164382610">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="gaussdb_04_0015__p55637438260">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="gaussdb_04_0015__row18562194382613"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="gaussdb_04_0015__p5563943202610">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="gaussdb_04_0015__p165631243102618">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="gaussdb_04_0015__p1556364311268">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="gaussdb_04_0015__p1509201554618">Project ID of a tenant in a region.</p>
|
|
<p id="gaussdb_04_0015__p1850918153469">To obtain this value, see <a href="gaussdb_10_0004.html">Obtaining a Project ID</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="gaussdb_04_0015__row6562184312610"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="gaussdb_04_0015__p195638431262">instance_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="gaussdb_04_0015__p125631543142614">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="gaussdb_04_0015__p1056311439267">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="gaussdb_04_0015__p14564743142613">DB instance ID, which is compliant with the UUID format.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="gaussdb_04_0015__section1956484372611"><h4 class="sectiontitle">Request Parameters</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="gaussdb_04_0015__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="gaussdb_04_0015__row1456454322611"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="gaussdb_04_0015__p16564843142619">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="gaussdb_04_0015__p956414434268">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="gaussdb_04_0015__p85641943172618">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="gaussdb_04_0015__p956504302611">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="gaussdb_04_0015__row1756484316261"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="gaussdb_04_0015__p17565243172613">X-Auth-Token</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="gaussdb_04_0015__p16565204320265">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="gaussdb_04_0015__p75651543112614">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="gaussdb_04_0015__p25655434263">User token.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="gaussdb_04_0015__row0564443132616"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="gaussdb_04_0015__p1256544316268">X-Language</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="gaussdb_04_0015__p185651143172615">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="gaussdb_04_0015__p1456534312269">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="gaussdb_04_0015__p1556654313263">Language.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="gaussdb_04_0015__request_MysqlCreateReadonlyNodeRequest" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request body parameters</caption><thead align="left"><tr id="gaussdb_04_0015__row956644392616"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="gaussdb_04_0015__p6566643142614">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p id="gaussdb_04_0015__p17566243172612">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p id="gaussdb_04_0015__p185661343142620">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p id="gaussdb_04_0015__p205661643132617">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="gaussdb_04_0015__row85661343132617"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="gaussdb_04_0015__p1556715432262">priorities</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="gaussdb_04_0015__p85671543132616">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="gaussdb_04_0015__p1156764319263">Array of integers</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="gaussdb_04_0015__p056754316263">Failover priority of a read replica. Failover priority ranges from 1 for the first priority to 16 for the last priority. This priority determines the order in which read replicas are promoted when recovering from a primary node failure. Read replicas with the same priority have a same probability of being promoted to the new primary node.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="gaussdb_04_0015__section16568143132617"><h4 class="sectiontitle">Response Parameters</h4><p id="gaussdb_04_0015__p16568843192611"><strong id="gaussdb_04_0015__b17568243172618">Status code: 201</strong></p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="gaussdb_04_0015__response_MysqlCreateReadonlyNodeResponse" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Response body parameters</caption><thead align="left"><tr id="gaussdb_04_0015__row756824310266"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.1"><p id="gaussdb_04_0015__p557364319260">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.2"><p id="gaussdb_04_0015__p157324315266">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.3.2.4.1.3"><p id="gaussdb_04_0015__p1057334372619">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="gaussdb_04_0015__row1956824312618"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p id="gaussdb_04_0015__p55731543142616">instance_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p id="gaussdb_04_0015__p19573114312263">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p id="gaussdb_04_0015__p1057364316267">DB instance ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="gaussdb_04_0015__row05682438262"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p id="gaussdb_04_0015__p175749431267">node_names</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p id="gaussdb_04_0015__p957415439263">Array of strings</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p id="gaussdb_04_0015__p1557434317266">Node name list</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="gaussdb_04_0015__row7568134312614"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p id="gaussdb_04_0015__p85748433263">job_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p id="gaussdb_04_0015__p165741743112619">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p id="gaussdb_04_0015__p457494312611">Read replica creation task ID.</p>
|
|
<p id="gaussdb_04_0015__p45746439268">This parameter is returned only when a pay-per-use read replica is created.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="gaussdb_04_0015__p85758439269"><strong id="gaussdb_04_0015__b1575204311264">Status code: 400</strong></p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="gaussdb_04_0015__response_MysqlErrorResponse" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Response body parameters</caption><thead align="left"><tr id="gaussdb_04_0015__row185757438269"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.5.2.4.1.1"><p id="gaussdb_04_0015__p1857564312264">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.5.2.4.1.2"><p id="gaussdb_04_0015__p057624311264">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.5.2.4.1.3"><p id="gaussdb_04_0015__p1457674319269">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="gaussdb_04_0015__row12575843102617"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.5.2.4.1.1 "><p id="gaussdb_04_0015__p2057694311267">error_code</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.5.2.4.1.2 "><p id="gaussdb_04_0015__p115761643152617">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.5.2.4.1.3 "><p id="gaussdb_04_0015__p657684392610">Error code.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="gaussdb_04_0015__row9575174310268"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.5.2.4.1.1 "><p id="gaussdb_04_0015__p1576164316269">error_msg</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.5.2.4.1.2 "><p id="gaussdb_04_0015__p115761543192611">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.5.2.4.1.3 "><p id="gaussdb_04_0015__p1857715432268">Error message.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="gaussdb_04_0015__p20577114312612"><strong id="gaussdb_04_0015__b1957711433265">Status code: 500</strong></p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="gaussdb_04_0015__table1657784372617" frame="border" border="1" rules="all"><caption><b>Table 6 </b>Response body parameters</caption><thead align="left"><tr id="gaussdb_04_0015__row4577543122611"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.7.2.4.1.1"><p id="gaussdb_04_0015__p175773435264">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.7.2.4.1.2"><p id="gaussdb_04_0015__p1957713436264">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.7.2.4.1.3"><p id="gaussdb_04_0015__p857812437266">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="gaussdb_04_0015__row10577174352613"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.7.2.4.1.1 "><p id="gaussdb_04_0015__p165785432265">error_code</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.7.2.4.1.2 "><p id="gaussdb_04_0015__p195781043132612">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.7.2.4.1.3 "><p id="gaussdb_04_0015__p7578943172615">Error code.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="gaussdb_04_0015__row35772430263"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.7.2.4.1.1 "><p id="gaussdb_04_0015__p195783437267">error_msg</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.7.2.4.1.2 "><p id="gaussdb_04_0015__p057820431266">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.7.2.4.1.3 "><p id="gaussdb_04_0015__p7578194332610">Error message.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="gaussdb_04_0015__section1578104314264"><h4 class="sectiontitle">Example Request</h4><p id="gaussdb_04_0015__p8579104312619">Creating a read replica</p>
|
|
<pre class="screen" id="gaussdb_04_0015__screen2579543152613">
|
|
POST https://gaussdb-mysql.eu-de.otc.t-systems.com/v3/054e292c9880d4992f02c0196d3ea468/instances/ba62a0b83a1b42bfab275829d86ac0fdin07/nodes/enlarge
|
|
{
|
|
"priorities" : [ 1, 2 ]
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="gaussdb_04_0015__section125792043172610"><h4 class="sectiontitle">Example Response</h4><p id="gaussdb_04_0015__p2579443162610"><strong id="gaussdb_04_0015__b156382135320">Status code: 201</strong></p>
|
|
<p id="gaussdb_04_0015__p15791543182615">Success.</p>
|
|
<pre class="screen" id="gaussdb_04_0015__screen1657904313268">{
|
|
"instance_id" : "ba62a0b83a1b42bfab275829d86ac0fdin07",
|
|
"node_names" : [ "taurusdb-ccf5_node03" ],
|
|
"job_id" : "dff1d289-4d03-4942-8b9f-463ea07c000d"
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="gaussdb_04_0015__section4778540915440"><h4 class="sectiontitle">Status Code</h4><p id="gaussdb_04_0015__p0723374409">For details, see <a href="gaussdb_10_0002.html">Status Codes</a>.</p>
|
|
</div>
|
|
<div class="section" id="gaussdb_04_0015__section946032144017"><h4 class="sectiontitle">Error Code</h4><p id="gaussdb_04_0015__p19357163913406">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_04_0003.html">Managing DB Instances</a></div>
|
|
</div>
|
|
</div>
|
|
|