forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com> Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
194 lines
17 KiB
HTML
194 lines
17 KiB
HTML
<a name="dli_02_0030"></a><a name="dli_02_0030"></a>
|
|
|
|
<h1 class="topictitle1">Deleting a Database</h1>
|
|
<div id="body8662426"><div class="section" id="dli_02_0030__sa13cbeda85f34f68b7ffe23a6b3694be"><h4 class="sectiontitle">Function</h4><p id="dli_02_0030__en-us_topic_0069077900_p39307221">This API is used to delete an empty database. If there are tables in the database to be deleted, delete all tables first. For details about the API used to delete tables, see <a href="dli_02_0035.html">Deleting a Table</a>.</p>
|
|
</div>
|
|
<div class="section" id="dli_02_0030__s76ec26453c494522bc61577d298e6169"><h4 class="sectiontitle">URI</h4><ul id="dli_02_0030__en-us_topic_0069077900_ul29768296"><li id="dli_02_0030__en-us_topic_0069077900_li66588080">URI format<p id="dli_02_0030__en-us_topic_0069077900_p62421813"><a name="dli_02_0030__en-us_topic_0069077900_li66588080"></a><a name="en-us_topic_0069077900_li66588080"></a>DELETE /v1.0/{project_id}/databases/{database_name}</p>
|
|
</li><li id="dli_02_0030__li1882672915229">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0030__en-us_topic_0069077900_table24925408" frame="border" border="1" rules="all"><caption><b>Table 1 </b>URI parameters</caption><thead align="left"><tr id="dli_02_0030__en-us_topic_0069077900_row34480443"><th align="left" class="cellrowborder" valign="top" width="15.690000000000001%" id="mcps1.3.2.2.2.1.2.5.1.1"><p id="dli_02_0030__en-us_topic_0069077900_p221123931219">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.11%" id="mcps1.3.2.2.2.1.2.5.1.2"><p id="dli_02_0030__en-us_topic_0069077900_p142163951217">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="14.67%" id="mcps1.3.2.2.2.1.2.5.1.3"><p id="dli_02_0030__p194353381513">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="57.53%" id="mcps1.3.2.2.2.1.2.5.1.4"><p id="dli_02_0030__en-us_topic_0069077900_p192163921212">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dli_02_0030__row1352843534111"><td class="cellrowborder" valign="top" width="15.690000000000001%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="dli_02_0030__en-us_topic_0069077803_p43412436">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.11%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="dli_02_0030__en-us_topic_0069077803_p26746391">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.67%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="dli_02_0030__p10944333171519">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.53%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="dli_02_0030__p1310472724012">Project ID, which is used for resource isolation. For details about how to obtain its value, see <a href="dli_02_0183.html">Obtaining a Project ID</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0030__en-us_topic_0069077900_row49602485"><td class="cellrowborder" valign="top" width="15.690000000000001%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="dli_02_0030__en-us_topic_0069077900_p58378347">database_name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.11%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="dli_02_0030__en-us_topic_0069077900_p31025637">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.67%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="dli_02_0030__p9944233121511">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.53%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="dli_02_0030__en-us_topic_0069077900_p30048651">Name of the database to be deleted.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0030__table134271449113610" frame="border" border="1" rules="all"><caption><b>Table 2 </b><strong id="dli_02_0030__b12051719184510">query</strong> parameter description</caption><thead align="left"><tr id="dli_02_0030__row1642854993616"><th align="left" class="cellrowborder" valign="top" width="12.36%" id="mcps1.3.2.2.2.2.2.5.1.1"><p id="dli_02_0030__p16428649173618">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="10.299999999999999%" id="mcps1.3.2.2.2.2.2.5.1.2"><p id="dli_02_0030__p3428549193619">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="10.79%" id="mcps1.3.2.2.2.2.2.5.1.3"><p id="dli_02_0030__p889318422158">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="66.55%" id="mcps1.3.2.2.2.2.2.5.1.4"><p id="dli_02_0030__p11428164963610">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dli_02_0030__row1242814914367"><td class="cellrowborder" valign="top" width="12.36%" headers="mcps1.3.2.2.2.2.2.5.1.1 "><p id="dli_02_0030__p74281649103618">cascade</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.299999999999999%" headers="mcps1.3.2.2.2.2.2.5.1.2 "><p id="dli_02_0030__p154282049163612">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.79%" headers="mcps1.3.2.2.2.2.2.5.1.3 "><p id="dli_02_0030__p17893154211157">Boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.55%" headers="mcps1.3.2.2.2.2.2.5.1.4 "><p id="dli_02_0030__p1842854917361">Specifies whether to forcibly delete the database. The value can be <span class="parmvalue" id="dli_02_0030__parmvalue22281025104515"><b>true</b></span> or <span class="parmvalue" id="dli_02_0030__parmvalue152333258452"><b>false</b></span>. Default value: <strong id="dli_02_0030__b1614285919566">false</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0030__row44298494361"><td class="cellrowborder" valign="top" width="12.36%" headers="mcps1.3.2.2.2.2.2.5.1.1 "><p id="dli_02_0030__p74291849173610">async</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.299999999999999%" headers="mcps1.3.2.2.2.2.2.5.1.2 "><p id="dli_02_0030__p1442911491365">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.79%" headers="mcps1.3.2.2.2.2.2.5.1.3 "><p id="dli_02_0030__p989394212151">Boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.55%" headers="mcps1.3.2.2.2.2.2.5.1.4 "><p id="dli_02_0030__p1429449173613">Specifies whether to delete the database in asynchronous mode. The value can be <span class="parmvalue" id="dli_02_0030__parmvalue27291028144511"><b>true</b></span> or <span class="parmvalue" id="dli_02_0030__parmvalue673016288450"><b>false</b></span>. Default value: <strong id="dli_02_0030__b1022951348">false</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="note" id="dli_02_0030__note874575432112"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dli_02_0030__p1751115420213">The following is an example of the URL containing the <strong id="dli_02_0030__b14308163015450">query</strong> parameter:</p>
|
|
<p id="dli_02_0030__p2289101019226">DELETE /v1.0/{project_id}/databases/{database_name}?cascade=<i><span class="varname" id="dli_02_0030__varname3879813102319">{is_cascade}</span></i>&async=<i><span class="varname" id="dli_02_0030__varname9879171315235">{is_asyn}</span></i></p>
|
|
</div></div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="dli_02_0030__sdb9dc26132c54fde925945feb903a134"><h4 class="sectiontitle">Request</h4><p id="dli_02_0030__p55140995151956">None</p>
|
|
</div>
|
|
<div class="section" id="dli_02_0030__s8a3d8c86acbf4e98a6b73ac38f63a869"><h4 class="sectiontitle">Response</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0030__en-us_topic_0069077900_table45599904" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response parameters</caption><thead align="left"><tr id="dli_02_0030__en-us_topic_0069077900_row22984642"><th align="left" class="cellrowborder" valign="top" width="13.87%" id="mcps1.3.4.2.2.5.1.1"><p id="dli_02_0030__ae4b31da1248240e787354f0c26c8dde6">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15.6%" id="mcps1.3.4.2.2.5.1.2"><p id="dli_02_0030__p46381133181414">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="11.940000000000001%" id="mcps1.3.4.2.2.5.1.3"><p id="dli_02_0030__af8d1f142427a4b30bafd4ac82aa329e4">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="58.589999999999996%" id="mcps1.3.4.2.2.5.1.4"><p id="dli_02_0030__abc63f19d94ec436a91e8ff4edb81b19b">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dli_02_0030__en-us_topic_0069077900_row42491497"><td class="cellrowborder" valign="top" width="13.87%" headers="mcps1.3.4.2.2.5.1.1 "><p id="dli_02_0030__en-us_topic_0069077900_p19259243">is_success</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.6%" headers="mcps1.3.4.2.2.5.1.2 "><p id="dli_02_0030__p963916339140">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="11.940000000000001%" headers="mcps1.3.4.2.2.5.1.3 "><p id="dli_02_0030__en-us_topic_0069077900_p61016413">Boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="58.589999999999996%" headers="mcps1.3.4.2.2.5.1.4 "><p id="dli_02_0030__p951191911144">Whether the request is successfully executed. Value <span class="parmvalue" id="dli_02_0030__parmvalue54087171691"><b>true</b></span> indicates that the request is successfully executed.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0030__en-us_topic_0069077900_row54897543"><td class="cellrowborder" valign="top" width="13.87%" headers="mcps1.3.4.2.2.5.1.1 "><p id="dli_02_0030__en-us_topic_0069077900_p17515980">message</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.6%" headers="mcps1.3.4.2.2.5.1.2 "><p id="dli_02_0030__p96391533121414">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="11.940000000000001%" headers="mcps1.3.4.2.2.5.1.3 "><p id="dli_02_0030__en-us_topic_0069077900_p31974032">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="58.589999999999996%" headers="mcps1.3.4.2.2.5.1.4 "><p id="dli_02_0030__p195111195148">System prompt. If execution succeeds, the parameter setting may be left blank.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0030__row1370410137429"><td class="cellrowborder" valign="top" width="13.87%" headers="mcps1.3.4.2.2.5.1.1 "><p id="dli_02_0030__en-us_topic_0069077806_p12687257">job_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.6%" headers="mcps1.3.4.2.2.5.1.2 "><p id="dli_02_0030__en-us_topic_0069077806_p21034911">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="11.940000000000001%" headers="mcps1.3.4.2.2.5.1.3 "><p id="dli_02_0030__en-us_topic_0069077806_p26106237">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="58.589999999999996%" headers="mcps1.3.4.2.2.5.1.4 "><p id="dli_02_0030__en-us_topic_0069077806_p34230492">Returned job ID, which can be used to obtain the job status and result.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0030__row143291321124213"><td class="cellrowborder" valign="top" width="13.87%" headers="mcps1.3.4.2.2.5.1.1 "><p id="dli_02_0030__en-us_topic_0069077806_p56640774">job_type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.6%" headers="mcps1.3.4.2.2.5.1.2 "><p id="dli_02_0030__en-us_topic_0069077806_p24499997">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="11.940000000000001%" headers="mcps1.3.4.2.2.5.1.3 "><p id="dli_02_0030__en-us_topic_0069077806_p38342769">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="58.589999999999996%" headers="mcps1.3.4.2.2.5.1.4 "><p id="dli_02_0030__en-us_topic_0069077806_p18756585">Type of a job. The options are as follows:</p>
|
|
<ul id="dli_02_0030__ud0cff9a09ee641b3a42e353020764dc1"><li id="dli_02_0030__l7d226b88efdd4fcf88d3788d27508a84">DDL</li><li id="dli_02_0030__l80c96c9d7b9e4a79af85e21d2a84ffcc">DCL</li><li id="dli_02_0030__l5c09b32e40cb44d2817ad58d9a998f4a">IMPORT</li><li id="dli_02_0030__l58fc4b78dd6c4ea198028097c40708a7">EXPORT</li><li id="dli_02_0030__l18a0e5076c9d43068f0ccb1e8a0176b2">QUERY</li><li id="dli_02_0030__l190ec97d1c504ae4bd4e74bc05b39330">INSERT</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0030__row625942711426"><td class="cellrowborder" valign="top" width="13.87%" headers="mcps1.3.4.2.2.5.1.1 "><p id="dli_02_0030__p222905218240">job_mode</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.6%" headers="mcps1.3.4.2.2.5.1.2 "><p id="dli_02_0030__p3229125212417">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="11.940000000000001%" headers="mcps1.3.4.2.2.5.1.3 "><p id="dli_02_0030__p922911524243">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="58.589999999999996%" headers="mcps1.3.4.2.2.5.1.4 "><p id="dli_02_0030__p4229105292420">Job execution mode. The options are as follows:</p>
|
|
<ul id="dli_02_0030__ul194411241202517"><li id="dli_02_0030__li16442124112518"><strong id="dli_02_0030__b64498715919">async</strong>: asynchronous</li><li id="dli_02_0030__li2441252182510"><strong id="dli_02_0030__b14373178195917">sync</strong>: synchronous</li></ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="dli_02_0030__section121050712911"><h4 class="sectiontitle">Example Request</h4><p id="dli_02_0030__p519013181918">None</p>
|
|
</div>
|
|
<div class="section" id="dli_02_0030__section3787792151930"><h4 class="sectiontitle">Example Response</h4><ul id="dli_02_0030__ul36243147151941"><li id="dli_02_0030__li21129338151948">The following is an example of a successful response in synchronous mode:<pre class="screen" id="dli_02_0030__screen55946316151948">{
|
|
"is_success": true,
|
|
"message": "",
|
|
"job_mode": "sync"
|
|
}</pre>
|
|
</li><li id="dli_02_0030__li112133271414">The following is an example of a successful response in asynchronous mode:<pre class="screen" id="dli_02_0030__screen1616623662719">{
|
|
"is_success": true,
|
|
"message": "",
|
|
"job_id": "208b08d4-0dc2-4dd7-8879-ddd4c020d7aa",
|
|
"job_type": "DDL",
|
|
"job_mode": "async"
|
|
}</pre>
|
|
<div class="note" id="dli_02_0030__note2026932161417"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="dli_02_0030__ul182618320147"><li id="dli_02_0030__li12267327149">If the database is deleted asynchronously, you can view the current job status by calling the API for querying job status. For details, see <a href="dli_02_0021.html">Querying Job Status</a>.</li><li id="dli_02_0030__li42618322147">If <strong id="dli_02_0030__b1924110189464">cascade</strong> is set to <strong id="dli_02_0030__b2242318144617">true</strong>, all tables in the database will be deleted. Exercise caution when performing this operation.</li></ul>
|
|
</div></div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="dli_02_0030__sf39cfd445ad24e9e82754fcb0027179d"><h4 class="sectiontitle">Status Codes</h4><p id="dli_02_0030__a04144ca3a08e4576b386c6a98f43a2ae"><a href="#dli_02_0030__tb12870f1c5f24b27abd55ca24264af36">Table 4</a> describes the status code.</p>
|
|
|
|
<div class="tablenoborder"><a name="dli_02_0030__tb12870f1c5f24b27abd55ca24264af36"></a><a name="tb12870f1c5f24b27abd55ca24264af36"></a><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0030__tb12870f1c5f24b27abd55ca24264af36" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Status codes</caption><thead align="left"><tr id="dli_02_0030__r8d54231f95b14c01a5e55e95f3b2e838"><th align="left" class="cellrowborder" valign="top" width="30%" id="mcps1.3.7.3.2.3.1.1"><p id="dli_02_0030__ab49d21f312644072a331f43e92baf853">Status Code</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="70%" id="mcps1.3.7.3.2.3.1.2"><p id="dli_02_0030__aea1d3bd107bb4c499da79a88832d256c">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dli_02_0030__r211ad4eb571d4d938e5579998723174e"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.7.3.2.3.1.1 "><p id="dli_02_0030__a3153e07b3a9749adba92599fe6628fbf">200</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.7.3.2.3.1.2 "><p id="dli_02_0030__p104431642124811">Deletion succeeded.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0030__row44937531727"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.7.3.2.3.1.1 "><p id="dli_02_0030__p184941532219">400</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.7.3.2.3.1.2 "><p id="dli_02_0030__p2049413539219">Request error.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0030__row65331212142411"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.7.3.2.3.1.1 "><p id="dli_02_0030__p5537171216249">500</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.7.3.2.3.1.2 "><p id="dli_02_0030__p953813124249">Internal service error.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="dli_02_0030__section13596141025715"><h4 class="sectiontitle">Error Codes</h4><p id="dli_02_0030__p420584425712">If an error occurs when this API is invoked, the system does not return the result similar to the preceding example, but returns the error code and error information. For details, see <a href="dli_02_0056.html">Error Code</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_02_0027.html">Database-related APIs</a></div>
|
|
</div>
|
|
</div>
|
|
|