doc-exports/docs/drs/api-ref/drs_03_0147.html
Wang , Deng Ke 231618c804 DRS API 2.0.38SP23 version
Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: Wang , Deng Ke <wangdengke2@huawei.com>
Co-committed-by: Wang , Deng Ke <wangdengke2@huawei.com>
2022-11-24 16:49:13 +00:00

198 lines
14 KiB
HTML

<a name="drs_03_0147"></a><a name="drs_03_0147"></a>
<h1 class="topictitle1">Performing a Switchover</h1>
<div id="body0000001120896123"><div class="section" id="drs_03_0147__section1966734303620"><h4 class="sectiontitle">Function</h4><p id="drs_03_0147__p19676174333616">This API is used to switch over virtual IP addresses.</p>
</div>
<div class="section" id="drs_03_0147__section667813439369"><h4 class="sectiontitle">Constraints</h4><p id="drs_03_0147__p867914316367">Only synchronization between self-built databases supports the dual virtual IP address switchover.</p>
</div>
<div class="section" id="drs_03_0147__section668074313360"><h4 class="sectiontitle">URI</h4><p id="drs_03_0147__p96811843193612">POST /v3/{project_id}/jobs/{job_id}/switch-vip</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="drs_03_0147__table15684743113619" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path parameters</caption><thead align="left"><tr id="drs_03_0147__row168394316363"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="drs_03_0147__p468511432360">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p id="drs_03_0147__p126861343143619">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p id="drs_03_0147__p1168824343612">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p id="drs_03_0147__p069074313615">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="drs_03_0147__row26831843163618"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="drs_03_0147__p196913430363">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="drs_03_0147__p186933439364">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="drs_03_0147__p206951543153615">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="drs_03_0147__p12696144383612">Project ID of a tenant in a region.</p>
</td>
</tr>
<tr id="drs_03_0147__row9640123115813"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="drs_03_0147__p116403234586">job_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="drs_03_0147__p176405239589">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="drs_03_0147__p17640723135812">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="drs_03_0147__p17640162375815">Job ID of a tenant in a region. If the task is a cross-AZ task, the parent task ID is used.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="drs_03_0147__section166975438363"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="drs_03_0147__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="drs_03_0147__row1869920432367"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.1"><p id="drs_03_0147__p1970264353612">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.2"><p id="drs_03_0147__p16704543153611">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.3"><p id="drs_03_0147__p270544314360">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.4.2.2.5.1.4"><p id="drs_03_0147__p157061243133618">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="drs_03_0147__row8699204373618"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p id="drs_03_0147__p6707943153611">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p id="drs_03_0147__p470812431361">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p id="drs_03_0147__p13710144311365">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p id="drs_03_0147__p019214931311">The content type.</p>
<p id="drs_03_0147__p123256415450">The default value is <strong id="drs_03_0147__b13628175318133">application/json</strong>.</p>
</td>
</tr>
<tr id="drs_03_0147__row1569964383615"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p id="drs_03_0147__p11713104373612">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p id="drs_03_0147__p127141043153610">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p id="drs_03_0147__p27159438365">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p id="drs_03_0147__p6716543113619">User token obtained from IAM.</p>
</td>
</tr>
<tr id="drs_03_0147__row206994433364"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p id="drs_03_0147__p771894311364">X-Language</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p id="drs_03_0147__p872014438369">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p id="drs_03_0147__p1572204333619">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p id="drs_03_0147__p4869125616598">Request language type</p>
<p id="drs_03_0147__p68691956125917">Default value: <strong id="drs_03_0147__b1786912566599">en-us</strong></p>
<p id="drs_03_0147__p1386915625912">Values:</p>
<ul id="drs_03_0147__ul1586965613591"><li id="drs_03_0147__li1886915655910"><strong id="drs_03_0147__b158691656145912">en-us</strong></li><li id="drs_03_0147__li17869125685916"><strong id="drs_03_0147__b12869175615914">zh-cn</strong></li></ul>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="drs_03_0147__requestParameter" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request body parameters</caption><thead align="left"><tr id="drs_03_0147__row2072512433363"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.5.1.1"><p id="drs_03_0147__p6727144313369">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.5.1.2"><p id="drs_03_0147__p372824363614">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.5.1.3"><p id="drs_03_0147__p197298433369">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.4.3.2.5.1.4"><p id="drs_03_0147__p1873015434361">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="drs_03_0147__row1672534313611"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.5.1.1 "><p id="drs_03_0147__p7731643113613">mode</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.5.1.2 "><p id="drs_03_0147__p1573234303612">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.5.1.3 "><p id="drs_03_0147__p673314318368">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.3.2.5.1.4 "><p id="drs_03_0147__p1380412101719">Switchover type. Values:</p>
<ul id="drs_03_0147__ul108044108114"><li id="drs_03_0147__li680418105113"><strong id="drs_03_0147__b1146852472510">source</strong>: Switch over the virtual IP address of the source database.</li><li id="drs_03_0147__li180415101817"><strong id="drs_03_0147__b1680461016116">target</strong>: Switch over the virtual IP address of the destination database.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="drs_03_0147__section1073664312365"><h4 class="sectiontitle">Response Parameters</h4><p id="drs_03_0147__p5737743193613"><strong id="drs_03_0147__b1873717437366">Status code: 202</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="drs_03_0147__responseParameter" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Response body parameters</caption><thead align="left"><tr id="drs_03_0147__row87391343163611"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.5.3.2.4.1.1"><p id="drs_03_0147__p1974214433365">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.5.3.2.4.1.2"><p id="drs_03_0147__p157431843113610">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.5.3.2.4.1.3"><p id="drs_03_0147__p11745134323614">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="drs_03_0147__row073924310368"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.3.2.4.1.1 "><p id="drs_03_0147__p187461843153612">id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.3.2.4.1.2 "><p id="drs_03_0147__p774774343618">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.5.3.2.4.1.3 "><p id="drs_03_0147__p1374817434366">Task ID.</p>
</td>
</tr>
<tr id="drs_03_0147__row18740144323612"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.3.2.4.1.1 "><p id="drs_03_0147__p20749154313618">status</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.3.2.4.1.2 "><p id="drs_03_0147__p97521543113617">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.5.3.2.4.1.3 "><p id="drs_03_0147__p187531843193610">Status Values:</p>
<ul id="drs_03_0147__ul9133134412716"><li id="drs_03_0147__li5133164418718"><strong id="drs_03_0147__b937573990111151">success</strong>: The task is successful.</li><li id="drs_03_0147__li51337441479"><strong id="drs_03_0147__b1713318441079">failed</strong>: The task fails.</li></ul>
</td>
</tr>
<tr id="drs_03_0147__row163451459627"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.3.2.4.1.1 "><p id="drs_03_0147__p10345185918216">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.3.2.4.1.2 "><p id="drs_03_0147__p634516593220">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.5.3.2.4.1.3 "><p id="drs_03_0147__p1934617591026">Error code, which is optional and indicates the returned information about the failure status.</p>
</td>
</tr>
<tr id="drs_03_0147__row182501854728"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.3.2.4.1.1 "><p id="drs_03_0147__p92511754428">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.3.2.4.1.2 "><p id="drs_03_0147__p425117541726">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.5.3.2.4.1.3 "><p id="drs_03_0147__p82511054427">Error message, which is optional and indicates the returned information about the failure status.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="drs_03_0147__section1929315441366"><h4 class="sectiontitle">Example Request</h4><p id="drs_03_0147__p1629424412366">Example of batch primary/standby switchover:</p>
<pre class="screen" id="drs_03_0147__screen6908142841415">https://{EndPoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/8c81a12f-2581-4424-a3ab-70ed874jb201/switch-vip</pre>
<pre class="screen" id="drs_03_0147__screen47795331143">{
"mode": "source"
}</pre>
</div>
<div class="section" id="drs_03_0147__section192961144113620"><h4 class="sectiontitle">Example Response</h4><p id="drs_03_0147__p62971644153610"><strong id="drs_03_0147__b82971044153616">Status code: 202</strong></p>
<p id="drs_03_0147__p18298144463615">Accepted</p>
<pre class="screen" id="drs_03_0147__screen5298144413361">{
"id": "8c81a12f-2581-4424-a3ab-70ed874jb201",
"status": "success"
}</pre>
</div>
<div class="section" id="drs_03_0147__section1634515449362"><h4 class="sectiontitle">Status Code</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="drs_03_0147__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="drs_03_0147__row7116154433611"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.8.2.1.3.1.1"><p id="drs_03_0147__p934654413369">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.8.2.1.3.1.2"><p id="drs_03_0147__p834754433612">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="drs_03_0147__row0116174443610"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p id="drs_03_0147__p634724433615">202</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p id="drs_03_0147__p02051125534">Accepted</p>
</td>
</tr>
<tr id="drs_03_0147__row5116144413610"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p id="drs_03_0147__p83482441365">400</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p id="drs_03_0147__p203491448361">Bad Request</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="drs_03_0147__section1835084418368"><h4 class="sectiontitle">Error code</h4><p id="drs_03_0147__p16350184418367">For details, see <a href="drs_05_0004.html">Error Code</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="drs_api_0100.html">Real-Time Synchronization Management</a></div>
</div>
</div>