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>
169 lines
12 KiB
HTML
169 lines
12 KiB
HTML
<a name="dli_02_0040"></a><a name="dli_02_0040"></a>
|
|
|
|
<h1 class="topictitle1">Querying Database Users</h1>
|
|
<div id="body8662426"><div class="section" id="dli_02_0040__s9022b362116544488f1346cc1330f2ee"><h4 class="sectiontitle">Function</h4><p id="dli_02_0040__en-us_topic_0069077917_p3792148">This API is used query names of all users who have permission to use or access the database.</p>
|
|
</div>
|
|
<div class="section" id="dli_02_0040__sfefe36e9d87c4dd78c1400e0b9a5cffe"><h4 class="sectiontitle">URI</h4><ul id="dli_02_0040__en-us_topic_0069077917_ul38728568"><li id="dli_02_0040__en-us_topic_0069077917_li13012799">URI format<p id="dli_02_0040__en-us_topic_0069077917_p50006333"><a name="dli_02_0040__en-us_topic_0069077917_li13012799"></a><a name="en-us_topic_0069077917_li13012799"></a>GET /v1.0/{project_id}/databases/{database_name}/users</p>
|
|
</li><li id="dli_02_0040__li9995104782719">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0040__en-us_topic_0069077917_table47403819" frame="border" border="1" rules="all"><caption><b>Table 1 </b>URI parameters</caption><thead align="left"><tr id="dli_02_0040__en-us_topic_0069077917_row13090998"><th align="left" class="cellrowborder" valign="top" width="16.61%" id="mcps1.3.2.2.2.1.2.4.1.1"><p id="dli_02_0040__en-us_topic_0069077917_p138515164287">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="13.700000000000001%" id="mcps1.3.2.2.2.1.2.4.1.2"><p id="dli_02_0040__a975463c647c04e418957975355d8d889">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="69.69%" id="mcps1.3.2.2.2.1.2.4.1.3"><p id="dli_02_0040__en-us_topic_0069077917_p53855166283">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dli_02_0040__row17061240154210"><td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.2.2.2.1.2.4.1.1 "><p id="dli_02_0040__en-us_topic_0069077803_p43412436">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.700000000000001%" headers="mcps1.3.2.2.2.1.2.4.1.2 "><p id="dli_02_0040__en-us_topic_0069077803_p26746391">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="69.69%" headers="mcps1.3.2.2.2.1.2.4.1.3 "><p id="dli_02_0040__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_0040__en-us_topic_0069077917_row27824106"><td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.2.2.2.1.2.4.1.1 "><p id="dli_02_0040__en-us_topic_0069077917_p39160124">database_name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.700000000000001%" headers="mcps1.3.2.2.2.1.2.4.1.2 "><p id="dli_02_0040__en-us_topic_0069077917_p17853499">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="69.69%" headers="mcps1.3.2.2.2.1.2.4.1.3 "><p id="dli_02_0040__p4353182211446">Name of the database to be queried.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="dli_02_0040__s3e4b9bd8028f44d4a50de99e54b5c834"><h4 class="sectiontitle">Request</h4><p id="dli_02_0040__p17630940153718">None</p>
|
|
</div>
|
|
<div class="section" id="dli_02_0040__sc635755e28ef4e23a5f935721506b136"><h4 class="sectiontitle">Response</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0040__en-us_topic_0069077917_table58402585" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Response parameters</caption><thead align="left"><tr id="dli_02_0040__en-us_topic_0069077917_row40562973"><th align="left" class="cellrowborder" valign="top" width="15.57%" id="mcps1.3.4.2.2.5.1.1"><p id="dli_02_0040__a40b1c2f3eab7411b88a4926575e040e9">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="10.24%" id="mcps1.3.4.2.2.5.1.2"><p id="dli_02_0040__p0213185416267">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="19.56%" id="mcps1.3.4.2.2.5.1.3"><p id="dli_02_0040__aa4b8c48a20094432b271bf115758f7c3">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="54.63%" id="mcps1.3.4.2.2.5.1.4"><p id="dli_02_0040__en-us_topic_0069077917_p872181062918">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dli_02_0040__en-us_topic_0069077917_row22452291"><td class="cellrowborder" valign="top" width="15.57%" headers="mcps1.3.4.2.2.5.1.1 "><p id="dli_02_0040__en-us_topic_0069077917_p6696265">is_success</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.24%" headers="mcps1.3.4.2.2.5.1.2 "><p id="dli_02_0040__p112131654192616">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.56%" headers="mcps1.3.4.2.2.5.1.3 "><p id="dli_02_0040__en-us_topic_0069077917_p45003772">Boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.63%" headers="mcps1.3.4.2.2.5.1.4 "><p id="dli_02_0040__p47191535121513">Whether the request is successfully executed. Value <span class="parmvalue" id="dli_02_0040__parmvalue66617595161051"><b>true</b></span> indicates that the request is successfully executed. Example value: <strong id="dli_02_0040__b12254944193513">true</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0040__en-us_topic_0069077917_row58624704"><td class="cellrowborder" valign="top" width="15.57%" headers="mcps1.3.4.2.2.5.1.1 "><p id="dli_02_0040__en-us_topic_0069077917_p50980558">message</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.24%" headers="mcps1.3.4.2.2.5.1.2 "><p id="dli_02_0040__p1521355482615">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.56%" headers="mcps1.3.4.2.2.5.1.3 "><p id="dli_02_0040__en-us_topic_0069077917_p12863387">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.63%" headers="mcps1.3.4.2.2.5.1.4 "><p id="dli_02_0040__p18719635161517">System prompt. If execution succeeds, the parameter setting may be left blank. Example value: left blank.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0040__en-us_topic_0069077917_row49277313"><td class="cellrowborder" valign="top" width="15.57%" headers="mcps1.3.4.2.2.5.1.1 "><p id="dli_02_0040__en-us_topic_0069077917_p32039392">database_name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.24%" headers="mcps1.3.4.2.2.5.1.2 "><p id="dli_02_0040__p3213354132616">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.56%" headers="mcps1.3.4.2.2.5.1.3 "><p id="dli_02_0040__en-us_topic_0069077917_p25491132">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.63%" headers="mcps1.3.4.2.2.5.1.4 "><p id="dli_02_0040__en-us_topic_0069077917_p51515784">Name of the database to be queried. Example value: <strong id="dli_02_0040__b134488587357">dsstest</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0040__row1486814573286"><td class="cellrowborder" valign="top" width="15.57%" headers="mcps1.3.4.2.2.5.1.1 "><p id="dli_02_0040__p138251311294">privileges</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.24%" headers="mcps1.3.4.2.2.5.1.2 "><p id="dli_02_0040__p7825734296">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.56%" headers="mcps1.3.4.2.2.5.1.3 "><p id="dli_02_0040__p17826103182912">Array of objects</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.63%" headers="mcps1.3.4.2.2.5.1.4 "><p id="dli_02_0040__p1826239296">Permission information. For details, see <a href="#dli_02_0040__table34433526275">Table 3</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="dli_02_0040__table34433526275"></a><a name="table34433526275"></a><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0040__table34433526275" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="dli_02_0040__b14221839142417">privileges</strong> parameters</caption><thead align="left"><tr id="dli_02_0040__row144431527271"><th align="left" class="cellrowborder" valign="top" width="15.57%" id="mcps1.3.4.3.2.5.1.1"><p id="dli_02_0040__p9444952202719">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="10.24%" id="mcps1.3.4.3.2.5.1.2"><p id="dli_02_0040__p15444125218277">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="10.780000000000001%" id="mcps1.3.4.3.2.5.1.3"><p id="dli_02_0040__p1444105232710">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="63.41%" id="mcps1.3.4.3.2.5.1.4"><p id="dli_02_0040__p124440522274">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dli_02_0040__row1844415524277"><td class="cellrowborder" valign="top" width="15.57%" headers="mcps1.3.4.3.2.5.1.1 "><p id="dli_02_0040__p59413180326">is_admin</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.24%" headers="mcps1.3.4.3.2.5.1.2 "><p id="dli_02_0040__p29421418113219">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.780000000000001%" headers="mcps1.3.4.3.2.5.1.3 "><p id="dli_02_0040__p1994219183326">Boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.41%" headers="mcps1.3.4.3.2.5.1.4 "><p id="dli_02_0040__p89421818163211">Whether the database user is an administrator. Example value: <strong id="dli_02_0040__b1597325923511">true</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0040__row944555216276"><td class="cellrowborder" valign="top" width="15.57%" headers="mcps1.3.4.3.2.5.1.1 "><p id="dli_02_0040__p4942018163211">user_name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.24%" headers="mcps1.3.4.3.2.5.1.2 "><p id="dli_02_0040__p594211853212">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.780000000000001%" headers="mcps1.3.4.3.2.5.1.3 "><p id="dli_02_0040__p6942141812326">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.41%" headers="mcps1.3.4.3.2.5.1.4 "><p id="dli_02_0040__p159426187327">Name of the user who has permission on the current database. Example value: <strong id="dli_02_0040__b32866533615">test</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0040__row11445752142715"><td class="cellrowborder" valign="top" width="15.57%" headers="mcps1.3.4.3.2.5.1.1 "><p id="dli_02_0040__p1494331883214">privileges</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.24%" headers="mcps1.3.4.3.2.5.1.2 "><p id="dli_02_0040__p1794341873218">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.780000000000001%" headers="mcps1.3.4.3.2.5.1.3 "><p id="dli_02_0040__p18943141817327">Array of Strings</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.41%" headers="mcps1.3.4.3.2.5.1.4 "><p id="dli_02_0040__p1394381843217">Permission of the user on the database. Example value: [<strong id="dli_02_0040__b991412193812">ALTER_TABLE_ADD_PARTITION</strong>].</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="dli_02_0040__section15772143623410"><h4 class="sectiontitle">Example Request</h4><p id="dli_02_0040__p534664283414">None</p>
|
|
</div>
|
|
<div class="section" id="dli_02_0040__section58202197153616"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="dli_02_0040__screen57198432153654">{
|
|
"is_success": true,
|
|
"message": "",
|
|
"database_name": "dsstest",
|
|
"privileges": [
|
|
{
|
|
"is_admin": true,
|
|
"privileges": [
|
|
"ALL"
|
|
],
|
|
"user_name": "test"
|
|
},
|
|
{
|
|
"is_admin": false,
|
|
"privileges": [
|
|
"ALTER_TABLE_ADD_PARTITION"
|
|
],
|
|
"user_name": "scuser1"
|
|
},
|
|
{
|
|
"is_admin": false,
|
|
"privileges": [
|
|
"CREATE_TABLE"
|
|
],
|
|
"user_name": "scuser2"
|
|
}
|
|
]
|
|
}</pre>
|
|
<div class="note" id="dli_02_0040__note21113357171028"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dli_02_0040__p36999182171028">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 Codes</a>.</p>
|
|
</div></div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_02_0036.html">Permission-related APIs</a></div>
|
|
</div>
|
|
</div>
|
|
|