doc-exports/docs/ims/api-ref/en-us_topic_0000001361039284.html
Hasko, Vladimir 0c7b91f4bd Initial import of IMS API
Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2022-10-05 08:51:25 +00:00

184 lines
16 KiB
HTML

<a name="EN-US_TOPIC_0000001361039284"></a><a name="EN-US_TOPIC_0000001361039284"></a>
<h1 class="topictitle1">Updating the Status of Image Members in Batches</h1>
<div id="body1472781317567"><div class="section" id="EN-US_TOPIC_0000001361039284__section11046056154747"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001361039284__p36522613182741">This API is an extension one and used to update the image sharing status after the tenant accepts or rejects the shared images.</p>
<p id="EN-US_TOPIC_0000001361039284__p7229911386">This API is an asynchronous one. If <strong id="EN-US_TOPIC_0000001361039284__b1693617177116">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_0000001361039284__b393618171815">success</strong>, the task is successfully executed. If the status is <strong id="EN-US_TOPIC_0000001361039284__b3937151715116">failed</strong>, the task fails. For details about how to query the status of an asynchronous task, see <a href="en-us_topic_0000001361199224.html">Asynchronous Job Query</a>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001361039284__section66620681154747"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0000001361039284__p171775859356">PUT /v1/cloudimages/members</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001361039284__section29704853154747"><h4 class="sectiontitle">Request</h4><ul id="EN-US_TOPIC_0000001361039284__ul48754330102731"><li id="EN-US_TOPIC_0000001361039284__li30121347154747">Request parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001361039284__table23910047154747" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001361039284__row24965460154747"><th align="left" class="cellrowborder" valign="top" width="20.86%" id="mcps1.3.3.2.1.1.1.5.1.1"><p id="EN-US_TOPIC_0000001361039284__p8936346154747">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.919999999999998%" id="mcps1.3.3.2.1.1.1.5.1.2"><p id="EN-US_TOPIC_0000001361039284__p4072498116916">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.990000000000002%" id="mcps1.3.3.2.1.1.1.5.1.3"><p id="EN-US_TOPIC_0000001361039284__p52755425154747">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="37.230000000000004%" id="mcps1.3.3.2.1.1.1.5.1.4"><p id="EN-US_TOPIC_0000001361039284__p57477321154747">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001361039284__row25151394154747"><td class="cellrowborder" valign="top" width="20.86%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0000001361039284__p503796569524">images</p>
</td>
<td class="cellrowborder" valign="top" width="19.919999999999998%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0000001361039284__p542203749524">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="21.990000000000002%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0000001361039284__p297741849524">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="37.230000000000004%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0000001361039284__p628987279524">Specifies the image IDs.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001361039284__row97255929413"><td class="cellrowborder" valign="top" width="20.86%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0000001361039284__p178181919524">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="19.919999999999998%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0000001361039284__p339873569524">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="21.990000000000002%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0000001361039284__p15124339524">String</p>
</td>
<td class="cellrowborder" valign="top" width="37.230000000000004%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0000001361039284__p553982639524">Specifies the project ID.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001361039284__row387653339418"><td class="cellrowborder" valign="top" width="20.86%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0000001361039284__p529068859524">status</p>
</td>
<td class="cellrowborder" valign="top" width="19.919999999999998%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0000001361039284__p575993249524">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="21.990000000000002%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0000001361039284__p350336309524">String</p>
</td>
<td class="cellrowborder" valign="top" width="37.230000000000004%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0000001361039284__p25826739537">Specifies whether a shared image will be accepted or declined.</p>
<p id="EN-US_TOPIC_0000001361039284__p166859539539">The value can be one of the following:</p>
<ul id="EN-US_TOPIC_0000001361039284__ul346242429557"><li id="EN-US_TOPIC_0000001361039284__li41401210142719"><strong id="EN-US_TOPIC_0000001361039284__b84235270693711">accepted</strong>: indicates that a shared image is accepted. After an image is accepted, the image is displayed in the image list. You can use the image to create ECSs.</li><li id="EN-US_TOPIC_0000001361039284__li17906312142713"><strong id="EN-US_TOPIC_0000001361039284__b84235270693734">rejected</strong>: indicates that a shared image is declined. After an image is declined, the image is not displayed in the image list. However, you can still use the image to create ECSs.</li></ul>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001361039284__row25222413200"><td class="cellrowborder" valign="top" width="20.86%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0000001361039284__p25362419209">vault_id</p>
</td>
<td class="cellrowborder" valign="top" width="19.919999999999998%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0000001361039284__p1853142418208">No</p>
</td>
<td class="cellrowborder" valign="top" width="21.990000000000002%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0000001361039284__p185392422014">String</p>
</td>
<td class="cellrowborder" valign="top" width="37.230000000000004%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0000001361039284__p2071553113019">Specifies the ID of a vault.</p>
<p id="EN-US_TOPIC_0000001361039284__p105352411209">This parameter is mandatory if you want to accept a shared full-ECS image created from a CBR backup.</p>
<p id="EN-US_TOPIC_0000001361039284__p3165158171619">You can obtain the vault ID from the CBR console or section "Querying the Vault List" in <em id="EN-US_TOPIC_0000001361039284__i361910498486">Cloud Backup and Recovery API Reference</em>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0000001361039284__li6755299102749">Example request<ul id="EN-US_TOPIC_0000001361039284__ul1558183483917"><li id="EN-US_TOPIC_0000001361039284__li45817342395">If the shared images do not include full-ECS images:<pre class="codeblock" id="EN-US_TOPIC_0000001361039284__codeblock07871341183918">PUT https://{Endpoint}/v1/cloudimages/members</pre>
<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0000001361039284__screen157871741123914"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2
3
4
5
6
7
8</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s">&quot;images&quot;</span><span class="p">:</span> <span class="o">[</span>
<span class="s">&quot;d164b5df-1bc3-4c3f-893e-3e471fd16e64&quot;</span><span class="p">,</span>
<span class="s">&quot;0b680482-acaa-4045-b14c-9a8c7dfe9c70&quot;</span>
<span class="o">]</span><span class="p">,</span>
<span class="s">&quot;project_id&quot;</span><span class="p">:</span> <span class="s">&quot;edc89b490d7d4392898e19b2deb34797&quot;</span><span class="p">,</span>
<span class="s">&quot;status&quot;</span><span class="p">:</span> <span class="s">&quot;accepted&quot;</span>
<span class="p">}</span>
</pre></div>
</td></tr></table></div>
</li><li id="EN-US_TOPIC_0000001361039284__li3581133418392">If the shared images include full-ECS images:<pre class="codeblock" id="EN-US_TOPIC_0000001361039284__codeblock2277124610362">PUT https://{Endpoint}/v1/cloudimages/members</pre>
<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0000001361039284__screen9277184619367"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2
3
4
5
6
7
8
9</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s">&quot;images&quot;</span><span class="p">:</span> <span class="o">[</span>
<span class="s">&quot;d164b5df-1bc3-4c3f-893e-3e471fd16e64&quot;</span><span class="p">,</span>
<span class="s">&quot;0b680482-acaa-4045-b14c-9a8c7dfe9c70&quot;</span>
<span class="o">]</span><span class="p">,</span>
<span class="s">&quot;project_id&quot;</span><span class="p">:</span> <span class="s">&quot;edc89b490d7d4392898e19b2deb34797&quot;</span><span class="p">,</span>
<span class="s">&quot;status&quot;</span><span class="p">:</span> <span class="s">&quot;accepted&quot;</span><span class="p">,</span>
<span class="s">&quot;vault_id&quot;</span><span class="p">:</span> <span class="s">&quot;d14r5tef-1bc3-4c4f-823e-3e471rg65e65&quot;</span>
<span class="p">}</span>
</pre></div>
</td></tr></table></div>
</li></ul>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001361039284__section42338041154747"><h4 class="sectiontitle">Response</h4><ul id="EN-US_TOPIC_0000001361039284__ul5242527391115"><li id="EN-US_TOPIC_0000001361039284__li206541791115">Response parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001361039284__table1858875391115" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001361039284__row5097995091115"><th align="left" class="cellrowborder" valign="top" width="30.486951304869514%" id="mcps1.3.4.2.1.1.1.4.1.1"><p id="EN-US_TOPIC_0000001361039284__p3573529991115">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.078292170782923%" id="mcps1.3.4.2.1.1.1.4.1.2"><p id="EN-US_TOPIC_0000001361039284__p4803685091115">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="52.434756524347556%" id="mcps1.3.4.2.1.1.1.4.1.3"><p id="EN-US_TOPIC_0000001361039284__p6577961291115">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001361039284__row2654833891115"><td class="cellrowborder" valign="top" width="30.486951304869514%" headers="mcps1.3.4.2.1.1.1.4.1.1 "><p id="EN-US_TOPIC_0000001361039284__p293180691115">job_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.078292170782923%" headers="mcps1.3.4.2.1.1.1.4.1.2 "><p id="EN-US_TOPIC_0000001361039284__p4244468991115">String</p>
</td>
<td class="cellrowborder" valign="top" width="52.434756524347556%" headers="mcps1.3.4.2.1.1.1.4.1.3 "><p id="EN-US_TOPIC_0000001361039284__p1546781891115">Specifies the asynchronous job ID.</p>
<p id="EN-US_TOPIC_0000001361039284__p19968122117312">For details, see <a href="en-us_topic_0000001361199224.html">Asynchronous Job Query</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0000001361039284__li3986255291235">Example response<pre class="codeblock" id="EN-US_TOPIC_0000001361039284__codeblock6641838292551">STATUS CODE 200</pre>
<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0000001361039284__screen4148514791229"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2
3</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s">&quot;job_id&quot;</span><span class="p">:</span> <span class="s">&quot;edc89b490d7d4392898e19b2deb34797&quot;</span>
<span class="p">}</span>
</pre></div>
</td></tr></table></div>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001361039284__section40084941"><h4 class="sectiontitle">Returned Value</h4><ul id="EN-US_TOPIC_0000001361039284__ul4445458"><li id="EN-US_TOPIC_0000001361039284__li40009126">Normal<p id="EN-US_TOPIC_0000001361039284__p24537816"><a name="EN-US_TOPIC_0000001361039284__li40009126"></a><a name="li40009126"></a>200</p>
</li><li id="EN-US_TOPIC_0000001361039284__li19513753">Abnormal
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001361039284__table1069408417333" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001361039284__row4772021317333"><th align="left" class="cellrowborder" valign="top" width="46.54%" id="mcps1.3.5.2.2.1.1.3.1.1"><p id="EN-US_TOPIC_0000001361039284__p4013206717333">Returned Value</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="53.459999999999994%" id="mcps1.3.5.2.2.1.1.3.1.2"><p id="EN-US_TOPIC_0000001361039284__p2947196917333">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001361039284__row3841925517333"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0000001361039284__p2495195017333">400 Bad Request</p>
</td>
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0000001361039284__p784206117333">Request error. For details, see <a href="en-us_topic_0000001411239233.html">Error Codes</a>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001361039284__row3122722917333"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0000001361039284__p4637763817333">401 Unauthorized</p>
</td>
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0000001361039284__p6560116717333">Authentication failed.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001361039284__row5353959117333"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0000001361039284__p4173958717333">403 Forbidden</p>
</td>
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0000001361039284__p2546341217333">You do not have the rights to perform the operation.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001361039284__row5197513192250"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0000001361039284__p21898657192252">404 Not Found</p>
</td>
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0000001361039284__p28960832192252">The requested resource was not found.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001361039284__row2784412417333"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0000001361039284__p4078159117333">500 Internal Server Error</p>
</td>
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0000001361039284__p1497458717333">Internal service error.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001361039284__row55355517333"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0000001361039284__p4483799017333">503 Service Unavailable</p>
</td>
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0000001361039284__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_0000001411399137.html">Image Sharing</a></div>
</div>
</div>