doc-exports/docs/swr/api-ref/swr_02_0030.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

176 lines
13 KiB
HTML

<a name="swr_02_0030"></a><a name="swr_02_0030"></a>
<h1 class="topictitle1">Creating an Image Repository</h1>
<div id="body1531798197427"><div class="section" id="swr_02_0030__section14905762191056"><h4 class="sectiontitle">Function</h4><p id="swr_02_0030__p38546794191926">Create an image repository in an organization.</p>
</div>
<div class="section" id="swr_02_0030__section10482810165331"><h4 class="sectiontitle">URI</h4><p id="swr_02_0030__p191142462814">POST /v2/manage/namespaces/{<em id="swr_02_0030__i5256554593">namespace</em>}/repos</p>
<p id="swr_02_0030__p4347710111317">For details about parameters, see <a href="#swr_02_0030__table155961192716">Table 1</a>.</p>
<div class="tablenoborder"><a name="swr_02_0030__table155961192716"></a><a name="table155961192716"></a><table cellpadding="4" cellspacing="0" summary="" id="swr_02_0030__table155961192716" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="swr_02_0030__row66016114276"><th align="left" class="cellrowborder" valign="top" width="18.48184818481848%" id="mcps1.3.2.4.2.5.1.1"><p id="swr_02_0030__p1969191112717">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.09120912091209%" id="mcps1.3.2.4.2.5.1.2"><p id="swr_02_0030__p1311119571031">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.95179517951795%" id="mcps1.3.2.4.2.5.1.3"><p id="swr_02_0030__p14796031194218">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="51.475147514751484%" id="mcps1.3.2.4.2.5.1.4"><p id="swr_02_0030__p20214193316271">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="swr_02_0030__row12601115273"><td class="cellrowborder" valign="top" width="18.48184818481848%" headers="mcps1.3.2.4.2.5.1.1 "><p id="swr_02_0030__p8692191132719">namespace</p>
</td>
<td class="cellrowborder" valign="top" width="12.09120912091209%" headers="mcps1.3.2.4.2.5.1.2 "><p id="swr_02_0030__p1611814571310">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.95179517951795%" headers="mcps1.3.2.4.2.5.1.3 "><p id="swr_02_0030__p48011931194218">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.475147514751484%" headers="mcps1.3.2.4.2.5.1.4 "><p id="swr_02_0030__p1317518468289">Organization name.</p>
<p id="swr_02_0030__p7304102751814">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>
</tbody>
</table>
</div>
</div>
<div class="section" id="swr_02_0030__section128631027131419"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="swr_02_0030__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="swr_02_0030__row9864182720148"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="swr_02_0030__p886622701412">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="swr_02_0030__p1867182720145">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="swr_02_0030__p138671427201410">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="swr_02_0030__p118681627181410">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="swr_02_0030__row2864102791419"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="swr_02_0030__p1586912278144">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="swr_02_0030__p68701227161413">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="swr_02_0030__p1187082721411">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="swr_02_0030__p168715272148">Message body type (format). The value can be <strong id="swr_02_0030__b15621546987956">application/json</strong> or <strong id="swr_02_0030__b10839578297956">charset=utf-8 application/json</strong>.</p>
<p id="swr_02_0030__p20871327191417">The default value is <strong id="swr_02_0030__b298603747100">application/json</strong>.</p>
</td>
</tr>
<tr id="swr_02_0030__row7864152712143"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="swr_02_0030__p1787292720147">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="swr_02_0030__p1872227141414">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="swr_02_0030__p1187302716143">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="swr_02_0030__p128741027181411">User token.</p>
<p id="swr_02_0030__p14874152771412">The token can be obtained by calling an IAM API. The value of <strong id="swr_02_0030__b125923212271048">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_0030__request_CreateRepoRequestBody" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request body parameters</caption><thead align="left"><tr id="swr_02_0030__row19875192710141"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="swr_02_0030__p1487782720143">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_0030__p10877327191410">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_0030__p187882713148">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_0030__p68791727101416">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="swr_02_0030__row287562716144"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="swr_02_0030__p78792270147">repository</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="swr_02_0030__p1788042718143">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="swr_02_0030__p588018278148">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="swr_02_0030__p1288122751412">Image repository name. An image repository name contains 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.</p>
</td>
</tr>
<tr id="swr_02_0030__row17875162719145"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="swr_02_0030__p388332715143">is_public</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="swr_02_0030__p15884112731412">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="swr_02_0030__p17884327151418">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="swr_02_0030__p98851327121416">Whether the repository is public. <strong id="swr_02_0030__b17169639101719">true</strong> indicates that the repository is public. <strong id="swr_02_0030__b1316913391175">false</strong> indicates that the repository is private.</p>
</td>
</tr>
<tr id="swr_02_0030__row68755275141"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="swr_02_0030__p2088516275144">category</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="swr_02_0030__p8886102761415">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="swr_02_0030__p0886727161410">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="swr_02_0030__p1188712274147">Repository type. The value can be <strong id="swr_02_0030__b1261525110177">app_server</strong>, <strong id="swr_02_0030__b136164511178">linux</strong>, <strong id="swr_02_0030__b461605113179">framework_app</strong>, <strong id="swr_02_0030__b156161351201719">database</strong>, <strong id="swr_02_0030__b12616195111179">lang</strong>, <strong id="swr_02_0030__b18617125110171">arm</strong>, or <strong id="swr_02_0030__b9617651191711">other</strong>.</p>
</td>
</tr>
<tr id="swr_02_0030__row178769273143"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="swr_02_0030__p3888527111418">description</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="swr_02_0030__p888852717146">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="swr_02_0030__p188890275147">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="swr_02_0030__p1389052761413">Brief description of the image repository.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="swr_02_0030__section12891827181415"><h4 class="sectiontitle">Response Parameters</h4><p id="swr_02_0030__p389192781413">None</p>
</div>
<div class="section" id="swr_02_0030__section689219278148"><h4 class="sectiontitle">Example Request</h4><pre class="screen" id="swr_02_0030__screen1689313271145">POST https://{endpoint}/v2/manage/namespaces/{namespace}/repos
{
"repository" : "busybox",
"category" : "linux",
"description" : "this is a busybox repository",
"is_public" : true
}</pre>
</div>
<div class="section" id="swr_02_0030__section11896127181417"><h4 class="sectiontitle">Example Response</h4><p id="swr_02_0030__p18897192771410">None</p>
</div>
<div class="section" id="swr_02_0030__section5365169104253"><h4 class="sectiontitle">Status Code</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="swr_02_0030__table1537514248301" frame="border" border="1" rules="all"><thead align="left"><tr id="swr_02_0030__row183751324163014"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.7.2.1.3.1.1"><p id="swr_02_0030__p1437512453016">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.7.2.1.3.1.2"><p id="swr_02_0030__p23751724153018">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="swr_02_0030__row837511241306"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.2.1.3.1.1 "><p id="swr_02_0030__p53752024103012">201</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.2.1.3.1.2 "><p id="swr_02_0030__p5375162413308">Creation successful.</p>
</td>
</tr>
<tr id="swr_02_0030__row13375142417305"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.2.1.3.1.1 "><p id="swr_02_0030__p11375724133011">400</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.2.1.3.1.2 "><p id="swr_02_0030__p13761324103020">Request error. Error information is returned.</p>
</td>
</tr>
<tr id="swr_02_0030__row1293417915613"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.2.1.3.1.1 "><p id="swr_02_0030__p2093513935619">401</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.2.1.3.1.2 "><p id="swr_02_0030__p9935209195617">Authentication failed.</p>
</td>
</tr>
<tr id="swr_02_0030__row615125910308"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.2.1.3.1.1 "><p id="swr_02_0030__p2015111596307">409</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.2.1.3.1.2 "><p id="swr_02_0030__p1215115593304">The repository already exists.</p>
</td>
</tr>
<tr id="swr_02_0030__row837612433016"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.2.1.3.1.1 "><p id="swr_02_0030__p937619249301">500</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.2.1.3.1.2 "><p id="swr_02_0030__p33761245309">Internal error. Error information is returned.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="swr_02_0030__section134071631161117"><h4 class="sectiontitle">Error Codes</h4><p id="swr_02_0030__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_0000001420528490.html">Image Repository Management</a></div>
</div>
</div>