forked from docs/doc-exports
Reviewed-by: gtema <artem.goncharov@gmail.com> Co-authored-by: zhangyue <zhangyue164@huawei.com> Co-committed-by: zhangyue <zhangyue164@huawei.com>
142 lines
13 KiB
HTML
142 lines
13 KiB
HTML
<a name="en-us_topic_0079467620"></a><a name="en-us_topic_0079467620"></a>
|
|
|
|
<h1 class="topictitle1">Granting Permissions to an Agency for a Project</h1>
|
|
<div id="body1507708722930"><div class="section" id="en-us_topic_0079467620__s2797c145faa84a30b7c688cb7f61f5c3"><h4 class="sectiontitle">Function</h4><p id="en-us_topic_0079467620__p317051781320">This API is used to grant permissions to an agency for a project.</p>
|
|
</div>
|
|
<div class="section" id="en-us_topic_0079467620__s33eb51d4240d45959c5b1509bf93c747"><h4 class="sectiontitle">URI</h4><ul id="en-us_topic_0079467620__u2a454180d4ff4552aa9cdc38a35d063a"><li id="en-us_topic_0079467620__l0c87e6f344a543439e8d83a729745cc7">URI format<p id="en-us_topic_0079467620__a1b8a14f202154ff8bbc240b33f0ff5c4"><a name="en-us_topic_0079467620__l0c87e6f344a543439e8d83a729745cc7"></a><a name="l0c87e6f344a543439e8d83a729745cc7"></a>PUT /v3.0/OS-AGENCY/projects/{project_id}/agencies/{agency_id}/roles/{role_id}</p>
|
|
</li></ul>
|
|
<ul id="en-us_topic_0079467620__u5943c9c6154b462dbeeefe5523650b90"><li id="en-us_topic_0079467620__l2529675fffe8400f82e6c9011d3cb393">URI parameters
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0079467620__t2eed66c3cdf04e7eafc8940b4e47a42d" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0079467620__r3303e8efeb8c42588e93c4ec47e7dd31"><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_0079467620__af0d01a64b0264402b85cf188013060d9"><strong id="en-us_topic_0079467620__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_0079467620__a51bb4888c6574784877430bda7164e12"><strong id="en-us_topic_0079467620__b842352706161940_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_0079467620__ad5ff1e377ac740e78b98e5e25e1bb323"><strong id="en-us_topic_0079467620__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_0079467620__a9446ba7048504152bc6f8961a7b9cbc8"><strong id="en-us_topic_0079467620__b20601766145329_1">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="en-us_topic_0079467620__rd4510339dfb84de2b564d282aa07519a"><td class="cellrowborder" valign="top" width="18.360000000000003%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="en-us_topic_0079467620__ad754c479a7924ca6b77190ef5029ce63">project_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_0079467620__aa466f08b8cb54b04aa3f5358716df255">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_0079467620__a9ab05e62f509498b987dccd76d1bd1c8">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_0079467620__a5bc7b47e2ee040219626bbc5f22983cb">ID of a project under the current domain.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="en-us_topic_0079467620__rc27b213d6d194784a87ec2d4fc386013"><td class="cellrowborder" valign="top" width="18.360000000000003%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="en-us_topic_0079467620__a0f5d61a82c3045a8acec6c1b898c8637">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_0079467620__a336128957f3a44ce9ae88461fbf8131c">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_0079467620__aa3934a8762264b039e99d785b1039d36">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_0079467620__a43e09d5d6d8247e3bff922f088a1bde2">ID of an agency.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="en-us_topic_0079467620__rfca21f3538d94b1cbb658a3691b2aa0d"><td class="cellrowborder" valign="top" width="18.360000000000003%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="en-us_topic_0079467620__a0a35a40f930048a59e8c156d11d327a3">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_0079467620__a6dbaa703f5ab4b1b99820238781f2141">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_0079467620__a93375c8c7d8d4449ba041840782131df">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_0079467620__a0fcca67673fa47f297bb04aefc41c295">ID of a role.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="note" id="en-us_topic_0079467620__n12cdac2b4938478aa763fc91ba79b9be"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="en-us_topic_0079467620__ac1f0adf4be6e4b8cb8c4fcee8db8f046">The role name corresponding to <strong id="en-us_topic_0079467620__b842352706182130">role_id</strong> in a request body is controlled by a blacklist. The role name cannot be <strong id="en-us_topic_0079467620__b294896296105844">secu_admin</strong> or <strong id="en-us_topic_0079467620__b1603085149105844">te_agency</strong>.</p>
|
|
</div></div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="en-us_topic_0079467620__sfdcf4579d43c4d36ae6a8a98cc64cb2a"><h4 class="sectiontitle">Request Parameters</h4><ul id="en-us_topic_0079467620__u4d7b6ee2b44542018b85db524220f11b"><li id="en-us_topic_0079467620__l58a7bf69e75a4ff7acf267604de03ced">Parameters in the request header
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0079467620__ta266f5738ff14cb6868a9231a8be51c9" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0079467620__rc1641e1a53cf401c9c4bc9d09800cbf2"><th align="left" class="cellrowborder" valign="top" width="19.36%" id="mcps1.3.3.2.1.1.1.5.1.1"><p id="en-us_topic_0079467620__af11531211535426bb301bc9057e7bb11"><strong id="en-us_topic_0079467620__b10602794144020">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="16.73%" id="mcps1.3.3.2.1.1.1.5.1.2"><p id="en-us_topic_0079467620__a543e04fb4d184684bf9989f3677e0967"><strong id="en-us_topic_0079467620__b842352706161940_3">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="19.6%" id="mcps1.3.3.2.1.1.1.5.1.3"><p id="en-us_topic_0079467620__a2d08b1ad2b294a68b8b4c160c40d839b"><strong id="en-us_topic_0079467620__b842352706143526_3">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="44.31%" id="mcps1.3.3.2.1.1.1.5.1.4"><p id="en-us_topic_0079467620__ad364918facff4854b55d0ae5ef795925"><strong id="en-us_topic_0079467620__b20601766145329_3">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="en-us_topic_0079467620__re4a659ac4e714cde8104f2cb5268a012"><td class="cellrowborder" valign="top" width="19.36%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="en-us_topic_0079467620__a40f465ebf10f4541938410adf13de6bc">Content-Type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="en-us_topic_0079467620__a61755322e2684ad98c7997ccc6f3f9e1">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.6%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="en-us_topic_0079467620__a2426320f8bb54f0b8907accae3493275">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="44.31%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="en-us_topic_0079467620__a1f7b007c29334466b830f2836af4fe3f">Fill <strong id="en-us_topic_0079467620__b842352706161331">application/json;charset=utf8</strong> in this field.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="en-us_topic_0079467620__rf51395632af147a2a93a7a4b44d42823"><td class="cellrowborder" valign="top" width="19.36%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="en-us_topic_0079467620__a152e454a198b465e8fc3da237ae6acf5">X-Auth-Token</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="en-us_topic_0079467620__a99b29c8fef87474cb8fb9f2dc928c5bc">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.6%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="en-us_topic_0079467620__a0e0e7ec28c2e4e6f92346246996f47ea">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="44.31%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="en-us_topic_0079467620__p56210016113658">Authenticated token with the <strong id="en-us_topic_0079467620__b750798910387">Security Administrator</strong> permission.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
<ul id="en-us_topic_0079467620__u6a22576db5534f7c8c06ae9872aa5f4b"><li id="en-us_topic_0079467620__l74a1970c5de741a9b288ad90c2d73e6b">Example request<pre class="screen" id="en-us_topic_0079467620__s1bd3560d702840bda0c8eea724472a5a"><em id="en-us_topic_0079467620__i18580399112659">curl -i -k -H "X-Auth-Token:$token" -H 'Content-Type:application/json;charset=utf8' -X PUT https://</em><em id="en-us_topic_0079467620__i40325096112659">sample.domain.com</em><em id="en-us_topic_0079467620__i33005870112659">/v3<em id="en-us_topic_0079467620__a47c0634c87ee498abb686f7a63363d71">.0/OS-AGENCY</em>/projects/0945241c5ebc4660bac540d48f2a2c14/agencies/37f90258b820472bbc8a0f4f0bfd720d/roles/0f3a2d418ed747fa8be46e92757be9ff</em></pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="en-us_topic_0079467620__s55abe3ea283b41bf8851146d228a8d2a"><h4 class="sectiontitle">Response Parameters</h4><ul id="en-us_topic_0079467620__ul16556164565712"><li id="en-us_topic_0079467620__li14876013115713">No response: indicates that the response is successful.</li></ul>
|
|
<ul id="en-us_topic_0079467620__uacff3a8057734bbc941ce107122f3418"><li id="en-us_topic_0079467620__l0325eb0e7ef14207b5ed58cf48bc8609">Example response (request failed)<pre class="screen" id="en-us_topic_0079467620__scbae5a770141482294607acc6fa9e3c8">{
|
|
"error" : {
|
|
"message" : "Could not find role: 0f3a2d418ed747fa8be46e92757be9ddff",
|
|
"code" : 404,
|
|
"title" : "Not Found"
|
|
}
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="en-us_topic_0079467620__sd2bed1967bd143fa9958ce8637393c3d"><h4 class="sectiontitle"><strong id="en-us_topic_0079467620__b842352706183230">Status Codes</strong></h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0079467620__td457a25ce4ce42cc8623de8314cdd29a" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0079467620__r579973beeff54b9eaef8ea5afd2572bc"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.2.1.3.1.1"><p id="en-us_topic_0079467620__a631978ce233c4e6cb1466c167c4c5fb6"><strong id="en-us_topic_0079467620__b56183929144020">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_0079467620__a3389effc57924ada945200b39e2d0cb9"><strong id="en-us_topic_0079467620__b20601766145329_5">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="en-us_topic_0079467620__r017a3c4a4d97482a80643dec0665ad8e"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0079467620__a26319fb22245422e87a355d449086f25">204</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0079467620__a11689316d0be466e89d8d613a91029f3">The request is successful.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="en-us_topic_0079467620__r41552fcee9ee49f6808e589b2e5e879d"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0079467620__abb25ab36d1d946f3a63e5e03e14bd574">401</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0079467620__a14defd1b9f8e4238b8eea6105ff0fb75">Authentication failed.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="en-us_topic_0079467620__raec138a11d8944989ec3365f4d90a0bf"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0079467620__a3815ddaa49484df4a7152116385079b5">403</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0079467620__a68e35c52defe44b590f69b74ab7be527">Access denied.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="en-us_topic_0079467620__rb0808d3dee1f4362843e5f56adc95331"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0079467620__a038534e207d54a6ea9119e857cbe8fed">404</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0079467620__aa212176a1d0f410aace33ee4ce7ba676">The requested resource cannot be found.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="en-us_topic_0079467620__r2aa8fe61fb0249fc8ceff1ed8d9d8696"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0079467620__adce97889cfdc404698cc9e26948fa1c7">500</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0079467620__a50ff0331786f48e0aa854125a1fdfc4b">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>
|
|
|