doc-exports/docs/iam/api-ref/en-us_topic_0079467624.html
zhangyue 3b5a58b1fe IAM API 2.0.38
Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: zhangyue <zhangyue164@huawei.com>
Co-committed-by: zhangyue <zhangyue164@huawei.com>
2022-10-26 04:31:24 +00:00

141 lines
13 KiB
HTML

<a name="en-us_topic_0079467624"></a><a name="en-us_topic_0079467624"></a>
<h1 class="topictitle1">Granting Permissions to an Agency on a Domain</h1>
<div id="body1507708722993"><div class="section" id="en-us_topic_0079467624__sd32cbb7d5afd415d8a47d1f36476f58e"><h4 class="sectiontitle">Function</h4><p id="en-us_topic_0079467624__p14496071417">This API is used to grant permissions to an agency on a domain.</p>
</div>
<div class="section" id="en-us_topic_0079467624__s8bfb266fc6fd4b4fbcdb7c5b37fec0c3"><h4 class="sectiontitle">URI</h4><ul id="en-us_topic_0079467624__u3c6d72635d3d4f0eba1c1f37af7bb138"><li id="en-us_topic_0079467624__l38310aa7196a490f817e2dc9feea1a35">URI format<p id="en-us_topic_0079467624__afdd76c97ee124e938878c24f54de6623"><a name="en-us_topic_0079467624__l38310aa7196a490f817e2dc9feea1a35"></a><a name="l38310aa7196a490f817e2dc9feea1a35"></a>PUT /v3.0/OS-AGENCY/domains/{domain_id}/agencies/{agency_id}/roles/{role_id}</p>
</li></ul>
<ul id="en-us_topic_0079467624__u40eefae65744424689f5c81886918671"><li id="en-us_topic_0079467624__lb205bb0fee53403db652442ca93048db">URI parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0079467624__t7d98a5ad17d24daa8e58656f6da291de" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0079467624__r5e7d0413da724067991bb18271aa331f"><th align="left" class="cellrowborder" valign="top" width="18.360000000000003%" id="mcps1.3.2.3.1.1.1.5.1.1"><p id="en-us_topic_0079467624__a3a948e8952044840bfe547d49baa12c7"><strong id="en-us_topic_0079467624__a173ae121cc9e48328ca613e72f2a1504">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.48%" id="mcps1.3.2.3.1.1.1.5.1.2"><p id="en-us_topic_0079467624__a2b1a382248774519929c9fe14900ceed"><strong id="en-us_topic_0079467624__b8423527061933_1">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.86%" id="mcps1.3.2.3.1.1.1.5.1.3"><p id="en-us_topic_0079467624__af253bd8fb6384746a335ac225b05565b"><strong id="en-us_topic_0079467624__b842352706143526_1">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.3%" id="mcps1.3.2.3.1.1.1.5.1.4"><p id="en-us_topic_0079467624__af46f0afead2b4f6aac8fa304ec0bc334"><strong id="en-us_topic_0079467624__b20601766145329_1">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0079467624__r8313928b14dc4dcd84b6a9f507104888"><td class="cellrowborder" valign="top" width="18.360000000000003%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="en-us_topic_0079467624__ac8d7ad96322f4179af858eb5c419e8d1">domain_id</p>
</td>
<td class="cellrowborder" valign="top" width="18.48%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="en-us_topic_0079467624__ab6a68ef3a12c48e2ad342c2f352de1f8">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.86%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="en-us_topic_0079467624__a3f7ce8cf115c4393b7931d8fde530e4c">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.3%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="en-us_topic_0079467624__a6aa971030c4748a698bb3b4898cd1305">ID of the current domain.</p>
</td>
</tr>
<tr id="en-us_topic_0079467624__r347ae7b1f64e41c98cee1ab0d52732cd"><td class="cellrowborder" valign="top" width="18.360000000000003%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="en-us_topic_0079467624__a7ea4dd5a3c8448e7b705f201030eec17">agency_id</p>
</td>
<td class="cellrowborder" valign="top" width="18.48%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="en-us_topic_0079467624__afff03be279884bdca910434905df5e21">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.86%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="en-us_topic_0079467624__a237c5e94daba453680ae069a9fba48df">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.3%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="en-us_topic_0079467624__a41754287d487497484900718c4a1be30">ID of an agency.</p>
</td>
</tr>
<tr id="en-us_topic_0079467624__r89bba46793dd4b9d9bc5744ca825d840"><td class="cellrowborder" valign="top" width="18.360000000000003%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="en-us_topic_0079467624__a8e16f5a068404d1f970f5c179131e358">role_id</p>
</td>
<td class="cellrowborder" valign="top" width="18.48%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="en-us_topic_0079467624__af05e7037b0c94ea38da2c3f75fddb326">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.86%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="en-us_topic_0079467624__a8fce5747cb1a4317887544fd61d2c988">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.3%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="en-us_topic_0079467624__a89bb782f1e3e489fbb9d2142ceefdccf">ID of a role.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note" id="en-us_topic_0079467624__n8489908d5bd0444da77f6c1d8fa6f23b"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="en-us_topic_0079467624__a2d41cde6e802480d98113f65db7ade3d">The role name corresponding to <strong id="en-us_topic_0079467624__b842352706182130">role_id</strong> in a request body is controlled by a blacklist. The role name cannot be <strong id="en-us_topic_0079467624__b294896296105844">secu_admin</strong> or <strong id="en-us_topic_0079467624__b1603085149105844">te_agency</strong>.</p>
</div></div>
</li></ul>
</div>
<div class="section" id="en-us_topic_0079467624__sbe09a08b2e5841ff9f6808a1e714405c"><h4 class="sectiontitle">Request Parameters</h4><ul id="en-us_topic_0079467624__u76128a04a27c48908b5c7a79923a5d24"><li id="en-us_topic_0079467624__l80545ada7e8943b3a5a041802bdce280">Parameters in the request header
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0079467624__t2a3bcde88e2d42b9be2030e06757f78c" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0079467624__re9a6010114a74310bb1c8ec8266d6e97"><th align="left" class="cellrowborder" valign="top" width="18.83%" id="mcps1.3.3.2.1.1.1.5.1.1"><p id="en-us_topic_0079467624__a77a080ef749f42afa95c01469e004592"><strong id="en-us_topic_0079467624__b18126430144358">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.919999999999998%" id="mcps1.3.3.2.1.1.1.5.1.2"><p id="en-us_topic_0079467624__a0caf369b338f4245b688e1aed95bca35"><strong id="en-us_topic_0079467624__b8423527061933_3">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.67%" id="mcps1.3.3.2.1.1.1.5.1.3"><p id="en-us_topic_0079467624__a685b8f9209e240c2a7efd856ec96033d"><strong id="en-us_topic_0079467624__b842352706143526_3">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.58%" id="mcps1.3.3.2.1.1.1.5.1.4"><p id="en-us_topic_0079467624__a5d506e9a88e24b1a9a0535e44ae17d8d"><strong id="en-us_topic_0079467624__b20601766145329_3">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0079467624__r972bd6f6b6ee4d63934e1a1d42750953"><td class="cellrowborder" valign="top" width="18.83%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="en-us_topic_0079467624__afd051d13fc314e4ea3c17bfab535e24d">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="17.919999999999998%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="en-us_topic_0079467624__a098126e39ffc4f5d9d02b96212f20ce1">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.67%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="en-us_topic_0079467624__adff70bd574324ce7b97f9dfe8281ed25">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.58%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="en-us_topic_0079467624__a221113d87e0d47dfa177321872a0e3b0">Fill <strong id="en-us_topic_0079467624__b842352706161331">application/json;charset=utf8</strong> in this field.</p>
</td>
</tr>
<tr id="en-us_topic_0079467624__r0e73be626aee42c8a1a7c3e3fbfad3ed"><td class="cellrowborder" valign="top" width="18.83%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="en-us_topic_0079467624__a79b10806bfd5435e9d72ebb166c35d75">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="17.919999999999998%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="en-us_topic_0079467624__a587216c2ae9845568e71784bd0a3404a">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.67%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="en-us_topic_0079467624__a07df5795216b4ffd814764eef3c9890c">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.58%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="en-us_topic_0079467624__a9db1120685df461f8c36a450120e7575">Authenticated token with the <strong id="en-us_topic_0079467624__b750798910387">Security Administrator</strong> permission.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="en-us_topic_0079467624__u159bb30b38d9473189cf146ce1446eb0"><li id="en-us_topic_0079467624__l970fba04f15247a0916eaa6bbbaa0215">Example request<pre class="screen" id="en-us_topic_0079467624__s4b408cc7803447efafabd0c3e9c99769"><em id="en-us_topic_0079467624__i14753964112611">curl -i -k -H "X-Auth-Token:$token" -H 'Content-Type:application/json;charset=utf8' -X PUT https://</em><em id="en-us_topic_0079467624__i54135624112611">sample.domain.com</em><em id="en-us_topic_0079467624__i65676812112611">/v3<em id="en-us_topic_0079467624__en-us_topic_0059029105_i112805719552">.0/OS-AGENCY</em>/domains/b32d99a7778d4fd9aa5bc616c3dc4e5f/agencies/37f90258b820472bbc8a0f4f0bfd720d/roles/0f3a2d418ed747fa8be46e92757be9ff</em></pre>
</li></ul>
</div>
<div class="section" id="en-us_topic_0079467624__s755c4357c5ca4edba2badcd8d4f40c6e"><h4 class="sectiontitle">Response Parameters</h4><ul id="en-us_topic_0079467624__ud472617eb5d84d06b5db7931227eea30"><li id="en-us_topic_0079467624__li14876013115713">No response: indicates that the response is successful.</li><li id="en-us_topic_0079467624__l013a3611efa84a10ab64c16502fd05d6">Example response (request failed)<pre class="screen" id="en-us_topic_0079467624__scb109a0c141f4d448d353c3400f70aa7">{
"error" : {
"message" : "Could not find role: 0f3a2d418ed747fa8be46e92757be9ddff",
"code" : 404,
"title" : "Not Found"
}
}</pre>
</li></ul>
</div>
<div class="section" id="en-us_topic_0079467624__s61c00aab956c432ba03074959ed97c58"><h4 class="sectiontitle"><strong id="en-us_topic_0079467624__b842352706183230">Status Codes</strong></h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0079467624__td9cdd0aa9a2048778249267ea06f9361" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0079467624__r3567e198c0744e369984c1f162ec41de"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.2.1.3.1.1"><p id="en-us_topic_0079467624__a30f580137070413ab9f3c2e85a2d3747"><strong id="en-us_topic_0079467624__b6210614144358">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_0079467624__aa7e5f4ef91364bf18b5661a24a54f365"><strong id="en-us_topic_0079467624__b20601766145329_5">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0079467624__rf109a271314f4533becfe89639b11125"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0079467624__ae814884cbfa34eb886df4cccf6afab3b">204</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0079467624__a645dfe888dec4eb2a4f0f99a73f774be">The request is successful.</p>
</td>
</tr>
<tr id="en-us_topic_0079467624__r80e2f92d56104c9d921b35a0d7732cca"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0079467624__a0d1fa62314bf4f6bbd1e8178b7729781">401</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0079467624__a2a01fc84be644bbb9809f31ff2b584da">Authentication failed.</p>
</td>
</tr>
<tr id="en-us_topic_0079467624__r59d0b76d477f40039857ceac885bb2b2"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0079467624__ab5b46fe2535c4d969b3033a979ef32b2">403</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0079467624__a39f539005cab4265aea430356e5c82c3">Access denied.</p>
</td>
</tr>
<tr id="en-us_topic_0079467624__r37396180afcc486c9db290bb55d645f8"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0079467624__ae59d58ae92af44eaa9dc1656d13d292d">404</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0079467624__aad60d8a5e4754e139481963b3c283568">The requested resource cannot be found.</p>
</td>
</tr>
<tr id="en-us_topic_0079467624__r7f56ad93b7e34d7e8e6da5a37f433d4b"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0079467624__a7b2f3b7c3e694ef6a598609a1962e87c">500</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0079467624__a6168166f84cf4f4392a4fb6ae92d152c">Internal server error.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0079467612.html">Agency Management</a></div>
</div>
</div>