forked from docs/doc-exports
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com> Co-authored-by: qiujiandong1 <qiujiandong1@huawei.com> Co-committed-by: qiujiandong1 <qiujiandong1@huawei.com>
198 lines
17 KiB
HTML
198 lines
17 KiB
HTML
<a name="swr_02_0046"></a><a name="swr_02_0046"></a>
|
|
|
|
<h1 class="topictitle1">Granting Image Permissions</h1>
|
|
<div id="body8662426"><div class="section" id="swr_02_0046__en-us_topic_0000001231313913_section0587103113331"><h4 class="sectiontitle">Description</h4><p id="swr_02_0046__en-us_topic_0000001231313913_a7005bd3228d34f8ea0fb7b75b17cfbb2">Grant permissions of an image to certain users so that they can manage, edit, and read the image.</p>
|
|
</div>
|
|
<div class="section" id="swr_02_0046__en-us_topic_0000001231313913_section10587631163318"><h4 class="sectiontitle">Constraints</h4><p id="swr_02_0046__en-us_topic_0000001231313913_p25874312337">You can grant permissions to other users (excluding yourself) only when the organization permission is <strong id="swr_02_0046__en-us_topic_0000001231313913_b16839203635315">Edit</strong> or higher or the image repository permission is <strong id="swr_02_0046__en-us_topic_0000001231313913_b08401636165320">Manage</strong>.</p>
|
|
</div>
|
|
<div class="section" id="swr_02_0046__en-us_topic_0000001231313913_section1958863114333"><h4 class="sectiontitle">URI</h4><p id="swr_02_0046__en-us_topic_0000001231313913_p15588173118331">POST /v2/manage/namespaces/{namespace}/repos/{repository}/access</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="swr_02_0046__en-us_topic_0000001231313913_table16590631173311" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path parameters</caption><thead align="left"><tr id="swr_02_0046__en-us_topic_0000001231313913_row75891631123316"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="swr_02_0046__en-us_topic_0000001231313913_p18590031193314">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p id="swr_02_0046__en-us_topic_0000001231313913_p135901131123320">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p id="swr_02_0046__en-us_topic_0000001231313913_p15591113133315">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p id="swr_02_0046__en-us_topic_0000001231313913_p1359113183313">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="swr_02_0046__en-us_topic_0000001231313913_row17589193117339"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="swr_02_0046__en-us_topic_0000001231313913_p125911331113311">namespace</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="swr_02_0046__en-us_topic_0000001231313913_p459110317338">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="swr_02_0046__en-us_topic_0000001231313913_p11591163110332">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="swr_02_0046__en-us_topic_0000001231313913_p3591153117335">Organization name. Enter 1 to 64 characters, starting with a lowercase letter and ending with a lowercase letter or digit. Only lowercase letters, digits, periods (.), underscores (_), and hyphens (-) are allowed. Periods, underscores, and hyphens cannot be placed next to each other. A maximum of two consecutive underscores are allowed.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="swr_02_0046__en-us_topic_0000001231313913_row10589163115337"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="swr_02_0046__en-us_topic_0000001231313913_p8592183163319">repository</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="swr_02_0046__en-us_topic_0000001231313913_p145921731203312">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="swr_02_0046__en-us_topic_0000001231313913_p1659215318332">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="swr_02_0046__en-us_topic_0000001231313913_p1833713588245">Image repository name. Enter 1 to 128 characters. It must start and end with a lowercase letter or digit. Only lowercase letters, digits, periods (.), slashes (/), underscores (_), and hyphens (-) are allowed. Periods, slashes, underscores, and hyphens cannot be placed next to each other. A maximum of two consecutive underscores are allowed. Replace a slash (/) with a dollar sign ($) before you send the request.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="swr_02_0046__en-us_topic_0000001231313913_section14592103143311"><h4 class="sectiontitle">Request Parameters</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="swr_02_0046__en-us_topic_0000001231313913_HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="swr_02_0046__en-us_topic_0000001231313913_row25931831123319"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.1"><p id="swr_02_0046__en-us_topic_0000001231313913_p259473113332">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.2"><p id="swr_02_0046__en-us_topic_0000001231313913_p17594103173315">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.3"><p id="swr_02_0046__en-us_topic_0000001231313913_p185944319332">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.4.2.2.5.1.4"><p id="swr_02_0046__en-us_topic_0000001231313913_p0594133119338">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="swr_02_0046__en-us_topic_0000001231313913_row559393163311"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p id="swr_02_0046__en-us_topic_0000001231313913_p7594193115335">Content-Type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p id="swr_02_0046__en-us_topic_0000001231313913_p1859473113338">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p id="swr_02_0046__en-us_topic_0000001231313913_p2595183112334">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p id="swr_02_0046__en-us_topic_0000001231313913_p359523118335">Message body type (format). The value can be <strong id="swr_02_0046__en-us_topic_0000001231313913_b64146511105">application/json</strong> or <strong id="swr_02_0046__en-us_topic_0000001231313913_b74157511601">charset=utf-8 application/json</strong>.</p>
|
|
<p id="swr_02_0046__en-us_topic_0000001231313913_p3595113110339">Default value: <strong id="swr_02_0046__en-us_topic_0000001231313913_b11671155314015">application/json</strong></p>
|
|
</td>
|
|
</tr>
|
|
<tr id="swr_02_0046__en-us_topic_0000001231313913_row7593531193312"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p id="swr_02_0046__en-us_topic_0000001231313913_p175951531143317">X-Auth-Token</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p id="swr_02_0046__en-us_topic_0000001231313913_p559563173314">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p id="swr_02_0046__en-us_topic_0000001231313913_p1595153117332">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p id="swr_02_0046__en-us_topic_0000001231313913_p459615312336">User token.</p>
|
|
<p id="swr_02_0046__en-us_topic_0000001231313913_p1659683123315">The token can be obtained by calling the IAM API used to obtain a user token. The value of <strong id="swr_02_0046__en-us_topic_0000001231313913_b3215072811199">X-Subject-Token</strong> in the response header is the user token.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="swr_02_0046__en-us_topic_0000001231313913_request_RequestParameter" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request body parameter</caption><thead align="left"><tr id="swr_02_0046__en-us_topic_0000001231313913_row5596103116338"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.5.1.1"><p id="swr_02_0046__en-us_topic_0000001231313913_p14597123123316">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.5.1.2"><p id="swr_02_0046__en-us_topic_0000001231313913_p20597123183313">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.5.1.3"><p id="swr_02_0046__en-us_topic_0000001231313913_p1459714319335">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.4.3.2.5.1.4"><p id="swr_02_0046__en-us_topic_0000001231313913_p105977314339">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="swr_02_0046__en-us_topic_0000001231313913_row259616313338"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.5.1.1 "><p id="swr_02_0046__en-us_topic_0000001231313913_p16598103119332">[items]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.5.1.2 "><p id="swr_02_0046__en-us_topic_0000001231313913_p1359873118334">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.5.1.3 "><p id="swr_02_0046__en-us_topic_0000001231313913_p125981131193317">Array of <a href="#swr_02_0046__en-us_topic_0000001231313913_request_UserAuth">UserAuth</a> objects</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.3.2.5.1.4 "><p id="swr_02_0046__en-us_topic_0000001231313913_p559803143310">Information required for creating image permissions.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="swr_02_0046__en-us_topic_0000001231313913_request_UserAuth"></a><a name="en-us_topic_0000001231313913_request_UserAuth"></a><table cellpadding="4" cellspacing="0" summary="" id="swr_02_0046__en-us_topic_0000001231313913_request_UserAuth" frame="border" border="1" rules="all"><caption><b>Table 4 </b>UserAuth</caption><thead align="left"><tr id="swr_02_0046__en-us_topic_0000001231313913_row1599331183311"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.5.1.1"><p id="swr_02_0046__en-us_topic_0000001231313913_p759913123310">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.5.1.2"><p id="swr_02_0046__en-us_topic_0000001231313913_p1360053113335">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.5.1.3"><p id="swr_02_0046__en-us_topic_0000001231313913_p260033113313">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.4.4.2.5.1.4"><p id="swr_02_0046__en-us_topic_0000001231313913_p2600531203313">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="swr_02_0046__en-us_topic_0000001231313913_row1459933123315"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.5.1.1 "><p id="swr_02_0046__en-us_topic_0000001231313913_p1560014313334">user_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.5.1.2 "><p id="swr_02_0046__en-us_topic_0000001231313913_p1060053173313">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.5.1.3 "><p id="swr_02_0046__en-us_topic_0000001231313913_p660016313335">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.4.2.5.1.4 "><p id="swr_02_0046__en-us_topic_0000001231313913_p8601153111330">User ID, which needs to be obtained from IAM.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="swr_02_0046__en-us_topic_0000001231313913_row55994318333"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.5.1.1 "><p id="swr_02_0046__en-us_topic_0000001231313913_p20601531133312">user_name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.5.1.2 "><p id="swr_02_0046__en-us_topic_0000001231313913_p860115315336">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.5.1.3 "><p id="swr_02_0046__en-us_topic_0000001231313913_p560133123318">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.4.2.5.1.4 "><p id="swr_02_0046__en-us_topic_0000001231313913_p1602831143312">Username, which needs to be obtained from IAM.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="swr_02_0046__en-us_topic_0000001231313913_row959916314336"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.5.1.1 "><p id="swr_02_0046__en-us_topic_0000001231313913_p26021931103312">auth</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.5.1.2 "><p id="swr_02_0046__en-us_topic_0000001231313913_p10602431173319">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.5.1.3 "><p id="swr_02_0046__en-us_topic_0000001231313913_p136021631183320">Long</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.4.2.5.1.4 "><p id="swr_02_0046__en-us_topic_0000001231313913_p5603163110336">User permissions. <strong id="swr_02_0046__en-us_topic_0000001231313913_b17502134524315">7</strong>: Manage. <strong id="swr_02_0046__en-us_topic_0000001231313913_b1668515718438">3</strong>: Write. <strong id="swr_02_0046__en-us_topic_0000001231313913_b114066134416">1</strong>: Read.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="swr_02_0046__en-us_topic_0000001231313913_section10603113119331"><h4 class="sectiontitle">Response Parameters</h4><p id="swr_02_0046__en-us_topic_0000001231313913_p8603183111336">None</p>
|
|
</div>
|
|
<div class="section" id="swr_02_0046__en-us_topic_0000001231313913_section19603113110333"><h4 class="sectiontitle">Example Request</h4><pre class="screen" id="swr_02_0046__en-us_topic_0000001231313913_screen13604193117333">POST https://{endpoint}/v2/manage/namespaces/{namespace}/repos/{repository}/access
|
|
|
|
[ {
|
|
"user_id" : "fb3f175c1fd146ab8cdae3272be6107b",
|
|
"user_name" : "user01",
|
|
"auth" : 1
|
|
} ]</pre>
|
|
</div>
|
|
<div class="section" id="swr_02_0046__en-us_topic_0000001231313913_section06051431163314"><h4 class="sectiontitle">Example Response</h4><p id="swr_02_0046__en-us_topic_0000001231313913_p1560513193319">None</p>
|
|
</div>
|
|
<div class="section" id="swr_02_0046__en-us_topic_0000001231313913_section12162143213310"><h4 class="sectiontitle">Status Codes</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="swr_02_0046__en-us_topic_0000001231313913_status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="swr_02_0046__en-us_topic_0000001231313913_row963416312336"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.8.2.1.3.1.1"><p id="swr_02_0046__en-us_topic_0000001231313913_p61621032123315">Status Code</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.8.2.1.3.1.2"><p id="swr_02_0046__en-us_topic_0000001231313913_p7162173273318">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="swr_02_0046__en-us_topic_0000001231313913_row9634163120335"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p id="swr_02_0046__en-us_topic_0000001231313913_p2162123213311">201</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p id="swr_02_0046__en-us_topic_0000001231313913_p201621832173310">Request succeeded.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="swr_02_0046__en-us_topic_0000001231313913_row2634331103319"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p id="swr_02_0046__en-us_topic_0000001231313913_p19162163293318">400</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p id="swr_02_0046__en-us_topic_0000001231313913_p181621323331">Request error.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="swr_02_0046__en-us_topic_0000001231313913_row196341431163314"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p id="swr_02_0046__en-us_topic_0000001231313913_p201621132123320">401</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p id="swr_02_0046__en-us_topic_0000001231313913_p1016283253311">Authentication failed.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="swr_02_0046__en-us_topic_0000001231313913_row126341231113318"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p id="swr_02_0046__en-us_topic_0000001231313913_p1716283215332">404</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p id="swr_02_0046__en-us_topic_0000001231313913_p6162143203317">The image was not found.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="swr_02_0046__en-us_topic_0000001231313913_row1463518314339"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p id="swr_02_0046__en-us_topic_0000001231313913_p11629324331">500</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p id="swr_02_0046__en-us_topic_0000001231313913_p1416253213339">Internal error.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="swr_02_0046__en-us_topic_0000001231313913_section916293213331"><h4 class="sectiontitle">Error Codes</h4><p id="swr_02_0046__en-us_topic_0000001231313913_p1816353253315">For details, see <a href="ErrorCode.html">Error Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="swr_02_0091.html">Image Permission Management</a></div>
|
|
</div>
|
|
</div>
|
|
|