doc-exports/docs/swr/api-ref/swr_02_0048.html
Dong, Qiu Jian f5c28c856a SWR API update 20241012
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com>
Co-authored-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
Co-committed-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
2024-10-18 07:19:46 +00:00

200 lines
14 KiB
HTML

<a name="swr_02_0048"></a><a name="swr_02_0048"></a>
<h1 class="topictitle1">Updating Image Permissions</h1>
<div id="body1531798197465"><div class="section" id="swr_02_0048__se03aae4436e64394a95dc13b6f233898"><h4 class="sectiontitle">Function</h4><p id="swr_02_0048__a7005bd3228d34f8ea0fb7b75b17cfbb2">Update the image operation permissions for certain users.</p>
</div>
<div class="section" id="swr_02_0048__section7809514102216"><h4 class="sectiontitle">Constraints</h4><p id="swr_02_0048__p881061462213">None</p>
</div>
<div class="section" id="swr_02_0048__s476df674307e4b04b9545f9575dde042"><h4 class="sectiontitle">URI</h4><p id="swr_02_0048__p3537273892216">PATCH /v2/manage/namespaces/{<em id="swr_02_0048__i714132210811">namespace</em>}/repos/{<em id="swr_02_0048__i113716271588">repository</em>}/access</p>
<p id="swr_02_0048__p4326739133411">For details about parameters, see <a href="#swr_02_0048__table73271639103420">Table 1</a>.</p>
<div class="tablenoborder"><a name="swr_02_0048__table73271639103420"></a><a name="table73271639103420"></a><table cellpadding="4" cellspacing="0" summary="" id="swr_02_0048__table73271639103420" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="swr_02_0048__row53291539153419"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.3.4.2.5.1.1"><p id="swr_02_0048__p6331539113416">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13%" id="mcps1.3.3.4.2.5.1.2"><p id="swr_02_0048__p108968583240">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16%" id="mcps1.3.3.4.2.5.1.3"><p id="swr_02_0048__p11896658132415">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="54%" id="mcps1.3.3.4.2.5.1.4"><p id="swr_02_0048__p43347399345">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="swr_02_0048__row7335939103416"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.4.2.5.1.1 "><p id="swr_02_0048__p6843228526">namespace</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.3.4.2.5.1.2 "><p id="swr_02_0048__p1289615589248">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.4.2.5.1.3 "><p id="swr_02_0048__p188961458142412">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.3.4.2.5.1.4 "><p id="swr_02_0048__p776511203467">Organization name</p>
</td>
</tr>
<tr id="swr_02_0048__row1316181182114"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.4.2.5.1.1 "><p id="swr_02_0048__p1816115113217">repository</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.3.4.2.5.1.2 "><p id="swr_02_0048__p108971758102416">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.4.2.5.1.3 "><p id="swr_02_0048__p12897145852415">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.3.4.2.5.1.4 "><p id="swr_02_0048__p31611811102113">Image name</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="swr_02_0048__s8246d3afdd6f44dc817ce0c3f2ac7d53"><h4 class="sectiontitle">Request</h4><ul id="swr_02_0048__ul17902859151013"><li id="swr_02_0048__li1690218596102">Request parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="swr_02_0048__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="swr_02_0048__row9845014142211"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.1.1.2.5.1.1"><p id="swr_02_0048__p3847914142211">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.1.1.2.5.1.2"><p id="swr_02_0048__p1484981419227">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.1.1.2.5.1.3"><p id="swr_02_0048__p188511614192217">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.4.2.1.1.2.5.1.4"><p id="swr_02_0048__p2085331472210">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="swr_02_0048__row98451148220"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.1.1.2.5.1.1 "><p id="swr_02_0048__p1885521415224">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.1.1.2.5.1.2 "><p id="swr_02_0048__p285721412215">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.1.1.2.5.1.3 "><p id="swr_02_0048__p17858414132212">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.1.1.2.5.1.4 "><p id="swr_02_0048__p78606144222">Message body type (format). The value can be <strong id="swr_02_0048__b88171675571014">application/json</strong> or <strong id="swr_02_0048__b129702017571014">charset=utf-8 application/json</strong>.</p>
<p id="swr_02_0048__p286191472213">The default value is <strong id="swr_02_0048__b159564633471018">application/json</strong>.</p>
</td>
</tr>
<tr id="swr_02_0048__row6845131416226"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.1.1.2.5.1.1 "><p id="swr_02_0048__p2086321419223">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.1.1.2.5.1.2 "><p id="swr_02_0048__p13864181452214">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.1.1.2.5.1.3 "><p id="swr_02_0048__p118663141224">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.1.1.2.5.1.4 "><p id="swr_02_0048__p1686717140225">User token.</p>
<p id="swr_02_0048__p1186911442218">The token can be obtained by calling an IAM API. The value of <strong id="swr_02_0048__b20855175207118">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_0048__table165971458223" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request body parameter description</caption><thead align="left"><tr id="swr_02_0048__row359715532217"><th align="left" class="cellrowborder" valign="top" width="17.83%" id="mcps1.3.4.2.1.2.2.5.1.1"><p id="swr_02_0048__p20597145112217">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.21%" id="mcps1.3.4.2.1.2.2.5.1.2"><p id="swr_02_0048__p1597175112218">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.43%" id="mcps1.3.4.2.1.2.2.5.1.3"><p id="swr_02_0048__p1359745102213">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="45.53%" id="mcps1.3.4.2.1.2.2.5.1.4"><p id="swr_02_0048__p17597555221">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="swr_02_0048__row95971653228"><td class="cellrowborder" valign="top" width="17.83%" headers="mcps1.3.4.2.1.2.2.5.1.1 "><p id="swr_02_0048__p059705152210"><em id="swr_02_0048__i108591583284">[Array element]</em></p>
</td>
<td class="cellrowborder" valign="top" width="18.21%" headers="mcps1.3.4.2.1.2.2.5.1.2 "><p id="swr_02_0048__p1559795182218">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.43%" headers="mcps1.3.4.2.1.2.2.5.1.3 "><p id="swr_02_0048__p8597115182214">Array of <a href="#swr_02_0048__table6912142367">objects</a></p>
</td>
<td class="cellrowborder" valign="top" width="45.53%" headers="mcps1.3.4.2.1.2.2.5.1.4 "><p id="swr_02_0048__p1859719572210">Information about the image permission to be updated.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="swr_02_0048__table6912142367"></a><a name="table6912142367"></a><table cellpadding="4" cellspacing="0" summary="" id="swr_02_0048__table6912142367" frame="border" border="1" rules="all"><caption><b>Table 4 </b><em id="swr_02_0048__i1895419488288">[Array element]</em> parameter description</caption><thead align="left"><tr id="swr_02_0048__row494101419361"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.4.2.1.3.2.5.1.1"><p id="swr_02_0048__p495214193611">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13%" id="mcps1.3.4.2.1.3.2.5.1.2"><p id="swr_02_0048__p763819132514">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16%" id="mcps1.3.4.2.1.3.2.5.1.3"><p id="swr_02_0048__p15638892255">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="54%" id="mcps1.3.4.2.1.3.2.5.1.4"><p id="swr_02_0048__p1498214113618">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="swr_02_0048__row69961413365"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.1.3.2.5.1.1 "><p id="swr_02_0048__p1110011416365">user_id</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.4.2.1.3.2.5.1.2 "><p id="swr_02_0048__p186387916259">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.4.2.1.3.2.5.1.3 "><p id="swr_02_0048__p1263818912520">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.4.2.1.3.2.5.1.4 "><p id="swr_02_0048__p59076141223">User ID. Obtain it from IAM.</p>
</td>
</tr>
<tr id="swr_02_0048__row3105101418360"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.1.3.2.5.1.1 "><p id="swr_02_0048__p3107314193615">user_name</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.4.2.1.3.2.5.1.2 "><p id="swr_02_0048__p56389912515">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.4.2.1.3.2.5.1.3 "><p id="swr_02_0048__p763816917251">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.4.2.1.3.2.5.1.4 "><p id="swr_02_0048__p14915181402211">Username. Obtain it from IAM.</p>
</td>
</tr>
<tr id="swr_02_0048__row135101232143711"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.1.3.2.5.1.1 "><p id="swr_02_0048__p35101132143714">auth</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.4.2.1.3.2.5.1.2 "><p id="swr_02_0048__p9638791258">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.4.2.1.3.2.5.1.3 "><p id="swr_02_0048__p18638189142515">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.4.2.1.3.2.5.1.4 "><p id="swr_02_0048__p1751033214375">User permission that is configured.</p>
<ul id="swr_02_0048__ul654813144019"><li id="swr_02_0048__li115901316202">7: Manage</li><li id="swr_02_0048__li55991417708">3: Write</li><li id="swr_02_0048__li15482141406">1: Read</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="swr_02_0048__li17451822110">Example request<pre class="screen" id="swr_02_0048__screen1187634103814">PATCH https://{Endpoint}/v2/manage/namespaces/<em id="swr_02_0048__i1249054713815">group</em>/repos/<em id="swr_02_0048__i1248717510386">busybox</em>/access
[ {
"user_id" : "fb3f175c1fd146ab8cdae3272be6107b",
"user_name" : "user01",
"auth" : 7
} ]</pre>
</li></ul>
</div>
<div class="section" id="swr_02_0048__sab9be5ce850743859bb238e072f8d1f2"><h4 class="sectiontitle">Response</h4><ul id="swr_02_0048__ul11656391015"><li id="swr_02_0048__li194756411106">Response parameters<p id="swr_02_0048__p370911481507"><a name="swr_02_0048__li194756411106"></a><a name="li194756411106"></a>N/A</p>
</li><li id="swr_02_0048__li129849446013">Example response<p id="swr_02_0048__p732714595221"><a name="swr_02_0048__li129849446013"></a><a name="li129849446013"></a>None</p>
</li></ul>
</div>
<div class="section" id="swr_02_0048__s336c1dbc7af446a1b3cc077ea3f82fc9"><h4 class="sectiontitle">Status Code</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="swr_02_0048__t33d02fa79e8443868a71c99f411610a5" frame="border" border="1" rules="all"><thead align="left"><tr id="swr_02_0048__r9eb80d64e8f34d0db940daa95fc929dd"><th align="left" class="cellrowborder" valign="top" width="16.439999999999998%" id="mcps1.3.6.2.1.3.1.1"><p id="swr_02_0048__a7e51ed73a71e4dc29d0dd4aae3016632">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="83.56%" id="mcps1.3.6.2.1.3.1.2"><p id="swr_02_0048__aa802d02e21c944f1863435a0d11c7ec1">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="swr_02_0048__r1cc0192c651444db882dde750b14be23"><td class="cellrowborder" valign="top" width="16.439999999999998%" headers="mcps1.3.6.2.1.3.1.1 "><p id="swr_02_0048__a6a3639a3cb154e17b95c5076c8036471">201</p>
</td>
<td class="cellrowborder" valign="top" width="83.56%" headers="mcps1.3.6.2.1.3.1.2 "><p id="swr_02_0048__ad54ae639e7f94380a87bfc10cc91a4f0">Updated successfully.</p>
</td>
</tr>
<tr id="swr_02_0048__r0bd68000afe546dd9c7a8d3a05991a04"><td class="cellrowborder" valign="top" width="16.439999999999998%" headers="mcps1.3.6.2.1.3.1.1 "><p id="swr_02_0048__ad46ccdc6b7e04df3b6b5679f7606f434">400</p>
</td>
<td class="cellrowborder" valign="top" width="83.56%" headers="mcps1.3.6.2.1.3.1.2 "><p id="swr_02_0048__a1f2e8d58145d461781428d28f07a5351">Request error.</p>
</td>
</tr>
<tr id="swr_02_0048__row059261364320"><td class="cellrowborder" valign="top" width="16.439999999999998%" headers="mcps1.3.6.2.1.3.1.1 "><p id="swr_02_0048__p059261310438">401</p>
</td>
<td class="cellrowborder" valign="top" width="83.56%" headers="mcps1.3.6.2.1.3.1.2 "><p id="swr_02_0048__p759261314433">Authentication failed.</p>
</td>
</tr>
<tr id="swr_02_0048__row9547111612437"><td class="cellrowborder" valign="top" width="16.439999999999998%" headers="mcps1.3.6.2.1.3.1.1 "><p id="swr_02_0048__p19547131615432">404</p>
</td>
<td class="cellrowborder" valign="top" width="83.56%" headers="mcps1.3.6.2.1.3.1.2 "><p id="swr_02_0048__p16547416114315">The image or the image permission does not exist.</p>
</td>
</tr>
<tr id="swr_02_0048__r19bdef782c164c93917f897241e521f8"><td class="cellrowborder" valign="top" width="16.439999999999998%" headers="mcps1.3.6.2.1.3.1.1 "><p id="swr_02_0048__a7da68e311c0f4267bacf3cbdb71d1ead">500</p>
</td>
<td class="cellrowborder" valign="top" width="83.56%" headers="mcps1.3.6.2.1.3.1.2 "><p id="swr_02_0048__aa6fd12cedd8841e29eeeca27c1bdea1a">Internal error.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="swr_02_0048__section134071631161117"><h4 class="sectiontitle">Error Codes</h4><p id="swr_02_0048__p15408431161114">For details, see <a href="swr_02_0024.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0000001470924909.html">Image Permission Management</a></div>
</div>
</div>