forked from docs/doc-exports
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>
253 lines
17 KiB
HTML
253 lines
17 KiB
HTML
<a name="drs_03_0135"></a><a name="drs_03_0135"></a>
|
|
|
|
<h1 class="topictitle1">Setting Definers in Batches</h1>
|
|
<div id="body12102181310518"><div class="section" id="drs_03_0135__section10102171315111"><h4 class="sectiontitle">Function</h4><p id="drs_03_0135__p910211139513">The API is used to set whether to migrate Definers to the user in batches.</p>
|
|
<ul id="drs_03_0135__ul510316136514"><li id="drs_03_0135__li61031513135111">If you select <strong id="drs_03_0135__b114061758102912">Yes</strong>, the Definers of all source database objects will be migrated to the user. Other users do not have permissions on database objects unless they are authorized.</li><li id="drs_03_0135__li17103181320513">If you select <strong id="drs_03_0135__b83114121306">No</strong>, the Definers of all source database objects will not be changed. You need to migrate all accounts and permissions of the source database in the next step.</li></ul>
|
|
</div>
|
|
<div class="section" id="drs_03_0135__section20901627163916"><h4 class="sectiontitle">Constraints</h4><ul id="drs_03_0135__ul1582633623213"><li id="drs_03_0135__li482683673211">Only tasks that are being configured can call the API.</li></ul>
|
|
</div>
|
|
<div class="section" id="drs_03_0135__section10103201345110"><h4 class="sectiontitle">URI</h4><p id="drs_03_0135__p13103101310512">POST /v3/{project_id}/jobs/batch-replace-definer</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="drs_03_0135__table191049133517" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path parameters</caption><thead align="left"><tr id="drs_03_0135__row01034133519"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="drs_03_0135__p16104513195120">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_0135__p12104161355111">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_0135__p8104171395113">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_0135__p17104713205117">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="drs_03_0135__row10103121355115"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="drs_03_0135__p1510441314513">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="drs_03_0135__p510415130512">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="drs_03_0135__p9104161385115">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="drs_03_0135__p7105913115117">Project ID of a tenant in a region</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="drs_03_0135__section3105161312513"><h4 class="sectiontitle">Request Parameters</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="drs_03_0135__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="drs_03_0135__row20105181310519"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.1"><p id="drs_03_0135__p81051130514">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_0135__p9106213155115">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_0135__p1310611134518">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_0135__p2010618131511">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="drs_03_0135__row16105111335111"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p id="drs_03_0135__p15106121315516">Content-Type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p id="drs_03_0135__p1310610131515">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p id="drs_03_0135__p11064134516">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p id="drs_03_0135__p14686114034714">The content type.</p>
|
|
<p id="drs_03_0135__p123256415450">The default value is <strong id="drs_03_0135__b1620364414719">application/json</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="drs_03_0135__row6105413185111"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p id="drs_03_0135__p910761345110">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_0135__p10107111315518">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p id="drs_03_0135__p18107121314518">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p id="drs_03_0135__p7107161318514">User token obtained from IAM.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="drs_03_0135__row1010517130519"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p id="drs_03_0135__p16107101345114">X-Language</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p id="drs_03_0135__p01071313205114">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p id="drs_03_0135__p16107141345110">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p id="drs_03_0135__p61071013115118">Request language type</p>
|
|
<p id="drs_03_0135__p68691956125917">Default value: <strong id="drs_03_0135__b1786912566599">en-us</strong></p>
|
|
<p id="drs_03_0135__p1386915625912">Values:</p>
|
|
<ul id="drs_03_0135__ul1586965613591"><li id="drs_03_0135__li1886915655910"><strong id="drs_03_0135__b158691656145912">en-us</strong></li><li id="drs_03_0135__li17869125685916"><strong id="drs_03_0135__b12869175615914">zh-cn</strong></li></ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="drs_03_0135__requestParameter" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request body parameters</caption><thead align="left"><tr id="drs_03_0135__row10108413165114"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.5.1.1"><p id="drs_03_0135__p131081313145113">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_0135__p1110841317516">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_0135__p11082139518">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_0135__p10109181311514">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="drs_03_0135__row1810817138517"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.5.1.1 "><p id="drs_03_0135__p1210941395114">jobs</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.5.1.2 "><p id="drs_03_0135__p14109161335111">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.5.1.3 "><p id="drs_03_0135__p101097134511">Array of <a href="#drs_03_0135__request_ReplaceDefinerInfo">ReplaceDefinerInfo</a> objects</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.3.2.5.1.4 "><p id="drs_03_0135__p131096130515">List of requests for setting replaceDefiners in batches.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="drs_03_0135__request_ReplaceDefinerInfo"></a><a name="request_ReplaceDefinerInfo"></a><table cellpadding="4" cellspacing="0" summary="" id="drs_03_0135__request_ReplaceDefinerInfo" frame="border" border="1" rules="all"><caption><b>Table 4 </b>ReplaceDefinerInfo</caption><thead align="left"><tr id="drs_03_0135__row121111413175113"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.5.1.1"><p id="drs_03_0135__p6111111375120">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.5.1.2"><p id="drs_03_0135__p20111181345118">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.5.1.3"><p id="drs_03_0135__p411114135514">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.4.4.2.5.1.4"><p id="drs_03_0135__p5111131313513">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="drs_03_0135__row411115137519"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.5.1.1 "><p id="drs_03_0135__p9112151315517">job_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.5.1.2 "><p id="drs_03_0135__p7112613115116">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.5.1.3 "><p id="drs_03_0135__p71121513155111">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.4.2.5.1.4 "><p id="drs_03_0135__p10112111313517">Task ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="drs_03_0135__row181118137516"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.5.1.1 "><p id="drs_03_0135__p15112141317514">replace_definer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.5.1.2 "><p id="drs_03_0135__p13113121319513">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.5.1.3 "><p id="drs_03_0135__p141131313125113">Boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.4.2.5.1.4 "><p id="drs_03_0135__p8113113155115">Whether to replace the definer with the destination database user.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="drs_03_0135__section711361311514"><h4 class="sectiontitle">Response Parameters</h4><p id="drs_03_0135__p121131913145118"><strong id="drs_03_0135__b14113101310519">Status code: 200</strong></p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="drs_03_0135__responseParameter" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Response body parameters</caption><thead align="left"><tr id="drs_03_0135__row10113161355114"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.5.3.2.4.1.1"><p id="drs_03_0135__p15114131335115">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_0135__p1611413132516">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_0135__p14114813135116">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="drs_03_0135__row141133134510"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.3.2.4.1.1 "><p id="drs_03_0135__p311471313512">count</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.3.2.4.1.2 "><p id="drs_03_0135__p1911481355118">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.5.3.2.4.1.3 "><p id="drs_03_0135__p191151913205115">Total number.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="drs_03_0135__row12113151375117"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.3.2.4.1.1 "><p id="drs_03_0135__p201158135513">results</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.3.2.4.1.2 "><p id="drs_03_0135__p811561317516">Array of <a href="#drs_03_0135__response_ModifyJobResp">ModifyJobResp</a> objects</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.5.3.2.4.1.3 "><p id="drs_03_0135__p511511131513">List of tasks that are modified in batches.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="drs_03_0135__response_ModifyJobResp"></a><a name="response_ModifyJobResp"></a><table cellpadding="4" cellspacing="0" summary="" id="drs_03_0135__response_ModifyJobResp" frame="border" border="1" rules="all"><caption><b>Table 6 </b>ModifyJobResp</caption><thead align="left"><tr id="drs_03_0135__row141151413165110"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.5.4.2.4.1.1"><p id="drs_03_0135__p161163138512">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.5.4.2.4.1.2"><p id="drs_03_0135__p14116121375116">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.5.4.2.4.1.3"><p id="drs_03_0135__p12116171365111">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="drs_03_0135__row1711512139514"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.4.2.4.1.1 "><p id="drs_03_0135__p1911651315512">id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.4.2.4.1.2 "><p id="drs_03_0135__p611615135515">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.5.4.2.4.1.3 "><p id="drs_03_0135__p18116121335112">Task ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="drs_03_0135__row1311531365119"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.4.2.4.1.1 "><p id="drs_03_0135__p4117141310515">status</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.4.2.4.1.2 "><p id="drs_03_0135__p7117213155117">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.5.4.2.4.1.3 "><p id="drs_03_0135__p9117181317515">Status Values:</p>
|
|
<ul id="drs_03_0135__ul14117313165117"><li id="drs_03_0135__li31172131512"><strong id="drs_03_0135__b1293215374339">success</strong>: The task is successful.</li><li id="drs_03_0135__li5117181365115"><strong id="drs_03_0135__b72834043314">failed</strong>: The task fails.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="drs_03_0135__row1611511311510"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.4.2.4.1.1 "><p id="drs_03_0135__p11172136517">error_code</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.4.2.4.1.2 "><p id="drs_03_0135__p7117813195118">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.5.4.2.4.1.3 "><p id="drs_03_0135__p41183138518">Error code, which is optional and indicates the returned information about the failure status.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="drs_03_0135__row511571314513"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.4.2.4.1.1 "><p id="drs_03_0135__p14118191365113">error_msg</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.4.2.4.1.2 "><p id="drs_03_0135__p211811316518">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.5.4.2.4.1.3 "><p id="drs_03_0135__p11118913175117">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_0135__section1111881319519"><h4 class="sectiontitle">Example Request</h4><p id="drs_03_0135__p3118181355118">Example of setting DR definers in batches:</p>
|
|
<pre class="screen" id="drs_03_0135__screen57049716344">https://{EndPoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-replace-definer</pre>
|
|
<pre class="screen" id="drs_03_0135__screen398941219346">{
|
|
"jobs" : [ {
|
|
"job_id" : "7c685701-bfb5-4bb9-89f1-d0567f5jb502",
|
|
"replace_definer" : true
|
|
} ]
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="drs_03_0135__section121197133516"><h4 class="sectiontitle">Example Response</h4><p id="drs_03_0135__p9119141325119"><strong id="drs_03_0135__b14119513155117">Status code: 200</strong></p>
|
|
<p id="drs_03_0135__p1111910136517">OK</p>
|
|
<pre class="screen" id="drs_03_0135__screen3120161375115">{
|
|
"count" : 1,
|
|
"results" : [ {
|
|
"id" : "7c685701-bfb5-4bb9-89f1-d0567f5jb502",
|
|
"status" : "success"
|
|
} ]
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="drs_03_0135__section312011355119"><h4 class="sectiontitle">Status Code</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="drs_03_0135__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="drs_03_0135__row121206139511"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.8.2.1.3.1.1"><p id="drs_03_0135__p11121151385118">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_0135__p12121191345113">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="drs_03_0135__row101201413135119"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p id="drs_03_0135__p1112118134511">200</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p id="drs_03_0135__p229265781613">OK</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="drs_03_0135__row131201913115119"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p id="drs_03_0135__p12121141313515">400</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p id="drs_03_0135__p16121013165117">Bad Request</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="drs_03_0135__section9121121355118"><h4 class="sectiontitle">Error Code</h4><p id="drs_03_0135__p412211365114">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_03_0101.html">Public API Management</a></div>
|
|
</div>
|
|
</div>
|
|
|