doc-exports/docs/ims/api-ref/en-us_topic_0036994322.html
Zaoxu, Li c236478734 IMS API DOC
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com>
Co-authored-by: Zaoxu, Li <lizaoxu@huawei.com>
Co-committed-by: Zaoxu, Li <lizaoxu@huawei.com>
2024-06-05 07:22:50 +00:00

152 lines
12 KiB
HTML

<a name="EN-US_TOPIC_0036994322"></a><a name="EN-US_TOPIC_0036994322"></a>
<h1 class="topictitle1">Adding Image Sharing Members</h1>
<div id="body1472781317565"><div class="section" id="EN-US_TOPIC_0036994322__section66302617144828"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0036994322__p1802929144828">This API is an extension one and used to share more than one image with multiple tenants.</p>
<p id="EN-US_TOPIC_0036994322__p7229911386">This API is an asynchronous one. If <strong id="EN-US_TOPIC_0036994322__b2271254184416">job_id</strong> is returned, the task is successfully delivered. You need to query the status of the asynchronous task. If the status is <strong id="EN-US_TOPIC_0036994322__b10273165417444">success</strong>, the task is successfully executed. If the status is <strong id="EN-US_TOPIC_0036994322__b1927675415440">failed</strong>, the task fails. For details about how to query the status of an asynchronous task, see <a href="en-us_topic_0022473688.html">Querying the Status of an Asynchronous Job</a>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0036994322__section1152812813512"><h4 class="sectiontitle">Constraints</h4><p id="EN-US_TOPIC_0036994322__p14592113565118">For encrypted images, you need to authorize the keys used by the images before you use this API. For details, see "How Do I Authorize a Key?" in <em id="EN-US_TOPIC_0036994322__i1497145911413">Image Management Service User Guide</em>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0036994322__section16226363144828"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0036994322__p26513862144828">POST /v1/cloudimages/members</p>
</div>
<div class="section" id="EN-US_TOPIC_0036994322__section22707920144828"><h4 class="sectiontitle">Request</h4><ul id="EN-US_TOPIC_0036994322__ul56368594153652"><li id="EN-US_TOPIC_0036994322__li24655304153652">Request parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0036994322__table53011268153646" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0036994322__row8255548153646"><th align="left" class="cellrowborder" valign="top" width="22.24%" id="mcps1.3.4.2.1.1.1.5.1.1"><p id="EN-US_TOPIC_0036994322__p64719651153646">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.08%" id="mcps1.3.4.2.1.1.1.5.1.2"><p id="EN-US_TOPIC_0036994322__p1758425020468">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23.919999999999998%" id="mcps1.3.4.2.1.1.1.5.1.3"><p id="EN-US_TOPIC_0036994322__p27850258153646">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="32.76%" id="mcps1.3.4.2.1.1.1.5.1.4"><p id="EN-US_TOPIC_0036994322__p41278443153646">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0036994322__row55219556153646"><td class="cellrowborder" valign="top" width="22.24%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0036994322__p45852693181844">images</p>
</td>
<td class="cellrowborder" valign="top" width="21.08%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0036994322__p95846509462">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="23.919999999999998%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0036994322__p57596693181844">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="32.76%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0036994322__p34820580181844">Specifies the image IDs.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036994322__row6698413181831"><td class="cellrowborder" valign="top" width="22.24%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0036994322__p17052548181844">projects</p>
</td>
<td class="cellrowborder" valign="top" width="21.08%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0036994322__p17584115084618">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="23.919999999999998%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0036994322__p11293510181844">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="32.76%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0036994322__p42359132181844">Specifies the project IDs.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0036994322__section1277355051114"><h4 class="sectiontitle">Example Request</h4><p id="EN-US_TOPIC_0036994322__p914835718116">Adding tenants who can use shared images (image IDs: d164b5df-1bc3-4c3f-893e-3e471fd16e64, 0b680482-acaa-4045-b14c-9a8c7dfe9c70; project IDs: 9c61004714024f9586705d090530f9fa, edc89b490d7d4392898e19b2deb34797)</p>
<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0036994322__screen246509181616"><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>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">POST</span><span class="w"> </span><span class="n">https</span><span class="p">:</span><span class="c1">//{Endpoint}/v1/cloudimages/members</span>
<span class="p">{</span>
<span class="w"> </span><span class="s">&quot;images&quot;</span><span class="p">:</span><span class="w"> </span><span class="o">[</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;0b680482-acaa-4045-b14c-9a8c7dfe9c70&quot;</span>
<span class="w"> </span><span class="o">]</span><span class="p">,</span>
<span class="w"> </span><span class="s">&quot;projects&quot;</span><span class="p">:</span><span class="w"> </span><span class="o">[</span>
<span class="w"> </span><span class="s">&quot;9c61004714024f9586705d090530f9fa&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s">&quot;edc89b490d7d4392898e19b2deb34797&quot;</span>
<span class="w"> </span><span class="o">]</span>
<span class="p">}</span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0036994322__section37386190144828"><h4 class="sectiontitle">Response</h4><ul id="EN-US_TOPIC_0036994322__ul1587130153836"><li id="EN-US_TOPIC_0036994322__li50749703153836">Response parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0036994322__table65680948153746" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0036994322__row59664825153746"><th align="left" class="cellrowborder" valign="top" width="36.36636336366364%" id="mcps1.3.6.2.1.1.1.4.1.1"><p id="EN-US_TOPIC_0036994322__p1012670153746">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.58834116588341%" id="mcps1.3.6.2.1.1.1.4.1.2"><p id="EN-US_TOPIC_0036994322__p352397153746">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="47.045295470452956%" id="mcps1.3.6.2.1.1.1.4.1.3"><p id="EN-US_TOPIC_0036994322__p28544167153746">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0036994322__row30376173153746"><td class="cellrowborder" valign="top" width="36.36636336366364%" headers="mcps1.3.6.2.1.1.1.4.1.1 "><p id="EN-US_TOPIC_0036994322__p3318816181939">job_id</p>
</td>
<td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.3.6.2.1.1.1.4.1.2 "><p id="EN-US_TOPIC_0036994322__p31480262181939">String</p>
</td>
<td class="cellrowborder" valign="top" width="47.045295470452956%" headers="mcps1.3.6.2.1.1.1.4.1.3 "><p id="EN-US_TOPIC_0036994322__p66873325181939">Specifies the asynchronous job ID.</p>
<p id="EN-US_TOPIC_0036994322__p19968122117312">For details, see <a href="en-us_topic_0022473688.html">Querying the Status of an Asynchronous Job</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0036994322__li1188069315398">Example response<pre class="codeblock" id="EN-US_TOPIC_0036994322__codeblock6641838292551">STATUS CODE 200</pre>
<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0036994322__screen24406525214018"><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;job_id&quot;</span><span class="p">:</span><span class="w"> </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_0036994322__section40084941"><h4 class="sectiontitle">Returned Values</h4><ul id="EN-US_TOPIC_0036994322__ul4445458"><li id="EN-US_TOPIC_0036994322__li40009126">Normal<p id="EN-US_TOPIC_0036994322__p24537816"><a name="EN-US_TOPIC_0036994322__li40009126"></a><a name="li40009126"></a>200</p>
</li><li id="EN-US_TOPIC_0036994322__li19513753">Abnormal
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0036994322__table1069408417333" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0036994322__row4772021317333"><th align="left" class="cellrowborder" valign="top" width="46.54%" id="mcps1.3.7.2.2.1.1.3.1.1"><p id="EN-US_TOPIC_0036994322__p4013206717333">Returned Value</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="53.459999999999994%" id="mcps1.3.7.2.2.1.1.3.1.2"><p id="EN-US_TOPIC_0036994322__p2947196917333">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0036994322__row3841925517333"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0036994322__p2495195017333">400 Bad Request</p>
</td>
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0036994322__p784206117333">Request error. For details, see <a href="en-us_topic_0022473689.html">Error Codes</a>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036994322__row3122722917333"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0036994322__p4637763817333">401 Unauthorized</p>
</td>
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0036994322__p6560116717333">Authentication failed.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036994322__row5353959117333"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0036994322__p4173958717333">403 Forbidden</p>
</td>
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0036994322__p2546341217333">You do not have the rights to perform the operation.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036994322__row5197513192250"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0036994322__p21898657192252">404 Not Found</p>
</td>
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0036994322__p28960832192252">The requested resource was not found.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036994322__row2784412417333"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0036994322__p4078159117333">500 Internal Server Error</p>
</td>
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0036994322__p1497458717333">Internal service error.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036994322__row55355517333"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0036994322__p4483799017333">503 Service Unavailable</p>
</td>
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0036994322__p799858217333">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_0135482660.html">Image Sharing</a></div>
</div>
</div>