forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Dong, Qiu Jian <qiujiandong1@huawei.com> Co-committed-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
149 lines
12 KiB
HTML
149 lines
12 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__section3270966102931"><h4 class="sectiontitle">Request</h4><ul id="swr_02_0030__ul11839102492219"><li id="swr_02_0030__li1783952412218">Request parameters
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="swr_02_0030__table106311754152313" frame="border" border="1" rules="all"><caption><b>Table 2 </b>FormData parameter description</caption><thead align="left"><tr id="swr_02_0030__row16631125411231"><th align="left" class="cellrowborder" valign="top" width="15.941594159415938%" id="mcps1.3.3.2.1.1.2.5.1.1"><p id="swr_02_0030__p6631654202310">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15.831583158315832%" id="mcps1.3.3.2.1.1.2.5.1.2"><p id="swr_02_0030__p1163145415238">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="16.21162116211621%" id="mcps1.3.3.2.1.1.2.5.1.3"><p id="swr_02_0030__p136314548239">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="52.01520152015201%" id="mcps1.3.3.2.1.1.2.5.1.4"><p id="swr_02_0030__p166311754122312">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="swr_02_0030__row13631175452316"><td class="cellrowborder" valign="top" width="15.941594159415938%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="swr_02_0030__p06312054142312">repository</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.831583158315832%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="swr_02_0030__p5631115412230">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.21162116211621%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="swr_02_0030__p16311954112317">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="52.01520152015201%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="swr_02_0030__p36552717296">Image repository name.</p>
|
|
<p id="swr_02_0030__p2063111543236">Enter 1 to 128 characters, starting and ending 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__row2063195420234"><td class="cellrowborder" valign="top" width="15.941594159415938%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="swr_02_0030__p13631454152312">category</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.831583158315832%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="swr_02_0030__p11631175472317">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.21162116211621%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="swr_02_0030__p663165413237">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="52.01520152015201%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="swr_02_0030__p71841725332">Repository type.</p>
|
|
<p id="swr_02_0030__p1763115547236">The value can be <strong id="swr_02_0030__b198041516104918">app_server</strong>, <strong id="swr_02_0030__b2948131824914">linux</strong>, <strong id="swr_02_0030__b59923288493">framework_app</strong>, <strong id="swr_02_0030__b168683054914">database</strong>, <strong id="swr_02_0030__b18436034204910">lang</strong>, <strong id="swr_02_0030__b12198936194920">other</strong>, <strong id="swr_02_0030__b93086407493">windows</strong> or <strong id="swr_02_0030__b7837124144915">arm</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="swr_02_0030__row186320540234"><td class="cellrowborder" valign="top" width="15.941594159415938%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="swr_02_0030__p19632954182311">description</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.831583158315832%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="swr_02_0030__p863295410231">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.21162116211621%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="swr_02_0030__p6632195411236">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="52.01520152015201%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="swr_02_0030__p12632185416237">Brief description of the image repository.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="swr_02_0030__row3632354142318"><td class="cellrowborder" valign="top" width="15.941594159415938%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="swr_02_0030__p26324542236">is_public</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.831583158315832%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="swr_02_0030__p106321554102310">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.21162116211621%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="swr_02_0030__p176322054112311">Boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="52.01520152015201%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="swr_02_0030__p763245415236">Whether the repository is a public repository. When the value is <strong id="swr_02_0030__b44516695117">true</strong>, it indicates the repository is public. When the value is<strong id="swr_02_0030__b1945196155112"> false</strong>, it indicates the repository is private.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li><li id="swr_02_0030__li158254263228">Example request<pre class="screen" id="swr_02_0030__screen1719122310307">POST https://{Endpoint}/v2/manage/namespaces/<em id="swr_02_0030__i1812525522813">group</em>/repos</pre>
|
|
<p id="swr_02_0030__p13189347143411">Body:</p>
|
|
<pre class="screen" id="swr_02_0030__screen543635892028">-F "repository=busybox" \
|
|
-F "category=linux" \
|
|
-F "description=this is a busybox repository" \
|
|
-F "is_public=true"</pre>
|
|
<p id="swr_02_0030__p771661733420">Or</p>
|
|
<pre class="screen" id="swr_02_0030__screen113104519417">{
|
|
"repository": "busybox",
|
|
"category": "linux",
|
|
"description": "this is a busybox repository",
|
|
"is_public": true
|
|
}</pre>
|
|
<div class="note" id="swr_02_0030__note17261131517421"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="swr_02_0030__p15261615134218">The form format will no longer be supported soon. You are advised to use the body in the JSON format to call the API.</p>
|
|
</div></div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="swr_02_0030__section46271297104114"><h4 class="sectiontitle">Response</h4><ul id="swr_02_0030__ul64473314258"><li id="swr_02_0030__li12447183112253">Response parameters<p id="swr_02_0030__p11533204472519"><a name="swr_02_0030__li12447183112253"></a><a name="li12447183112253"></a>N/A</p>
|
|
</li><li id="swr_02_0030__li985416337256">Example response<pre class="screen" id="swr_02_0030__screen94909421256">{}</pre>
|
|
</li></ul>
|
|
</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.5.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.5.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.5.2.1.3.1.1 "><p id="swr_02_0030__p53752024103012">201</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.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.5.2.1.3.1.1 "><p id="swr_02_0030__p11375724133011">400</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.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.5.2.1.3.1.1 "><p id="swr_02_0030__p2093513935619">401</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.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.5.2.1.3.1.1 "><p id="swr_02_0030__p2015111596307">409</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.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.5.2.1.3.1.1 "><p id="swr_02_0030__p937619249301">500</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.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>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="swr_02_0011.html">API</a></div>
|
|
</div>
|
|
</div>
|
|
|