doc-exports/docs/iam/api-ref/en-us_topic_0057845623.html
Wei, Hongmin c7cf8ac24f IAM API 0711 Version
Reviewed-by: Belejkanic, Lukas <lukas.belejkanic@t-systems.com>
Co-authored-by: Wei, Hongmin <weihongmin1@huawei.com>
Co-committed-by: Wei, Hongmin <weihongmin1@huawei.com>
2024-07-11 11:57:45 +00:00

129 lines
12 KiB
HTML

<a name="en-us_topic_0057845623"></a><a name="en-us_topic_0057845623"></a>
<h1 class="topictitle1">Granting Permissions to a User Group of a Domain</h1>
<div id="body1492670576110"><div class="section" id="en-us_topic_0057845623__section495175389414"><h4 class="sectiontitle">Function</h4><p id="en-us_topic_0057845623__p632748191">This API is used to grant permissions to a user group of a domain. A role is a set of permissions and represents a group of actions.</p>
</div>
<div class="section" id="en-us_topic_0057845623__section3019338085013"><h4 class="sectiontitle">URI</h4><ul id="en-us_topic_0057845623__en-us_topic_0032920307_ul52733512"><li id="en-us_topic_0057845623__en-us_topic_0032920307_li4839561">URI format<p id="en-us_topic_0057845623__en-us_topic_0032920307_p43556055"><a name="en-us_topic_0057845623__en-us_topic_0032920307_li4839561"></a><a name="en-us_topic_0032920307_li4839561"></a>PUT /v3/domains/{domain_id}/groups/{group_id}/roles/{role_id}</p>
</li><li id="en-us_topic_0057845623__li1205595994225">URI parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845623__en-us_topic_0032920307_table36168141" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845623__en-us_topic_0032920307_row15662289"><th align="left" class="cellrowborder" valign="top" width="19.36%" id="mcps1.3.2.2.2.1.1.5.1.1"><p id="en-us_topic_0057845623__en-us_topic_0032920307_p60685926"><strong id="en-us_topic_0057845623__b842352706112519">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.24%" id="mcps1.3.2.2.2.1.1.5.1.2"><p id="en-us_topic_0057845623__en-us_topic_0032920307_p16612996"><strong id="en-us_topic_0057845623__b842352706112524">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.45%" id="mcps1.3.2.2.2.1.1.5.1.3"><p id="en-us_topic_0057845623__en-us_topic_0032920307_p3475410"><strong id="en-us_topic_0057845623__b842352706143526_1">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="43.95%" id="mcps1.3.2.2.2.1.1.5.1.4"><p id="en-us_topic_0057845623__en-us_topic_0032920307_p13072760"><strong id="en-us_topic_0057845623__b20601766145329_1">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845623__en-us_topic_0032920307_row52260639"><td class="cellrowborder" valign="top" width="19.36%" headers="mcps1.3.2.2.2.1.1.5.1.1 "><p id="en-us_topic_0057845623__en-us_topic_0032920307_p5253358">domain_id</p>
</td>
<td class="cellrowborder" valign="top" width="19.24%" headers="mcps1.3.2.2.2.1.1.5.1.2 "><p id="en-us_topic_0057845623__en-us_topic_0032920307_p22868878">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.45%" headers="mcps1.3.2.2.2.1.1.5.1.3 "><p id="en-us_topic_0057845623__en-us_topic_0032920307_p40439847">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.95%" headers="mcps1.3.2.2.2.1.1.5.1.4 "><p id="en-us_topic_0057845623__en-us_topic_0032920307_p54402144">ID of the domain which a user group belongs to. For details about how to obtain the domain ID, see <a href="en-us_topic_0057845624.html">Obtaining User, Account, User Group, Project, and Agency Information</a>.</p>
</td>
</tr>
<tr id="en-us_topic_0057845623__en-us_topic_0032920307_row19857248"><td class="cellrowborder" valign="top" width="19.36%" headers="mcps1.3.2.2.2.1.1.5.1.1 "><p id="en-us_topic_0057845623__en-us_topic_0032920307_p64933228">group_id</p>
</td>
<td class="cellrowborder" valign="top" width="19.24%" headers="mcps1.3.2.2.2.1.1.5.1.2 "><p id="en-us_topic_0057845623__en-us_topic_0032920307_p25100141">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.45%" headers="mcps1.3.2.2.2.1.1.5.1.3 "><p id="en-us_topic_0057845623__en-us_topic_0032920307_p19845579">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.95%" headers="mcps1.3.2.2.2.1.1.5.1.4 "><p id="en-us_topic_0057845623__en-us_topic_0032920307_p63988077">ID of a user group. For details about how to obtain the group ID, see <a href="en-us_topic_0057845624.html">Obtaining User, Account, User Group, Project, and Agency Information</a>.</p>
</td>
</tr>
<tr id="en-us_topic_0057845623__row27198525143830"><td class="cellrowborder" valign="top" width="19.36%" headers="mcps1.3.2.2.2.1.1.5.1.1 "><p id="en-us_topic_0057845623__p43460141143830">role_id</p>
</td>
<td class="cellrowborder" valign="top" width="19.24%" headers="mcps1.3.2.2.2.1.1.5.1.2 "><p id="en-us_topic_0057845623__p30610518143830">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.45%" headers="mcps1.3.2.2.2.1.1.5.1.3 "><p id="en-us_topic_0057845623__p63532892143830">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.95%" headers="mcps1.3.2.2.2.1.1.5.1.4 "><p id="en-us_topic_0057845623__p45890598143830">ID of a role. For details about how to obtain the role ID, see <a href="en-us_topic_0057845591.html">Querying a Role List</a>.</p>
<div class="note" id="en-us_topic_0057845623__note12226133219443"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="en-us_topic_0057845623__p52273320448">To assign a custom policy that contains OBS operations to a user group, create two custom policies with the scope being set to global services and region-specific projects respectively and other parameters being the same, and then attach the two policies to the user group.</p>
</div></div>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="en-us_topic_0057845623__section1437107585444"><h4 class="sectiontitle">Request Parameters</h4><ul id="en-us_topic_0057845623__ul3118448103456"><li id="en-us_topic_0057845623__li46500394103456">Parameters in the request header
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845623__en-us_topic_0032920307_table21736211" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845623__en-us_topic_0032920307_row48433347"><th align="left" class="cellrowborder" valign="top" width="19.49%" id="mcps1.3.3.2.1.1.1.5.1.1"><p id="en-us_topic_0057845623__en-us_topic_0032920307_p30787047"><strong id="en-us_topic_0057845623__a173ae121cc9e48328ca613e72f2a1504">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.86%" id="mcps1.3.3.2.1.1.1.5.1.2"><p id="en-us_topic_0057845623__en-us_topic_0032920307_p10722842"><strong id="en-us_topic_0057845623__b149659250">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.57%" id="mcps1.3.3.2.1.1.1.5.1.3"><p id="en-us_topic_0057845623__en-us_topic_0032920307_p63243911"><strong id="en-us_topic_0057845623__b842352706143526_3">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.080000000000005%" id="mcps1.3.3.2.1.1.1.5.1.4"><p id="en-us_topic_0057845623__en-us_topic_0032920307_p22483156"><strong id="en-us_topic_0057845623__b20601766145329_3">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845623__en-us_topic_0032920307_row39604502"><td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845623__en-us_topic_0032920307_p53848109">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="18.86%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845623__en-us_topic_0032920307_p66729601">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845623__en-us_topic_0032920307_p36388601">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.080000000000005%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845623__p44593961111714">Authenticated token with the <strong id="en-us_topic_0057845623__b750798910387">Security Administrator</strong> permission.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="en-us_topic_0057845623__ul21012513152920"><li id="en-us_topic_0057845623__li17929631152920">Example request<pre class="screen" id="en-us_topic_0057845623__screen50994625152920"><em id="en-us_topic_0057845623__i31505703152920">curl -i -k -H "X-Auth-Token:$token" -H 'Content-Type:application/json;charset=utf8' -X PUT https://sample.domain.com/v3/domains/d54061ebcb5145dd814f8eb3fe9b7ac0/groups/47d79cabc2cf4c35b13493d919a5bb3d/roles/e62d9ba0d6a544cd878d9e8a4663f6e2</em></pre>
</li></ul>
</div>
<div class="section" id="en-us_topic_0057845623__section13954122151119"><h4 class="sectiontitle">Response Parameters</h4><p id="en-us_topic_0057845623__p189551922151113">None</p>
</div>
<div class="section" id="en-us_topic_0057845623__section5556784894735"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845623__en-us_topic_0032920307_table25927028" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845623__en-us_topic_0032920307_row10578662"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.2.1.3.1.1"><p id="en-us_topic_0057845623__en-us_topic_0032920307_p51565323"><strong id="en-us_topic_0057845623__b65710991174142">Status Code</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.2.1.3.1.2"><p id="en-us_topic_0057845623__en-us_topic_0032920307_p16041657"><strong id="en-us_topic_0057845623__b20601766145329_5">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845623__en-us_topic_0032920307_row24305815"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845623__en-us_topic_0032920307_p22613965">204</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845623__en-us_topic_0032920307_p19791876">The request is successful.</p>
</td>
</tr>
<tr id="en-us_topic_0057845623__en-us_topic_0032920307_row43909159"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845623__en-us_topic_0032920307_p66980994">400</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845623__en-us_topic_0032920307_p56751409">The server failed to process the request.</p>
</td>
</tr>
<tr id="en-us_topic_0057845623__row460808479497"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845623__p120744399497">401</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845623__p385055099497">Authentication failed.</p>
</td>
</tr>
<tr id="en-us_topic_0057845623__en-us_topic_0032920307_row41000636"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845623__en-us_topic_0032920307_p32717189">403</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845623__en-us_topic_0032920307_p32846614">Access denied.</p>
</td>
</tr>
<tr id="en-us_topic_0057845623__row5922032814523"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845623__p6322091114523">404</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845623__p2062019914523">The requested resource cannot be found.</p>
</td>
</tr>
<tr id="en-us_topic_0057845623__row3220343814529"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845623__p2139548914529">409</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845623__p61687207145237">A resource conflict occurs.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0057845579.html">Permission Management</a></div>
</div>
</div>