doc-exports/docs/ims/api-ref/en-us_topic_0036994317.html
guoyanyan 313c8b6ba0 ims_api_1109
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: guoyanyan <guoyanyan3@huawei.com>
Co-committed-by: guoyanyan <guoyanyan3@huawei.com>
2023-01-31 12:48:42 +00:00

170 lines
14 KiB
HTML

<a name="EN-US_TOPIC_0036994317"></a><a name="EN-US_TOPIC_0036994317"></a>
<h1 class="topictitle1">Adding an Image Member (Native OpenStack API)</h1>
<div id="body1472781317551"><div class="section" id="EN-US_TOPIC_0036994317__section59471393"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0036994317__p23115188">This API is used to add a project ID of a tenant with whom the image is to be shared.</p>
</div>
<div class="section" id="EN-US_TOPIC_0036994317__section1855352011546"><h4 class="sectiontitle">Constraints</h4><p id="EN-US_TOPIC_0036994317__en-us_topic_0036994322_p14592113565118">For an encrypted image, you need to authorize the key used by the image before adding a member for it. For details, see "How Do I Authorize a Key?" in <em id="EN-US_TOPIC_0036994317__i186871271615">Image Management Service User Guide</em>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0036994317__section65480490"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0036994317__p27967115104859">POST /v2/images/{image_id}/members</p>
</div>
<div class="section" id="EN-US_TOPIC_0036994317__section52453505"><h4 class="sectiontitle">Request</h4><ul id="EN-US_TOPIC_0036994317__ul464063571218"><li id="EN-US_TOPIC_0036994317__li18359556142633">Request parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0036994317__table31018281142633" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0036994317__row35509333142633"><th align="left" class="cellrowborder" valign="top" width="13.389999999999999%" id="mcps1.3.4.2.1.1.1.5.1.1"><p id="EN-US_TOPIC_0036994317__p57683706142633">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.88%" id="mcps1.3.4.2.1.1.1.5.1.2"><p id="EN-US_TOPIC_0036994317__p41868624142633">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.13%" id="mcps1.3.4.2.1.1.1.5.1.3"><p id="EN-US_TOPIC_0036994317__p35915390142633">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="47.599999999999994%" id="mcps1.3.4.2.1.1.1.5.1.4"><p id="EN-US_TOPIC_0036994317__p23465517142633">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0036994317__row21658757142633"><td class="cellrowborder" valign="top" width="13.389999999999999%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0036994317__p9528877142633">member</p>
</td>
<td class="cellrowborder" valign="top" width="19.88%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0036994317__p33641549142633">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.13%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0036994317__p40610958142633">String</p>
</td>
<td class="cellrowborder" valign="top" width="47.599999999999994%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0036994317__p19199817142646">Specifies the image member.</p>
<p id="EN-US_TOPIC_0036994317__p958017914274">The value is the project ID of a tenant.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0036994317__li1145113163619">Example request<pre class="codeblock" id="EN-US_TOPIC_0036994317__codeblock709371891739">POST https://{Endpoint}/v2/images/d164b5df-1bc3-4c3f-893e-3e471fd16e64/members</pre>
<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0036994317__screen5303500291729"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><span class="p">{</span>
<span class="w"> </span><span class="s">&quot;member&quot;</span><span class="p">:</span><span class="s">&quot;edc89b490d7d4392898e19b2deb34797&quot;</span>
<span class="p">}</span>
</pre></div></td></tr></table></div>
</div>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0036994317__section2319502"><h4 class="sectiontitle">Response</h4><ul id="EN-US_TOPIC_0036994317__ul34425536115459"><li id="EN-US_TOPIC_0036994317__li38934872105824">Response parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0036994317__table170389018811" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0036994317__row1730386618811"><th align="left" class="cellrowborder" valign="top" width="21.91%" id="mcps1.3.5.2.1.1.1.4.1.1"><p id="EN-US_TOPIC_0036994317__p5943589418811">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.99%" id="mcps1.3.5.2.1.1.1.4.1.2"><p id="EN-US_TOPIC_0036994317__p4957807018811">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="61.1%" id="mcps1.3.5.2.1.1.1.4.1.3"><p id="EN-US_TOPIC_0036994317__p5640070618811">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0036994317__row25955412182112"><td class="cellrowborder" valign="top" width="21.91%" headers="mcps1.3.5.2.1.1.1.4.1.1 "><p id="EN-US_TOPIC_0036994317__p30073002105145">status</p>
</td>
<td class="cellrowborder" valign="top" width="16.99%" headers="mcps1.3.5.2.1.1.1.4.1.2 "><p id="EN-US_TOPIC_0036994317__p8906282105145">String</p>
</td>
<td class="cellrowborder" valign="top" width="61.1%" headers="mcps1.3.5.2.1.1.1.4.1.3 "><p id="EN-US_TOPIC_0036994317__p50320231105145">Specifies the image sharing status.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036994317__row3995446182130"><td class="cellrowborder" valign="top" width="21.91%" headers="mcps1.3.5.2.1.1.1.4.1.1 "><p id="EN-US_TOPIC_0036994317__p42008850105145">created_at</p>
</td>
<td class="cellrowborder" valign="top" width="16.99%" headers="mcps1.3.5.2.1.1.1.4.1.2 "><p id="EN-US_TOPIC_0036994317__p3960824105145">String</p>
</td>
<td class="cellrowborder" valign="top" width="61.1%" headers="mcps1.3.5.2.1.1.1.4.1.3 "><p id="EN-US_TOPIC_0036994317__p52391359105145">Specifies the time when a shared image was created. The value is in UTC format.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036994317__row505449918811"><td class="cellrowborder" valign="top" width="21.91%" headers="mcps1.3.5.2.1.1.1.4.1.1 "><p id="EN-US_TOPIC_0036994317__p8357119105145">updated_at</p>
</td>
<td class="cellrowborder" valign="top" width="16.99%" headers="mcps1.3.5.2.1.1.1.4.1.2 "><p id="EN-US_TOPIC_0036994317__p3117216105145">String</p>
</td>
<td class="cellrowborder" valign="top" width="61.1%" headers="mcps1.3.5.2.1.1.1.4.1.3 "><p id="EN-US_TOPIC_0036994317__p51167945105145">Specifies the time when a shared image was updated. The value is in UTC format. </p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036994317__row57822993182152"><td class="cellrowborder" valign="top" width="21.91%" headers="mcps1.3.5.2.1.1.1.4.1.1 "><p id="EN-US_TOPIC_0036994317__p56013058105145">image_id</p>
</td>
<td class="cellrowborder" valign="top" width="16.99%" headers="mcps1.3.5.2.1.1.1.4.1.2 "><p id="EN-US_TOPIC_0036994317__p13537362105145">String</p>
</td>
<td class="cellrowborder" valign="top" width="61.1%" headers="mcps1.3.5.2.1.1.1.4.1.3 "><p id="EN-US_TOPIC_0036994317__p22784520105145">Specifies the image ID.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036994317__row13561662182215"><td class="cellrowborder" valign="top" width="21.91%" headers="mcps1.3.5.2.1.1.1.4.1.1 "><p id="EN-US_TOPIC_0036994317__p34026356105145">member_id</p>
</td>
<td class="cellrowborder" valign="top" width="16.99%" headers="mcps1.3.5.2.1.1.1.4.1.2 "><p id="EN-US_TOPIC_0036994317__p42845703105145">String</p>
</td>
<td class="cellrowborder" valign="top" width="61.1%" headers="mcps1.3.5.2.1.1.1.4.1.3 "><p id="EN-US_TOPIC_0036994317__p47949893105145">Specifies the member ID, that is, the project ID of the tenant who is to accept the shared image.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036994317__row31851202182230"><td class="cellrowborder" valign="top" width="21.91%" headers="mcps1.3.5.2.1.1.1.4.1.1 "><p id="EN-US_TOPIC_0036994317__p58862775105145">schema</p>
</td>
<td class="cellrowborder" valign="top" width="16.99%" headers="mcps1.3.5.2.1.1.1.4.1.2 "><p id="EN-US_TOPIC_0036994317__p54265792105145">String</p>
</td>
<td class="cellrowborder" valign="top" width="61.1%" headers="mcps1.3.5.2.1.1.1.4.1.3 "><p id="EN-US_TOPIC_0036994317__p33453007105145">Specifies the sharing schema.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0036994317__li41394368115459">Example response<pre class="codeblock" id="EN-US_TOPIC_0036994317__codeblock196137214713">STATUS CODE 200</pre>
<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0036994317__screen47755925131752"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span>
<span class="normal">8</span></pre></div></td><td class="code"><div><pre><span></span><span class="p">{</span>
<span class="w"> </span><span class="s">&quot;status&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;pending&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s">&quot;created_at&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;2016-09-01T02:05:14Z&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s">&quot;updated_at&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;2016-09-01T02:05:14Z&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s">&quot;image_id&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;d164b5df-1bc3-4c3f-893e-3e471fd16e64&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s">&quot;member_id&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;edc89b490d7d4392898e19b2deb34797&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s">&quot;schema&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;/v2/schemas/member&quot;</span>
<span class="p">}</span>
</pre></div></td></tr></table></div>
</div>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0036994317__section61374531"><h4 class="sectiontitle">Returned Values</h4><ul id="EN-US_TOPIC_0036994317__ul31470215"><li id="EN-US_TOPIC_0036994317__li14796483">Normal<p id="EN-US_TOPIC_0036994317__p66059488"><a name="EN-US_TOPIC_0036994317__li14796483"></a><a name="li14796483"></a>200</p>
</li><li id="EN-US_TOPIC_0036994317__li57664488">Abnormal
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0036994317__table271454817439" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0036994317__row3541095017439"><th align="left" class="cellrowborder" valign="top" width="46.54%" id="mcps1.3.6.2.2.1.1.3.1.1"><p id="EN-US_TOPIC_0036994317__p4971469317439">Returned Value</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="53.459999999999994%" id="mcps1.3.6.2.2.1.1.3.1.2"><p id="EN-US_TOPIC_0036994317__p35835717439"><strong id="EN-US_TOPIC_0036994317__b84235270616929">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0036994317__row2902697417439"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0036994317__p237466317439">400 Bad Request</p>
</td>
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0036994317__p5812997617439">Request error.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036994317__row5340773917439"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0036994317__p3105962817439">401 Unauthorized</p>
</td>
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0036994317__p3280197817439">Authentication failed.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036994317__row2678235117439"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0036994317__p2188683517439">403 Forbidden</p>
</td>
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0036994317__p2800317417439">You do not have the rights to perform the operation.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036994317__row16775501191954"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0036994317__p19013873191957">404 Not Found</p>
</td>
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0036994317__p63728762191957">The requested resource was not found.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036994317__row5070198217439"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0036994317__p1321988617439">500 Internal Server Error</p>
</td>
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0036994317__p6417782617439">Internal service error.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036994317__row4072952517439"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0036994317__p1075724317439">503 Service Unavailable</p>
</td>
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0036994317__p6603036117439">The service is unavailable.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0122410336.html">Image Sharing (Native OpenStack APIs)</a></div>
</div>
</div>